xref: /kvm-unit-tests/scripts/s390x/func.bash (revision bff3aac854e533d1e86592ac3bfab6eb4734eee1)
1238b5967SMarc Hartmayer# The file scripts/common.bash has to be the only file sourcing this
2238b5967SMarc Hartmayer# arch helper file
3238b5967SMarc Hartmayersource config.mak
4238b5967SMarc Hartmayer
5238b5967SMarc HartmayerARCH_CMD=arch_cmd_s390x
6238b5967SMarc Hartmayer
7238b5967SMarc Hartmayerfunction arch_cmd_s390x()
8238b5967SMarc Hartmayer{
9238b5967SMarc Hartmayer	local cmd=$1
10238b5967SMarc Hartmayer	local testname=$2
11238b5967SMarc Hartmayer	local groups=$3
12238b5967SMarc Hartmayer	local smp=$4
13238b5967SMarc Hartmayer	local kernel=$5
14238b5967SMarc Hartmayer	local opts=$6
15238b5967SMarc Hartmayer	local arch=$7
16238b5967SMarc Hartmayer	local check=$8
17238b5967SMarc Hartmayer	local accel=$9
18238b5967SMarc Hartmayer	local timeout=${10}
19238b5967SMarc Hartmayer
20238b5967SMarc Hartmayer	# run the normal test case
21238b5967SMarc Hartmayer	"$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout"
22238b5967SMarc Hartmayer
23238b5967SMarc Hartmayer	# run PV test case
24*bff3aac8SNicholas Piggin	if [ "$accel" = 'tcg' ] || grep -q "migration" <<< "$groups"; then
25c99ae8c0SJanosch Frank		return
26c99ae8c0SJanosch Frank	fi
27238b5967SMarc Hartmayer	kernel=${kernel%.elf}.pv.bin
28238b5967SMarc Hartmayer	testname=${testname}_PV
29238b5967SMarc Hartmayer	if [ ! -f "${kernel}" ]; then
30238b5967SMarc Hartmayer		if [ -z "${HOST_KEY_DOCUMENT}" ]; then
31238b5967SMarc Hartmayer			return 2
32238b5967SMarc Hartmayer		fi
33238b5967SMarc Hartmayer
34238b5967SMarc Hartmayer		print_result 'SKIP' $testname '' 'PVM image was not created'
35238b5967SMarc Hartmayer		return 2
36238b5967SMarc Hartmayer	fi
37238b5967SMarc Hartmayer	"$cmd" "$testname" "$groups pv" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout"
38238b5967SMarc Hartmayer}
39