From c95851f48f4bc8be92a7f52e5c474241f467af1f Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Mon, 23 Mar 2020 16:22:48 +0100 Subject: [PATCH] ci: Run vhost-user-net tests for mmio transport No reason to skip vhost-user-net integration tests for the mmio transport build. Signed-off-by: Sebastien Boeuf --- scripts/run_integration_tests.sh | 4 ++++ tests/integration.rs | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/run_integration_tests.sh b/scripts/run_integration_tests.sh index 5b5cb01e0..75359d9e9 100755 --- a/scripts/run_integration_tests.sh +++ b/scripts/run_integration_tests.sh @@ -216,6 +216,10 @@ if [ $RES -eq 0 ]; then cargo build --release --no-default-features --features "mmio" sudo setcap cap_net_admin+ep target/release/cloud-hypervisor + # Ensure test binary has the same caps as the cloud-hypervisor one + time cargo test --no-run --features "integration_tests,mmio" -- --nocapture || exit 1 + ls target/debug/deps/cloud_hypervisor-* | xargs -n 1 sudo setcap cap_net_admin+ep + newgrp kvm << EOF export RUST_BACKTRACE=1 time cargo test --features "integration_tests,mmio" "$@" -- --nocapture diff --git a/tests/integration.rs b/tests/integration.rs index cf129d1ea..4c992aaa1 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -1294,6 +1294,8 @@ mod tests { // Since virtio-net has 2 queue pairs, its vectors is as follows: // 1 virtio-net with 5 vectors: config, Rx (2), Tx (2) // Based on the above, the total vectors should 14. + // This is a PCI only feature. + #[cfg(not(feature = "mmio"))] aver_eq!( tb, guest @@ -1318,12 +1320,12 @@ mod tests { }); } - #[cfg_attr(not(feature = "mmio"), test)] + #[test] fn test_vhost_user_net_default() { test_vhost_user_net(None, 2, Some(&prepare_vhost_user_net_daemon), false) } - #[cfg_attr(not(feature = "mmio"), test)] + #[test] fn test_vhost_user_net_tap() { test_vhost_user_net( Some("vunet-tap0"), @@ -1333,12 +1335,12 @@ mod tests { ) } - #[cfg_attr(not(feature = "mmio"), test)] + #[test] fn test_vhost_user_net_multiple_queues() { test_vhost_user_net(None, 4, Some(&prepare_vhost_user_net_daemon), false) } - #[cfg_attr(not(feature = "mmio"), test)] + #[test] fn test_vhost_user_net_tap_multiple_queues() { test_vhost_user_net( Some("vunet-tap1"), @@ -1348,7 +1350,7 @@ mod tests { ) } - #[cfg_attr(not(feature = "mmio"), test)] + #[test] fn test_vhost_user_net_self_spawning() { test_vhost_user_net(None, 4, None, true) }