xref: /kvm-unit-tests/powerpc/run (revision 6afb94812d924a754e2d44f6c5de9e1859b2df28)
1#!/usr/bin/env bash
2
3if [ -z "$KUT_STANDALONE" ]; then
4	if [ ! -f config.mak ]; then
5		echo "run ./configure && make first. See ./configure -h"
6		exit 2
7	fi
8	source config.mak
9	source scripts/arch-run.bash
10fi
11
12ACCEL=$(get_qemu_accelerator) ||
13	exit $?
14
15qemu=$(search_qemu_binary) ||
16	exit $?
17
18if ! $qemu -machine '?' 2>&1 | grep 'pseries' > /dev/null; then
19	echo "$qemu doesn't support pSeries ('-machine pseries'). Exiting."
20	exit 2
21fi
22
23M='-machine pseries'
24M+=",accel=$ACCEL"
25command="$qemu -nodefaults $M -bios $FIRMWARE"
26command+=" -display none -serial stdio -kernel"
27command="$(migration_cmd) $(timeout_cmd) $command"
28
29# powerpc tests currently exit with rtas-poweroff, which exits with 0.
30# run_qemu treats that as a failure exit and returns 1, so we need
31# to fixup the fixup below by parsing the true exit code from the output.
32# The second fixup is also a FIXME, because once we add chr-testdev
33# support for powerpc, we won't need the second fixup.
34run_qemu_status $command "$@"
35