mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-21 19:02:30 +00:00
scripts: check hypervisor before running the test
Add two more checks if the hypervisor value is correct. Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
parent
1511cbda87
commit
ca4857b5e6
@ -243,8 +243,8 @@ cmd_build() {
|
||||
ensure_latest_ctr
|
||||
|
||||
process_volumes_args
|
||||
if [[ "$hypervisor" != "kvm" ]]; then
|
||||
die "Hypervisor value must be kvm"
|
||||
if [[ ! ("$hypervisor" = "kvm" || "$hypervisor" = "mshv") ]]; then
|
||||
die "Hypervisor value must be kvm or mshv"
|
||||
fi
|
||||
if [[ "$hypervisor" = "mshv" ]]; then
|
||||
exported_device="/dev/mshv"
|
||||
@ -336,12 +336,14 @@ cmd_tests() {
|
||||
esac
|
||||
shift
|
||||
done
|
||||
if [[ "$hypervisor" != "kvm" ]]; then
|
||||
die "Hypervisor value must be kvm"
|
||||
if [[ ! ("$hypervisor" = "kvm" || "$hypervisor" = "mshv") ]]; then
|
||||
die "Hypervisor value must be kvm or mshv"
|
||||
fi
|
||||
|
||||
if [[ "$hypervisor" = "mshv" ]]; then
|
||||
exported_device="/dev/mshv"
|
||||
fi
|
||||
|
||||
set -- "$@" '--hypervisor' $hypervisor
|
||||
|
||||
ensure_build_dir
|
||||
|
@ -5,6 +5,12 @@ source $HOME/.cargo/env
|
||||
source $(dirname "$0")/test-util.sh
|
||||
|
||||
process_common_args "$@"
|
||||
|
||||
if [[ "$hypervisor" = "mshv" ]]; then
|
||||
echo "Unsupported SGX test for MSHV"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# For now these values are deafult for kvm
|
||||
features_build=""
|
||||
features_test="--features integration_tests"
|
||||
|
@ -33,8 +33,7 @@ process_common_args() {
|
||||
esac
|
||||
shift
|
||||
done
|
||||
if [[ "$hypervisor" != "kvm" ]]; then
|
||||
echo "Hypervisor value must be kvm"
|
||||
exit 1
|
||||
if [[ ! ("$hypervisor" = "kvm" || "$hypervisor" = "mshv") ]]; then
|
||||
die "Hypervisor value must be kvm or mshv"
|
||||
fi
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user