tests: Add tests that use (non-existing) named tap

The current tests support giving a tap name but they only test with tap
interfaces that already exist.

Fixes: #871

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2020-05-05 10:25:35 +01:00 committed by Sebastien Boeuf
parent 6fde2d18a6
commit 54b3329f0c

View File

@ -1386,7 +1386,17 @@ mod tests {
}
#[test]
fn test_vhost_user_net_tap() {
fn test_vhost_user_net_named_tap() {
test_vhost_user_net(
Some("mytap0"),
2,
Some(&prepare_vhost_user_net_daemon),
false,
)
}
#[test]
fn test_vhost_user_net_existing_tap() {
test_vhost_user_net(
Some("vunet-tap0"),
2,
@ -2176,7 +2186,7 @@ mod tests {
"--net",
guest.default_net_string().as_str(),
"tap=,mac=8a:6b:6f:5a:de:ac,ip=192.168.3.1,mask=255.255.255.0",
"tap=,mac=fe:1f:9e:e1:60:f2,ip=192.168.4.1,mask=255.255.255.0",
"tap=mytap1,mac=fe:1f:9e:e1:60:f2,ip=192.168.4.1,mask=255.255.255.0",
])
.spawn()
.unwrap();