qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCHv2 2/4] tests/pxe-test: Use table of testcases ra


From: Thomas Huth
Subject: Re: [Qemu-devel] [PATCHv2 2/4] tests/pxe-test: Use table of testcases rather than open-coding
Date: Mon, 18 Dec 2017 11:34:07 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

On 18.12.2017 11:04, David Gibson wrote:
> Currently pxe-tests open codes the list of tests for each architecture.
> This changes it to use tables of test parameters, somewhat similar to
> boot-serial-test.
> 
> This adds the machine type into the table as well, giving us the ability
> to perform tests on multiple machine types for architectures where there's
> more than one machine type that matters.
> 
> NOTE: This changes the names of the tests in the output, to include the
>       machine type and IPv4 vs. IPv6.  I'm not sure if this has the
>       potential to break existing tooling.
> 
> Signed-off-by: David Gibson <address@hidden>
> ---
>  tests/pxe-test.c | 87 
> ++++++++++++++++++++++++++++++++++++++++++--------------
>  1 file changed, 65 insertions(+), 22 deletions(-)
> 
> diff --git a/tests/pxe-test.c b/tests/pxe-test.c
> index eb70aa2bc6..8c310a8129 100644
> --- a/tests/pxe-test.c
> +++ b/tests/pxe-test.c
> @@ -22,14 +22,52 @@
>  
>  static char disk[] = "tests/pxe-test-disk-XXXXXX";
>  
> -static void test_pxe_one(const char *params, bool ipv6)
> +typedef struct testdef {
> +    const char *machine;    /* Machine type */
> +    const char *model;      /* NIC device model */
> +    const char *devopts;    /* Device options */
> +} testdef_t;
[...]
> +static testdef_t s390x_tests[] = {
> +    { "s390-ccw-virtio", "virtio-net-ccw", ",bootindex=1" },
> +    { NULL },
> +};
> +
> +static void test_pxe_one(const testdef_t *test, bool ipv6)
>  {
>      char *args;
>  
> -    args = g_strdup_printf("-machine accel=kvm:tcg -nodefaults -boot order=n 
> "
> -                           "-netdev user,id=" NETNAME ",tftp=./,bootfile=%s,"
> -                           "ipv4=%s,ipv6=%s %s", disk, ipv6 ? "off" : "on",
> -                           ipv6 ? "on" : "off", params);
> +    args = g_strdup_printf(
> +        "-machine %s,accel=kvm:tcg -nodefaults -boot order=n "
> +        "-netdev user,id=" NETNAME ",tftp=./,bootfile=%s,ipv4=%s,ipv6=%s "
> +        "-device %s%s,netdev=" NETNAME,
> +        test->machine, disk, ipv6 ? "off" : "on", ipv6 ? "on" : "off",
> +        test->model, test->devopts ? test->devopts : "");

Looking at this again, I think we could also simply always add the
"bootindex=1" to the args string - this should not hurt, rather might
help to boot faster, and then you could get rid of the"devopts" field in
the testdef_t struct.

Anyway, with or without that modification:

Reviewed-by: Thomas Huth <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]