tests: Switch to launching by command

Launch the test binary by command rather than using using the vmm layer.
This makes it easier to manage the running VM as you can explicitly kill
it.

Also switch to using credibility for the tests which catches assertions
and continues with subsequent commands and reports the issues at the
end. This means it is possible to cleanup even on failed test runs.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2019-06-04 16:24:39 +01:00
parent ddce3df826
commit 1f53488003
4 changed files with 108 additions and 38 deletions

View File

@@ -28,8 +28,8 @@ rm /tmp/cloudinit.img
mkdosfs -n config-2 -C /tmp/cloudinit.img 8192
mcopy -oi /tmp/cloudinit.img -s test_data/cloud-init/openstack ::
cargo test --features "integration_tests" --no-run
find target/debug/deps/ -name cloud_hypervisor* | xargs -n1 sudo setcap cap_net_admin+ep
cargo build
sudo setcap cap_net_admin+ep target/debug/cloud-hypervisor
# Tests must be executed serially for now as they have a hardcoded IP address
cargo test --features "integration_tests" -- --test-threads=1