mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-05 13:05:45 +00:00
tests: Use newgrp to run unit tests
Rather than set filesystem permissions on the /dev/kvm device instead use the kvm group added by installing qemu for running the unit tests. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
f5a6e3c1ca
commit
8b78e1221e
3
Jenkinsfile
vendored
3
Jenkinsfile
vendored
@ -11,11 +11,10 @@ stage ("Builds") {
|
|||||||
sh "nohup curl https://sh.rustup.rs -sSf | sh -s -- -y"
|
sh "nohup curl https://sh.rustup.rs -sSf | sh -s -- -y"
|
||||||
}
|
}
|
||||||
stage ('Run unit tests') {
|
stage ('Run unit tests') {
|
||||||
sh "sudo chmod a+rw /dev/kvm"
|
|
||||||
sh "scripts/run_unit_tests.sh"
|
sh "scripts/run_unit_tests.sh"
|
||||||
}
|
}
|
||||||
stage ('Run integration tests') {
|
stage ('Run integration tests') {
|
||||||
sh "sudo mount -t tmpfs tmpfs /tmp"
|
sh "sudo mount -t tmpfs tmpfs /tmp"
|
||||||
sh "scripts/run_integration_tests.sh"
|
sh "scripts/run_integration_tests.sh"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,11 @@ pushd target/debug
|
|||||||
ls | grep net_util | grep -v "\.d" | xargs -n 1 sudo setcap cap_net_admin,cap_net_raw+ep
|
ls | grep net_util | grep -v "\.d" | xargs -n 1 sudo setcap cap_net_admin,cap_net_raw+ep
|
||||||
popd
|
popd
|
||||||
|
|
||||||
for f in $(find . -name Cargo.toml -printf '%h\n' | sort -u); do
|
sudo adduser $USER kvm
|
||||||
pushd $f > /dev/null;
|
newgrp kvm << EOF || exit 1
|
||||||
|
for f in \$(find . -name Cargo.toml -printf '%h\n' | sort -u); do
|
||||||
|
pushd \$f > /dev/null;
|
||||||
cargo test || exit 1;
|
cargo test || exit 1;
|
||||||
popd > /dev/null;
|
popd > /dev/null;
|
||||||
done
|
done
|
||||||
|
EOF
|
||||||
|
Loading…
Reference in New Issue
Block a user