From 8fe5a43d9dad8da598b958847b47e5e162bfc5ad Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Sat, 23 Nov 2019 19:03:49 +0000 Subject: [PATCH] tests: Only setcap on test binary The setcap tool is unusual in its behaviour in that it will process each parameter separately and abort if one of the parameters is invalid (e.g. after a symlink.) But any previous parameters will be correctly processed. This means that depending on the generated test binary name an invalid entry might occur before it and thus abort the setcap. Fix to only setcap on the test binary by excluding the other files. Because the binary name is based on a hash the PR that introduced this version worked but once merged the hash changed and broke the build. Signed-off-by: Rob Bradford --- scripts/run_integration_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run_integration_tests.sh b/scripts/run_integration_tests.sh index 6f8b6633f..620eca693 100755 --- a/scripts/run_integration_tests.sh +++ b/scripts/run_integration_tests.sh @@ -161,7 +161,7 @@ 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-* +ls target/debug/deps/cloud_hypervisor-* | xargs -n 1 sudo setcap cap_net_admin+ep sudo adduser $USER kvm newgrp kvm << EOF