From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: [kvm-unit-tests PATCH 13/14] powerpc/ppc64: add run script and unittests.cfg Date: Mon, 3 Aug 2015 16:41:30 +0200 Message-ID: <1438612891-3718-14-git-send-email-drjones@redhat.com> References: <1438612891-3718-1-git-send-email-drjones@redhat.com> Cc: dgibson@redhat.com, david@gibson.dropbear.id.au, agraf@suse.de, thuth@redhat.com, lvivier@redhat.com, pbonzini@redhat.com To: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:36595 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754053AbbHCOmH (ORCPT ); Mon, 3 Aug 2015 10:42:07 -0400 In-Reply-To: <1438612891-3718-1-git-send-email-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Now that we have all the pieces, pull them together into the run script. To run a test do ./powerpc-run powerpc/test.elf To run all tests in unittests.cfg do ./run_tests.sh Signed-off-by: Andrew Jones --- powerpc/run | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ powerpc/unittests.cfg | 19 +++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100755 powerpc/run create mode 100644 powerpc/unittests.cfg diff --git a/powerpc/run b/powerpc/run new file mode 100755 index 0000000000000..5bc826765eff8 --- /dev/null +++ b/powerpc/run @@ -0,0 +1,57 @@ +#!/bin/bash + +if [ ! -f config.mak ]; then + echo run ./configure first. See ./configure -h + exit 2 +fi +source config.mak +source scripts/functions.bash + +processor="$PROCESSOR" + +# Default to using KVM if available +if [ -c /dev/kvm ]; then + if [ "$HOST" = "ppc64" ] && [ "$ARCH" = "ppc64" ]; then + usingkvm=yes + fi +fi + +qemu="${QEMU:-qemu-system-$ARCH_NAME}" +qpath=$(which $qemu 2>/dev/null) + +if [ -z "$qpath" ]; then + echo $qemu not found. + exit 2 +fi + +if ! $qemu -machine '?' 2>&1 | grep 'pseries' > /dev/null; then + echo "$qpath doesn't support pSeries ('-machine pseries'). Exiting." + exit 2 +fi + +boot_rom='powerpc/boot_rom.bin' +if [ -f powerpc/rom/boot_rom.bin ]; then + boot_rom='powerpc/rom/boot_rom.bin' +fi + +M='-machine pseries' +if [ "$DRYRUN" != "yes" ]; then + if [ "$usingkvm" = "yes" ]; then + M+=',accel=kvm' + else + echo "Running with TCG" + M+=',accel=tcg' + fi +else + M+=',accel=kvm:tcg' +fi + +command="$qemu $M -bios $boot_rom -display none -serial stdio -kernel" +echo $command "$@" + +if [ "$DRYRUN" != "yes" ]; then + $command "$@" | $SNOOPER + ret=$? + echo Return value from qemu: $ret + exit $ret +fi diff --git a/powerpc/unittests.cfg b/powerpc/unittests.cfg new file mode 100644 index 0000000000000..5da2c6242a1f9 --- /dev/null +++ b/powerpc/unittests.cfg @@ -0,0 +1,19 @@ +# Define your new unittest following the convention: +# [unittest_name] +# file = foo.elf # Name of the "kernel" to be used +# smp = 2 # Number of processors the VM will use during this test +# # Use $MAX_SMP to use the maximum the host supports. +# extra_params = -append # Additional parameters used +# arch = powerpc/ppc64 # Only if test case is specific to one +# groups = group1 group2 # Used to identify test cases with run_tests -g ... + +# +# Test that the configured number of processors (smp = ), and +# that the configured amount of memory (-m ) are correctly setup +# by the framework. +# +[selftest-setup] +file = selftest.elf +smp = 2 +extra_params = -m 256 -append 'setup smp=2 mem=256' +groups = selftest -- 2.4.3