diff options
author | Laurent Vivier <lvivier@redhat.com> | 2016-10-17 12:30:24 +0200 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2016-10-28 09:36:58 +1100 |
commit | 30ca440eec9fe1d7eec5a48addac656438778278 (patch) | |
tree | 68e20f4d2ffa59169c9597ee0e1fac8b6d4a210e /tests/virtio-scsi-test.c | |
parent | a980f7f2c2f4d7e9a1eba4f804cd66dbd458b6d4 (diff) |
tests: enable virtio tests on SPAPR
but disable MSI-X tests on SPAPR as we can't check the result
(the memory region used on PC is not readable on SPAPR).
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tests/virtio-scsi-test.c')
-rw-r--r-- | tests/virtio-scsi-test.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c index 7d697abac0..60dc9abd60 100644 --- a/tests/virtio-scsi-test.c +++ b/tests/virtio-scsi-test.c @@ -12,6 +12,7 @@ #include "libqtest.h" #include "block/scsi.h" #include "libqos/libqos-pc.h" +#include "libqos/libqos-spapr.h" #include "libqos/virtio.h" #include "libqos/virtio-pci.h" #include "standard-headers/linux/virtio_ids.h" @@ -33,11 +34,20 @@ typedef struct { static QOSState *qvirtio_scsi_start(const char *extra_opts) { + const char *arch = qtest_get_arch(); const char *cmd = "-drive id=drv0,if=none,file=/dev/null,format=raw " "-device virtio-scsi-pci,id=vs0 " "-device scsi-hd,bus=vs0.0,drive=drv0 %s"; - return qtest_pc_boot(cmd, extra_opts ? : ""); + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { + return qtest_pc_boot(cmd, extra_opts ? : ""); + } + if (strcmp(arch, "ppc64") == 0) { + return qtest_spapr_boot(cmd, extra_opts ? : ""); + } + + g_printerr("virtio-scsi tests are only available on x86 or ppc64\n"); + exit(EXIT_FAILURE); } static void qvirtio_scsi_stop(QOSState *qs) |