From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: [kvm-unit-tests PATCH v5 15/18] powerpc/ppc64: add run script and unittests.cfg Date: Fri, 19 Feb 2016 14:43:57 +1100 Message-ID: <20160219034357.GV15224@voom.fritz.box> References: <1455734459-31902-1-git-send-email-drjones@redhat.com> <1455734459-31902-16-git-send-email-drjones@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Q/AGl/UrDvkbRExF" Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, thuth@redhat.com, dgibson@redhat.com, agraf@suse.de, lvivier@redhat.com, pbonzini@redhat.com, rkrcmar@redhat.com To: Andrew Jones Return-path: Received: from ozlabs.org ([103.22.144.67]:39928 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757173AbcBSD5M (ORCPT ); Thu, 18 Feb 2016 22:57:12 -0500 Content-Disposition: inline In-Reply-To: <1455734459-31902-16-git-send-email-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: --Q/AGl/UrDvkbRExF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 17, 2016 at 07:40:56PM +0100, Andrew Jones wrote: > Now that we have all the pieces, pull them together into a > run script (adapted from arm's). To run a test do './powerpc-run > powerpc/test.elf'. To run all tests in unittests.cfg do > './run_tests.sh' >=20 > (We can now run simple unit tests, but they don't quit on their > own yet. Use ^C to quit them.) >=20 > Signed-off-by: Andrew Jones > Reviewed-by: Thomas Huth > Tested-by: Laurent Vivier Reviewed-by: David Gibson > --- > powerpc/run | 52 +++++++++++++++++++++++++++++++++++++++++++++= ++++++ > powerpc/unittests.cfg | 30 +++++++++++++++++++++++++++++ > 2 files changed, 82 insertions(+) > create mode 100755 powerpc/run > create mode 100644 powerpc/unittests.cfg >=20 > diff --git a/powerpc/run b/powerpc/run > new file mode 100755 > index 0000000000000..47aecb7600832 > --- /dev/null > +++ b/powerpc/run > @@ -0,0 +1,52 @@ > +#!/bin/bash > + > +if [ -z "$STANDALONE" ]; then > + if [ ! -f config.mak ]; then > + echo "run ./configure && make first. See ./configure -h" > + exit 2 > + fi > + source config.mak > +fi > + > +if [ -c /dev/kvm ]; then > + if [ "$HOST" =3D "ppc64" ] && [ "$ARCH" =3D "ppc64" ]; then > + kvm_available=3Dyes > + fi > +fi > + > +if [ "$ACCEL" =3D "kvm" ] && [ "$kvm_available" !=3D "yes" ]; then > + echo "skip $TESTNAME (kvm only)" > + exit 2 > +fi > + > +if [ -z "$ACCEL" ]; then > + if [ "$kvm_available" =3D "yes" ]; then > + ACCEL=3D"kvm" > + else > + ACCEL=3D"tcg" > + fi > +fi > + > +qemu=3D"${QEMU:-qemu-system-$ARCH_NAME}" > +qpath=3D$(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 > + > +M=3D'-machine pseries' > +M+=3D",accel=3D$ACCEL" > +command=3D"$qemu $M -bios powerpc/boot_rom.bin" > +command+=3D" -display none -serial stdio -kernel" > +echo $command "$@" > + > +$command "$@" > +ret=3D$? > +echo Return value from qemu: $ret > +exit $ret > diff --git a/powerpc/unittests.cfg b/powerpc/unittests.cfg > new file mode 100644 > index 0000000000000..60f9be80e8abf > --- /dev/null > +++ b/powerpc/unittests.cfg > @@ -0,0 +1,30 @@ > +########################################################################= ###### > +# unittest configuration > +# > +# [unittest_name] > +# file =3D .flat # Name of the flat file to be used. > +# smp =3D # Number of processors the VM will use > +# # during this test. Use $MAX_SMP to use > +# # the maximum the host supports. Defaults > +# # to one. > +# extra_params =3D -append # Additional parameters used. > +# arch =3D ppc64 # Select one if the test case is > +# # specific to only one. > +# groups =3D ... # Used to identify test cas= es > +# # with run_tests -g ... > +# accel =3D kvm|tcg # Optionally specify if test must run with > +# # kvm or tcg. If not specified, then kvm will > +# # be used when available. > +# timeout =3D # Optionally specify a timeout. > +########################################################################= ###### > + > +# > +# Test that the configured number of processors (smp =3D ), and > +# that the configured amount of memory (-m ) are correctly setup > +# by the framework. > +# > +[selftest-setup] > +file =3D selftest.elf > +smp =3D 2 > +extra_params =3D -m 256 -append 'setup smp=3D2 mem=3D256' > +groups =3D selftest --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --Q/AGl/UrDvkbRExF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWxo99AAoJEGw4ysog2bOSzZcQANxF/K/HO703fHuE+r986Gpi KjaoYpONuKoovhbbxyDi72jLE9XafzGIJWflXiqW5jJRvHJ4U2ROqznL/gzGDEyS tRJNesSi6bcq1WQlkU9Wdr1HSBcK4NYb6gWxlB1NvDsKQ2NBrbVeI4g0IYJgRDCD 3M8TLbF70Noy+iLPKfm0W/87eOwMkgI/J61Uhv9/5cdJzIubrLUK0ZeHVx38F9mc FhC4gGDwDz7qhpuq4Ei9ROATaBwQWeZKGONtPvBWY32mYV7Wk20chbR+3jk7cw9W rXQwLbTzis6DNvRW7ElRUnbeYtwavJogYS5071JBYn9PDyeCiwi4yEK1aGe0AsY+ BI5j+4pM9oVwnCQCxHQMQzqQeo5Nwl8P2DmT5gmQTMHxg5xTFVJC0NkUN+LjNahk QEAGPlcnQ4rurLjKxrzcubO1fVoN9WIdo29qLEzqsmno4/9VBsO3czdrKJ7GxRxI 1HKHC2tiIMJnBhKwM6/zIYIpeybQIE75T/gvIwiew4K0DxwAai6LtcnKA6Jul2H8 o6LP/nmt0FoE/JJJeV7PZe5+Oh08Ul/nj7zouUQ/isB300PwGSadvhUYrA7ohuNQ UBpgPrrNM075iSVu3tMPf0lEvZtiUHqRQ/znDAzb5mw/s3srsHIsYU3lYmbQsVYI IldIkfuXopRhUNBa5It9 =hBEE -----END PGP SIGNATURE----- --Q/AGl/UrDvkbRExF--