xref: /kvm-unit-tests/scripts/s390x/func.bash (revision 4c8a99ca02252d4a2bee43f4558fe47ce5ab7ec0)
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 opts=$6
15	local arch=$7
16	local check=$8
17	local accel=$9
18	local timeout=${10}
19
20	# run the normal test case
21	"$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout"
22
23	# run PV test case
24	if [ "$ACCEL" = 'tcg' ] || find_word "migration" "$groups"; then
25		return
26	fi
27	kernel=${kernel%.elf}.pv.bin
28	testname=${testname}_PV
29	if [ ! -f "${kernel}" ]; then
30		if [ -z "${HOST_KEY_DOCUMENT}" ]; then
31			return 2
32		fi
33
34		print_result 'SKIP' $testname '' 'PVM image was not created'
35		return 2
36	fi
37	"$cmd" "$testname" "$groups pv" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout"
38}
39