All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Andrew Jones <drjones@redhat.com>
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
Subject: Re: [kvm-unit-tests PATCH v5 15/18] powerpc/ppc64: add run script and unittests.cfg
Date: Fri, 19 Feb 2016 03:43:57 +0000	[thread overview]
Message-ID: <20160219034357.GV15224@voom.fritz.box> (raw)
In-Reply-To: <1455734459-31902-16-git-send-email-drjones@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 3886 bytes --]

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'
> 
> (We can now run simple unit tests, but they don't quit on their
>  own yet. Use ^C to quit them.)
> 
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Tested-by: Laurent Vivier <lvivier@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  powerpc/run           | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  powerpc/unittests.cfg | 30 +++++++++++++++++++++++++++++
>  2 files changed, 82 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..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" = "ppc64" ] && [ "$ARCH" = "ppc64" ]; then
> +		kvm_available=yes
> +	fi
> +fi
> +
> +if [ "$ACCEL" = "kvm" ] && [ "$kvm_available" != "yes" ]; then
> +	echo "skip $TESTNAME (kvm only)"
> +	exit 2
> +fi
> +
> +if [ -z "$ACCEL" ]; then
> +	if [ "$kvm_available" = "yes" ]; then
> +		ACCEL="kvm"
> +	else
> +		ACCEL="tcg"
> +	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
> +
> +M='-machine pseries'
> +M+=",accel=$ACCEL"
> +command="$qemu $M -bios powerpc/boot_rom.bin"
> +command+=" -display none -serial stdio -kernel"
> +echo $command "$@"
> +
> +$command "$@"
> +ret=$?
> +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 = <name>.flat		# Name of the flat file to be used.
> +# smp  = <num>			# 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 = -append <params...>	# Additional parameters used.
> +# arch = ppc64				# Select one if the test case is
> +#					# specific to only one.
> +# groups = <group_name1> <group_name2> ...	# Used to identify test cases
> +#						# with run_tests -g ...
> +# accel = kvm|tcg		# Optionally specify if test must run with
> +#				# kvm or tcg. If not specified, then kvm will
> +#				# be used when available.
> +# timeout = <duration>		# Optionally specify a timeout.
> +##############################################################################
> +
> +#
> +# Test that the configured number of processors (smp = <num>), and
> +# that the configured amount of memory (-m <MB>) 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

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: David Gibson <david@gibson.dropbear.id.au>
To: Andrew Jones <drjones@redhat.com>
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
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	[thread overview]
Message-ID: <20160219034357.GV15224@voom.fritz.box> (raw)
In-Reply-To: <1455734459-31902-16-git-send-email-drjones@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 3886 bytes --]

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'
> 
> (We can now run simple unit tests, but they don't quit on their
>  own yet. Use ^C to quit them.)
> 
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Tested-by: Laurent Vivier <lvivier@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  powerpc/run           | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  powerpc/unittests.cfg | 30 +++++++++++++++++++++++++++++
>  2 files changed, 82 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..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" = "ppc64" ] && [ "$ARCH" = "ppc64" ]; then
> +		kvm_available=yes
> +	fi
> +fi
> +
> +if [ "$ACCEL" = "kvm" ] && [ "$kvm_available" != "yes" ]; then
> +	echo "skip $TESTNAME (kvm only)"
> +	exit 2
> +fi
> +
> +if [ -z "$ACCEL" ]; then
> +	if [ "$kvm_available" = "yes" ]; then
> +		ACCEL="kvm"
> +	else
> +		ACCEL="tcg"
> +	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
> +
> +M='-machine pseries'
> +M+=",accel=$ACCEL"
> +command="$qemu $M -bios powerpc/boot_rom.bin"
> +command+=" -display none -serial stdio -kernel"
> +echo $command "$@"
> +
> +$command "$@"
> +ret=$?
> +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 = <name>.flat		# Name of the flat file to be used.
> +# smp  = <num>			# 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 = -append <params...>	# Additional parameters used.
> +# arch = ppc64				# Select one if the test case is
> +#					# specific to only one.
> +# groups = <group_name1> <group_name2> ...	# Used to identify test cases
> +#						# with run_tests -g ...
> +# accel = kvm|tcg		# Optionally specify if test must run with
> +#				# kvm or tcg. If not specified, then kvm will
> +#				# be used when available.
> +# timeout = <duration>		# Optionally specify a timeout.
> +##############################################################################
> +
> +#
> +# Test that the configured number of processors (smp = <num>), and
> +# that the configured amount of memory (-m <MB>) 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

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-02-19  3:43 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17 18:40 [kvm-unit-tests PATCH v5 00/18] ppc64: initial drop Andrew Jones
2016-02-17 18:40 ` Andrew Jones
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 01/18] arm/arm64: trivial: another assert fix Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 02/18] Makefile: cscope: also look in arch shared asm Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-18  2:36   ` David Gibson
2016-02-18  2:36     ` David Gibson
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 03/18] lib: asm-generic: add missing casts Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 04/18] devicetree: fix dt_get_memory_params Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 05/18] arm/arm64: setup improvements Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 06/18] lib: add vprintf Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-18  2:44   ` David Gibson
2016-02-18  2:44     ` David Gibson
2016-02-18  6:34   ` Thomas Huth
2016-02-18  6:34     ` Thomas Huth
2016-02-18 10:21     ` Andrew Jones
2016-02-18 10:21       ` Andrew Jones
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 07/18] lib: share arm-selftest utility functions Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 08/18] config: no need to mix arch makefiles Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 09/18] powerpc/ppc64: start skeleton framework Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-19  2:11   ` David Gibson
2016-02-19  2:11     ` David Gibson
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 10/18] powerpc/ppc64: ppc-ify makefiles and linker script Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 11/18] powerpc/ppc64: add a boot rom Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 12/18] powerpc/ppc64: add hcall support and putchar Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-19  3:10   ` David Gibson
2016-02-19  3:10     ` David Gibson
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 13/18] powerpc/ppc64: adapt arm's setup Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-19  3:40   ` David Gibson
2016-02-19  3:40     ` David Gibson
2016-02-19  7:49     ` Andrew Jones
2016-02-19  7:49       ` Andrew Jones
2016-02-22  1:00       ` David Gibson
2016-02-22  1:00         ` David Gibson
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 14/18] powerpc/ppc64: relocate linker VMAs Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 15/18] powerpc/ppc64: add run script and unittests.cfg Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-19  3:43   ` David Gibson [this message]
2016-02-19  3:43     ` David Gibson
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 16/18] mkstandalone: add support for powerpc Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-18 14:51   ` Radim Krčmář
2016-02-18 14:51     ` Radim Krčmář
2016-02-19  3:53   ` David Gibson
2016-02-19  3:53     ` David Gibson
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 17/18] powerpc/ppc64: add RTAS support Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-19  4:08   ` David Gibson
2016-02-19  4:08     ` David Gibson
2016-02-19  7:52     ` Andrew Jones
2016-02-19  7:52       ` Andrew Jones
2016-02-17 18:40 ` [kvm-unit-tests PATCH v5 18/18] powerpc/ppc64: make a fake debug-exit Andrew Jones
2016-02-17 18:40   ` Andrew Jones
2016-02-19  4:12   ` David Gibson
2016-02-19  4:12     ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160219034357.GV15224@voom.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=dgibson@redhat.com \
    --cc=drjones@redhat.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.