mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +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"
|
||||
}
|
||||
stage ('Run unit tests') {
|
||||
sh "sudo chmod a+rw /dev/kvm"
|
||||
sh "scripts/run_unit_tests.sh"
|
||||
}
|
||||
stage ('Run integration tests') {
|
||||
sh "sudo mount -t tmpfs tmpfs /tmp"
|
||||
sh "sudo mount -t tmpfs tmpfs /tmp"
|
||||
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
|
||||
popd
|
||||
|
||||
for f in $(find . -name Cargo.toml -printf '%h\n' | sort -u); do
|
||||
pushd $f > /dev/null;
|
||||
sudo adduser $USER kvm
|
||||
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;
|
||||
popd > /dev/null;
|
||||
done
|
||||
EOF
|
||||
|
Loading…
Reference in New Issue
Block a user