2020-11-18 00:37:27 +00:00
|
|
|
#!/bin/bash
|
|
|
|
hypervisor="kvm"
|
2021-01-25 15:55:34 +00:00
|
|
|
test_filter=""
|
2022-02-22 17:05:32 +00:00
|
|
|
test_binary_args=()
|
2021-01-25 15:55:34 +00:00
|
|
|
|
2020-11-18 00:37:27 +00:00
|
|
|
cmd_help() {
|
|
|
|
echo ""
|
|
|
|
echo "Cloud Hypervisor $(basename $0)"
|
|
|
|
echo "Usage: $(basename $0) [<args>]"
|
|
|
|
echo ""
|
|
|
|
echo "Available arguments:"
|
|
|
|
echo ""
|
|
|
|
echo " --hypervisor Underlying hypervisor. Options kvm, mshv"
|
2021-01-25 15:55:34 +00:00
|
|
|
echo " --test-filter Tests to run"
|
2020-11-18 00:37:27 +00:00
|
|
|
echo ""
|
|
|
|
echo " --help Display this help message."
|
|
|
|
echo ""
|
|
|
|
}
|
|
|
|
|
|
|
|
process_common_args() {
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
case "$1" in
|
|
|
|
"-h"|"--help") { cmd_help; exit 1; } ;;
|
|
|
|
"--hypervisor")
|
|
|
|
shift
|
|
|
|
hypervisor="$1"
|
|
|
|
;;
|
2021-01-25 15:55:34 +00:00
|
|
|
"--test-filter")
|
|
|
|
shift
|
|
|
|
test_filter="$1"
|
|
|
|
;;
|
2022-02-22 17:05:32 +00:00
|
|
|
"--") {
|
|
|
|
shift
|
|
|
|
break
|
|
|
|
} ;;
|
2020-11-18 00:37:27 +00:00
|
|
|
*)
|
2022-02-22 17:05:32 +00:00
|
|
|
echo "Unknown test scripts argument: $1. Please use '-- --help' for help."
|
|
|
|
exit
|
|
|
|
;;
|
2020-11-18 00:37:27 +00:00
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
2021-09-23 21:50:26 +00:00
|
|
|
if [[ ! ("$hypervisor" = "kvm" || "$hypervisor" = "mshv") ]]; then
|
|
|
|
die "Hypervisor value must be kvm or mshv"
|
2020-11-18 00:37:27 +00:00
|
|
|
fi
|
2022-02-22 17:05:32 +00:00
|
|
|
|
|
|
|
test_binary_args="$@"
|
2021-01-25 15:55:34 +00:00
|
|
|
}
|