xref: /kvm-unit-tests/scripts/s390x/func.bash (revision d4d46483b04af75be0b4d44a8ce9b513ef3f4a69)
1# The file scripts/common.bash has to be the only file sourcing this
2# arch helper file
3source config.mak
4
5ARCH_CMD=arch_cmd_s390x
6
7function arch_cmd_s390x()
8{
9	local cmd=$1
10	local testname=$2
11	local groups=$3
12	local smp=$4
13	local kernel=$5
14	local test_args=$6
15	local opts=$7
16	local arch=$8
17	local machine=$9
18	local check=${10}
19	local accel=${11}
20	local timeout=${12}
21
22	# run the normal test case
23	"$cmd" "$testname" "$groups" "$smp" "$kernel" "$test_args" "$opts" "$arch" "$machine" "$check" "$accel" "$timeout"
24
25	# run PV test case
26	if [ "$accel" = 'tcg' ] || grep -q "migration" <<< "$groups"; then
27		return
28	fi
29	kernel=${kernel%.elf}.pv.bin
30	testname=${testname}_PV
31	if [ ! -f "${kernel}" ]; then
32		if [ -z "${HOST_KEY_DOCUMENT}" ]; then
33			return 2
34		fi
35
36		print_result 'SKIP' $testname '' 'PVM image was not created'
37		return 2
38	fi
39	"$cmd" "$testname" "$groups pv" "$smp" "$kernel" "$test_args" "$opts" "$arch" "$machine" "$check" "$accel" "$timeout"
40}
41