blob: e469f1eb33c9b5558f3bc906220595fa7eaefcc5 [file] [log] [blame]
#!/usr/bin/env bash
if [ -z "$KUT_STANDALONE" ]; then
if [ ! -f config.mak ]; then
echo "run ./configure && make first. See ./configure -h"
exit 2
fi
source config.mak
source scripts/arch-run.bash
fi
set_qemu_accelerator || exit $?
qemu=$(search_qemu_binary) ||
exit $?
if ! $qemu -machine '?' 2>&1 | grep 'pseries' > /dev/null; then
echo "$qemu doesn't support pSeries ('-machine pseries'). Exiting."
exit 2
fi
M='-machine pseries'
M+=",accel=$ACCEL$ACCEL_PROPS"
if [[ "$ACCEL" == "tcg" ]] ; then
M+=",cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken,cap-ccf-assist=off"
fi
command="$qemu -nodefaults $M -bios $FIRMWARE"
command+=" -display none -serial stdio -kernel"
command="$(migration_cmd) $(timeout_cmd) $command"
# powerpc tests currently exit with rtas-poweroff, which exits with 0.
# run_qemu treats that as a failure exit and returns 1, so we need
# to fixup the fixup below by parsing the true exit code from the output.
# The second fixup is also a FIXME, because once we add chr-testdev
# support for powerpc, we won't need the second fixup.
run_qemu_status $command "$@"