From 3d6b5459effc8fceaba960b029d63b3885680c6f Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 21 Nov 2019 17:35:44 +0000 Subject: [PATCH] ci: Make the integration test binary run with same caps By giving the same caps to both cloud-hypervisor and the test binary, we can access information under /proc related to the VM PID. Signed-off-by: Rob Bradford --- scripts/run_integration_tests.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/run_integration_tests.sh b/scripts/run_integration_tests.sh index f301383df..5ee5d6e34 100755 --- a/scripts/run_integration_tests.sh +++ b/scripts/run_integration_tests.sh @@ -158,6 +158,10 @@ sudo bash -c "echo 10000 > /sys/kernel/mm/ksm/pages_to_scan" sudo bash -c "echo 10 > /sys/kernel/mm/ksm/sleep_millisecs" sudo bash -c "echo 1 > /sys/kernel/mm/ksm/run" +# Ensure test binary has the same caps as the cloud-hypervisor one +cargo test --no-run --features "integration_tests" -- --nocapture +sudo setcap cap_net_admin+ep target/debug/deps/cloud_hypervisor-* + sudo adduser $USER kvm newgrp kvm << EOF export RUST_BACKTRACE=1