On Mon, Dec 18, 2017 at 11:34:07AM +0100, Thomas Huth wrote: > 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 <da...@gibson.dropbear.id.au> > > --- > > 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.
Good idea, I've made that change. > Anyway, with or without that modification: > > Reviewed-by: Thomas Huth <th...@redhat.com> > -- 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
signature.asc
Description: PGP signature