From 006da0405e5112d0de869801dafa8a924a4e0b09 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 7 May 2020 10:00:07 +0100 Subject: [PATCH] tests: Check tap name provided is used for vhost_user_net tests If a preferred tap name is given check that it is created. Signed-off-by: Rob Bradford --- tests/integration.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/integration.rs b/tests/integration.rs index d6459defe..2df5c4e83 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -1306,6 +1306,15 @@ mod tests { .unwrap(); thread::sleep(std::time::Duration::new(20, 0)); + + if let Some(tap_name) = tap { + let tap_count = std::process::Command::new("bash") + .arg("-c") + .arg(format!("ip link | grep -c {}", tap_name)) + .output() + .expect("Expected checking of tap count to succeed"); + aver_eq!(tb, String::from_utf8_lossy(&tap_count.stdout).trim(), "1"); + } // 1 network interface + default localhost ==> 2 interfaces // It's important to note that this test is fully exercising the // vhost-user-net implementation and the associated backend since