qtest: Prepare virtio, other PCI tests
v3 cover qtest: Prepare virtio, other PCI tests
Hello Michael, Amit and Stefan,
This series starts preparing tests to cover optional PCI devices. They don't do any functional tests but assure that QOM/PCI/VMState refactorings don't break the basic usage of devices not covered by qom-test.
v3 covers all virtio devices plus pvpanic, nvme, i82801b11, spapr-pci-host-bridge.
* virtio-blk and nvme use /dev/null.
* virtio-9p uses a temporary directory.
I intend to pick those already posted plus the virtio-console tests into my pull.
Regards,
Andreas
v2 -> v3:
* Added virtio-scsi, virtio-9p, virtio-serial-bus, virtio-console tests
* Added pvpanic tests - required libqtest API changes
* Added nvme test - required nvme change
* Added i82801b11 test
* Rebased on 9p config changes
* Queued spapr-pci-host-bridge test (Alexey)
v1 -> v2:
* Reordered includes (stefanha)
* Used qtest_end() where applicable
* Added qtest for tpci200 and ipoctal232 (for my IndustryPack refactoring series)
* Added qtests for ne2000, virtio-net, virtio-blk, virtio-balloon, virtio-rng
Alexey Kardashevskiy (1):
tests: Add spapr-pci-host-bridge qtest
Andreas Färber (14):
tests: Clean up IndustryPack TCPI200 gcov paths
tests: Add virtio-blk qtest
tests: Add virtio-balloon qtest
tests: Add virtio-rng qtest
tests: Add virtio-scsi qtest
tests: Add virtio-9p qtest
tests: Add virtio-serial qtest
tests: Add virtio-console qtest
tests: Add pvpanic qtest
qtest: Factor out qtest_qmp_receive()
pvpanic-test: Assert pause event
nvme: Permit zero-length block devices
tests: Add nvme qtest
tests: Add i82801b11 qtest
hw/block/nvme.c | 4 ++-- tests/Makefile | 43 +++++++++++++++++++++++++++++++++++++++-- tests/i82801b11-test.c | 33 +++++++++++++++++++++++++++++++ tests/libqtest.c | 15 ++++++++++----- tests/libqtest.h | 18 +++++++++++++++++ tests/nvme-test.c | 34 ++++++++++++++++++++++++++++++++ tests/pvpanic-test.c | 47 +++++++++++++++++++++++++++++++++++++++++++++ tests/spapr-phb-test.c | 35 +++++++++++++++++++++++++++++++++ tests/virtio-9p-test.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ tests/virtio-balloon-test.c | 33 +++++++++++++++++++++++++++++++ tests/virtio-blk-test.c | 34 ++++++++++++++++++++++++++++++++ tests/virtio-console-test.c | 34 ++++++++++++++++++++++++++++++++ tests/virtio-rng-test.c | 33 +++++++++++++++++++++++++++++++ tests/virtio-scsi-test.c | 35 +++++++++++++++++++++++++++++++++ tests/virtio-serial-test.c | 33 +++++++++++++++++++++++++++++++ 15 files changed, 468 insertions(+), 9 deletions(-) create mode 100644 tests/i82801b11-test.c create mode 100644 tests/nvme-test.c create mode 100644 tests/pvpanic-test.c create mode 100644 tests/spapr-phb-test.c create mode 100644 tests/virtio-9p-test.c create mode 100644 tests/virtio-balloon-test.c create mode 100644 tests/virtio-blk-test.c create mode 100644 tests/virtio-console-test.c create mode 100644 tests/virtio-rng-test.c create mode 100644 tests/virtio-scsi-test.c create mode 100644 tests/virtio-serial-test.c
Signature · 1 line
1.8.4.5
PATCH v3 1/15 tests: Clean up IndustryPack TCPI200 gcov paths
--- tests/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/Makefile +2 -2
@@ -87,9 +87,9 @@ gcov-files-pci-y += hw/net/ne2000.c check-qtest-pci-y += $(check-qtest-virtio-y) gcov-files-pci-y += $(gcov-files-virtio-y) hw/virtio/virtio-pci.c check-qtest-pci-y += tests/tpci200-test$(EXESUF) -gcov-files-pci-y += hw/char/tpci200.c +gcov-files-pci-y += hw/ipack/tpci200.c check-qtest-pci-y += $(check-qtest-ipack-y) -gcov-files-pci-y += $(gcov-files-ipack-y) hw/ipack/tpci200.c +gcov-files-pci-y += $(gcov-files-ipack-y) check-qtest-i386-y = tests/endianness-test$(EXESUF) check-qtest-i386-y += tests/fdc-test$(EXESUF)
Signature · 1 line
1.8.4.5
PATCH v3 3/15 tests: Add virtio-balloon qtest
In reply to Andreas Färber--- tests/Makefile | 3 +++ tests/virtio-balloon-test.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/virtio-balloon-test.c
tests/Makefile +3 -0
@@ -72,6 +72,8 @@ gcov-files-ipack-y += hw/char/ipoctal232.c gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio.c check-qtest-virtio-y += tests/virtio-net-test$(EXESUF) gcov-files-virtio-y += i386-softmmu/hw/net/virtio-net.c +check-qtest-virtio-y += tests/virtio-balloon-test$(EXESUF) +gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio-balloon.c check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF) gcov-files-virtio-y += i386-softmmu/hw/block/virtio-blk.c
@@ -241,6 +243,7 @@ tests/pcnet-test$(EXESUF): tests/pcnet-test.o tests/eepro100-test$(EXESUF): tests/eepro100-test.o tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o tests/ne2000-test$(EXESUF): tests/ne2000-test.o +tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o tests/tpci200-test$(EXESUF): tests/tpci200-test.o
tests/virtio-balloon-test.c new file +33 -0
@@ -0,0 +1,33 @@ +/* +* QTest testcase for VirtIO Balloon +* +* Copyright (c) 2014 SUSE LINUX Products GmbH +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#include <glib.h> +#include <string.h> +#include "libqtest.h" +#include "qemu/osdep.h" + +/* Tests only initialization so far. TODO: Replace with functional tests */ +static void pci_nop (void ) +{ +} + +int main (int argc,char **argv) +{ +int ret; + +g_test_init (&argc, &argv,NULL ); +qtest_add_func ("/virtio/balloon/pci/nop" , pci_nop); + +qtest_start ("-device virtio-balloon-pci" ); + ret =g_test_run (); + +qtest_end (); + +return ret; +}
Signature · 1 line
1.8.4.5
PATCH v3 2/15 tests: Add virtio-blk qtest
In reply to Andreas Färber--- tests/Makefile | 3 +++ tests/virtio-blk-test.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 tests/virtio-blk-test.c
tests/Makefile +3 -0
@@ -72,6 +72,8 @@ gcov-files-ipack-y += hw/char/ipoctal232.c gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio.c check-qtest-virtio-y += tests/virtio-net-test$(EXESUF) gcov-files-virtio-y += i386-softmmu/hw/net/virtio-net.c +check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF) +gcov-files-virtio-y += i386-softmmu/hw/block/virtio-blk.c check-qtest-pci-y += tests/e1000-test$(EXESUF) gcov-files-pci-y += hw/net/e1000.c
@@ -239,6 +241,7 @@ tests/pcnet-test$(EXESUF): tests/pcnet-test.o tests/eepro100-test$(EXESUF): tests/eepro100-test.o tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o tests/ne2000-test$(EXESUF): tests/ne2000-test.o +tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
tests/virtio-blk-test.c new file +34 -0
@@ -0,0 +1,34 @@ +/* +* QTest testcase for VirtIO Block Device +* +* Copyright (c) 2014 SUSE LINUX Products GmbH +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#include <glib.h> +#include <string.h> +#include "libqtest.h" +#include "qemu/osdep.h" + +/* Tests only initialization so far. TODO: Replace with functional tests */ +static void pci_nop (void ) +{ +} + +int main (int argc,char **argv) +{ +int ret; + +g_test_init (&argc, &argv,NULL ); +qtest_add_func ("/virtio/blk/pci/nop" , pci_nop); + +qtest_start ("-drive id=drv0,if=none,file=/dev/null " +"-device virtio-blk-pci,drive=drv0" ); + ret =g_test_run (); + +qtest_end (); + +return ret; +}
Signature · 1 line
1.8.4.5
PATCH v3 4/15 tests: Add virtio-rng qtest
In reply to Andreas Färber--- tests/Makefile | 3 +++ tests/virtio-rng-test.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/virtio-rng-test.c
tests/Makefile +3 -0
@@ -76,6 +76,8 @@ check-qtest-virtio-y += tests/virtio-balloon-test$(EXESUF) gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio-balloon.c check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF) gcov-files-virtio-y += i386-softmmu/hw/block/virtio-blk.c +check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF) +gcov-files-virtio-y += hw/virtio/virtio-rng.c check-qtest-pci-y += tests/e1000-test$(EXESUF) gcov-files-pci-y += hw/net/e1000.c
@@ -246,6 +248,7 @@ tests/ne2000-test$(EXESUF): tests/ne2000-test.o tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o +tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o tests/qom-test$(EXESUF): tests/qom-test.o
tests/virtio-rng-test.c new file +33 -0
@@ -0,0 +1,33 @@ +/* +* QTest testcase for VirtIO RNG +* +* Copyright (c) 2014 SUSE LINUX Products GmbH +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#include <glib.h> +#include <string.h> +#include "libqtest.h" +#include "qemu/osdep.h" + +/* Tests only initialization so far. TODO: Replace with functional tests */ +static void pci_nop (void ) +{ +} + +int main (int argc,char **argv) +{ +int ret; + +g_test_init (&argc, &argv,NULL ); +qtest_add_func ("/virtio/rng/pci/nop" , pci_nop); + +qtest_start ("-device virtio-rng-pci" ); + ret =g_test_run (); + +qtest_end (); + +return ret; +}
Signature · 1 line
1.8.4.5
PATCH v3 5/15 tests: Add virtio-scsi qtest
In reply to Andreas Färber--- tests/Makefile | 3 +++ tests/virtio-scsi-test.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 tests/virtio-scsi-test.c
tests/Makefile +3 -0
@@ -78,6 +78,8 @@ check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF) gcov-files-virtio-y += i386-softmmu/hw/block/virtio-blk.c check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF) gcov-files-virtio-y += hw/virtio/virtio-rng.c +check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF) +gcov-files-virtio-y += i386-softmmu/hw/scsi/virtio-scsi.c check-qtest-pci-y += tests/e1000-test$(EXESUF) gcov-files-pci-y += hw/net/e1000.c
@@ -249,6 +251,7 @@ tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o +tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o tests/qom-test$(EXESUF): tests/qom-test.o
tests/virtio-scsi-test.c new file +35 -0
@@ -0,0 +1,35 @@ +/* +* QTest testcase for VirtIO SCSI +* +* Copyright (c) 2014 SUSE LINUX Products GmbH +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#include <glib.h> +#include <string.h> +#include "libqtest.h" +#include "qemu/osdep.h" + +/* Tests only initialization so far. TODO: Replace with functional tests */ +static void pci_nop (void ) +{ +} + +int main (int argc,char **argv) +{ +int ret; + +g_test_init (&argc, &argv,NULL ); +qtest_add_func ("/virtio/scsi/pci/nop" , pci_nop); + +qtest_start ("-drive id=drv0,if=none,file=/dev/null " +"-device virtio-scsi-pci,id=vscsi0 " +"-device scsi-hd,bus=vscsi0.0,drive=drv0" ); + ret =g_test_run (); + +qtest_end (); + +return ret; +}
Signature · 1 line
1.8.4.5
PATCH v3 6/15 tests: Add virtio-9p qtest
In reply to Andreas FärberMake it conditional to 9p availability.
Create a temporary directory to share.
--- tests/Makefile | 6 ++++++ tests/virtio-9p-test.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 tests/virtio-9p-test.c
tests/Makefile +6 -0
@@ -80,6 +80,11 @@ check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF) gcov-files-virtio-y += hw/virtio/virtio-rng.c check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF) gcov-files-virtio-y += i386-softmmu/hw/scsi/virtio-scsi.c +ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy) +check-qtest-virtio-y += tests/virtio-9p-test$(EXESUF) +gcov-files-virtio-y += hw/9pfs/virtio-9p.c +gcov-files-virtio-y += i386-softmmu/hw/9pfs/virtio-9p-device.c +endif check-qtest-pci-y += tests/e1000-test$(EXESUF) gcov-files-pci-y += hw/net/e1000.c
@@ -252,6 +257,7 @@ tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o +tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o tests/qom-test$(EXESUF): tests/qom-test.o
tests/virtio-9p-test.c new file +46 -0
46 lines not on this page · raw message
Signature · 1 line
1.8.4.5
PATCH v3 8/15 tests: Add virtio-console qtest
In reply to Andreas Färber--- tests/Makefile | 6 ++++++ tests/virtio-console-test.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 tests/virtio-console-test.c
tests/Makefile +6 -0
@@ -69,6 +69,9 @@ gcov-files-ipack-y += hw/ipack/ipack.c check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF) gcov-files-ipack-y += hw/char/ipoctal232.c +check-qtest-virtioserial-y += tests/virtio-console-test$(EXESUF) +gcov-files-virtioserial-y += hw/char/virtio-console.c + gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio.c check-qtest-virtio-y += tests/virtio-net-test$(EXESUF) gcov-files-virtio-y += i386-softmmu/hw/net/virtio-net.c
@@ -87,6 +90,8 @@ gcov-files-virtio-y += i386-softmmu/hw/9pfs/virtio-9p-device.c endif check-qtest-virtio-y += tests/virtio-serial-test$(EXESUF) gcov-files-virtio-y += i386-softmmu/hw/char/virtio-serial-bus.c +check-qtest-virtio-y += $(check-qtest-virtioserial-y) +gcov-files-virtio-y += $(gcov-files-virtioserial-y) check-qtest-pci-y += tests/e1000-test$(EXESUF) gcov-files-pci-y += hw/net/e1000.c
@@ -261,6 +266,7 @@ tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o tests/virtio-serial-test$(EXESUF): tests/virtio-serial-test.o +tests/virtio-console-test$(EXESUF): tests/virtio-console-test.o tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o tests/qom-test$(EXESUF): tests/qom-test.o
tests/virtio-console-test.c new file +34 -0
@@ -0,0 +1,34 @@ +/* +* QTest testcase for VirtIO Console +* +* Copyright (c) 2014 SUSE LINUX Products GmbH +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#include <glib.h> +#include <string.h> +#include "libqtest.h" +#include "qemu/osdep.h" + +/* Tests only initialization so far. TODO: Replace with functional tests */ +static void pci_nop (void ) +{ +} + +int main (int argc,char **argv) +{ +int ret; + +g_test_init (&argc, &argv,NULL ); +qtest_add_func ("/virtio/console/pci/nop" , pci_nop); + +qtest_start ("-device virtio-serial-pci,id=vser0 " +"-device virtconsole,bus=vser0.0" ); + ret =g_test_run (); + +qtest_end (); + +return ret; +}
Signature · 1 line
1.8.4.5
PATCH v3 10/15 qtest: Factor out qtest_qmp_receive()
In reply to Andreas Färber--- tests/libqtest.c | 15 ++++++++++----- tests/libqtest.h | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-)
tests/libqtest.c +10 -5
@@ -309,14 +309,10 @@ static void qmp_response(JSONMessageParser *parser, QList *tokens) qmp->response = (QDict *)obj; } -QDict *qtest_qmpv (QTestState *s,const char *fmt,va_list ap) +QDict *qtest_qmp_receive (QTestState *s) {QMPResponseParser qmp; -/* Send QMP request */ -socket_sendf (s->qmp_fd, fmt, ap); - -/* Receive reply */ qmp.response =NULL ;json_message_parser_init (&qmp.parser, qmp_response);while (!qmp.response) {
@@ -340,6 +336,15 @@ QDict *qtest_qmpv(QTestState *s, const char *fmt, va_list ap)return qmp.response; } +QDict *qtest_qmpv (QTestState *s,const char *fmt,va_list ap) +{ +/* Send QMP request */ +socket_sendf (s->qmp_fd, fmt, ap); + +/* Receive reply */ +return qtest_qmp_receive (s); +} +QDict *qtest_qmp (QTestState *s,const char *fmt, ...) {va_list ap;
tests/libqtest.h +18 -0
@@ -83,6 +83,14 @@ void qtest_qmpv_discard_response(QTestState *s, const char *fmt, va_list ap);QDict *qtest_qmpv (QTestState *s,const char *fmt,va_list ap);/** +* qtest_receive: +* @s: #QTestState instance to operate on. +* +* Reads a QMP message from QEMU and returns the response. +*/ +QDict *qtest_qmp_receive (QTestState *s); + +/** * qtest_get_irq: * @s: #QTestState instance to operate on. * @num: Interrupt to observe.
@@ -383,6 +391,16 @@ static inline void qmp_discard_response(const char *fmt, ...) }/** +* qmp_receive: +* +* Reads a QMP message from QEMU and returns the response. +*/ +static inline QDict *qmp_receive (void ) +{ +return qtest_qmp_receive (global_qtest); +} + +/** * get_irq: * @num: Interrupt to observe. *
Signature · 1 line
1.8.4.5
PATCH v3 11/15 pvpanic-test: Assert pause event
In reply to Andreas Färber--- tests/pvpanic-test.c | 9 +++++++++ 1 file changed, 9 insertions(+)
tests/pvpanic-test.c +9 -0
@@ -15,11 +15,20 @@static void test_panic (void ) {uint8_t val; +QDict *response, *data; val =inb (0x505 ); g_assert_cmpuint(val, ==, 1);outb (0x505 ,0x1 ); + + response =qmp_receive (); +g_assert (qdict_haskey (response,"event" )); + g_assert_cmpstr(qdict_get_str(response, "event"), ==, "GUEST_PANICKED"); +g_assert (qdict_haskey (response,"data" )); + data =qdict_get_qdict (response,"data" ); +g_assert (qdict_haskey (data,"action" )); + g_assert_cmpstr(qdict_get_str(data, "action"), ==, "pause"); }int main (int argc,char **argv)
Signature · 1 line
1.8.4.5
PATCH v3 7/15 tests: Add virtio-serial qtest
In reply to Andreas Färber--- tests/Makefile | 3 +++ tests/virtio-serial-test.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/virtio-serial-test.c
tests/Makefile +3 -0
@@ -85,6 +85,8 @@ check-qtest-virtio-y += tests/virtio-9p-test$(EXESUF) gcov-files-virtio-y += hw/9pfs/virtio-9p.c gcov-files-virtio-y += i386-softmmu/hw/9pfs/virtio-9p-device.c endif +check-qtest-virtio-y += tests/virtio-serial-test$(EXESUF) +gcov-files-virtio-y += i386-softmmu/hw/char/virtio-serial-bus.c check-qtest-pci-y += tests/e1000-test$(EXESUF) gcov-files-pci-y += hw/net/e1000.c
@@ -258,6 +260,7 @@ tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o +tests/virtio-serial-test$(EXESUF): tests/virtio-serial-test.o tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o tests/qom-test$(EXESUF): tests/qom-test.o
tests/virtio-serial-test.c new file +33 -0
@@ -0,0 +1,33 @@ +/* +* QTest testcase for VirtIO Serial +* +* Copyright (c) 2014 SUSE LINUX Products GmbH +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#include <glib.h> +#include <string.h> +#include "libqtest.h" +#include "qemu/osdep.h" + +/* Tests only initialization so far. TODO: Replace with functional tests */ +static void pci_nop (void ) +{ +} + +int main (int argc,char **argv) +{ +int ret; + +g_test_init (&argc, &argv,NULL ); +qtest_add_func ("/virtio/serial/pci/nop" , pci_nop); + +qtest_start ("-device virtio-serial-pci" ); + ret =g_test_run (); + +qtest_end (); + +return ret; +}
Signature · 1 line
1.8.4.5
PATCH v3 12/15 nvme: Permit zero-length block devices
In reply to Andreas FärberIt may not be sensible for normal use cases, but it allows to use /dev/null in QTest.
--- hw/block/nvme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/block/nvme.c +2 -2
@@ -752,8 +752,8 @@ static int nvme_init(PCIDevice *pci_dev)return -1 ; } - bs_size =bdrv_getlength (n->conf.bs); -if (bs_size <=0 ) { + bs_size =bdrv_getlength (n->conf.bs); +if (bs_size <0 ) {return -1 ; }
Signature · 1 line
1.8.4.5
PATCH v3 15/15 tests: Add spapr-pci-host-bridge qtest
In reply to Andreas FärberFrom: Alexey Kardashevskiy <[email protected]>
This adds a test whether sPAPR PHB can be added via the command line.
--- tests/Makefile | 3 +++ tests/spapr-phb-test.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 tests/spapr-phb-test.c
tests/Makefile +3 -0
@@ -155,6 +155,8 @@ check-qtest-arm-y = tests/tmp105-test$(EXESUF) gcov-files-arm-y += hw/misc/tmp105.c check-qtest-ppc-y += tests/boot-order-test$(EXESUF) check-qtest-ppc64-y += tests/boot-order-test$(EXESUF) +check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF) +gcov-files-ppc64-y += ppc64-softmmu/hw/ppc/spapr_pci.c check-qtest-microblazeel-y = $(check-qtest-microblaze-y) check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
@@ -251,6 +253,7 @@ libqos-omap-obj-y = $(libqos-obj-y) tests/libqos/i2c-omap.o tests/rtc-test$(EXESUF): tests/rtc-test.o tests/m48t59-test$(EXESUF): tests/m48t59-test.o tests/endianness-test$(EXESUF): tests/endianness-test.o +tests/spapr-phb-test$(EXESUF): tests/spapr-phb-test.o $(libqos-obj-y) tests/fdc-test$(EXESUF): tests/fdc-test.o tests/ide-test$(EXESUF): tests/ide-test.o $(libqos-pc-obj-y) tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o
tests/spapr-phb-test.c new file +35 -0
@@ -0,0 +1,35 @@ +/* +* QTest testcase for SPAPR PHB +* +* Authors: +* Alexey Kardashevskiy <[email protected]> +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ +#include <glib.h> + +#include "libqtest.h" + +#define TYPE_SPAPR_PCI_HOST_BRIDGE "spapr-pci-host-bridge" + +/* Tests only initialization so far. TODO: Replace with functional tests */ +static void test_phb_device (void ) +{ +} + +int main (int argc,char **argv) +{ +int ret; + +g_test_init (&argc, &argv,NULL ); +qtest_add_func ("/spapr-phb/device" , test_phb_device); + +qtest_start ("-device " TYPE_SPAPR_PCI_HOST_BRIDGE ",index=100" ); + + ret =g_test_run (); + +qtest_end (); + +return ret; +}
Signature · 1 line
1.8.4.5
PATCH v3 13/15 tests: Add nvme qtest
In reply to Andreas Färber--- tests/Makefile | 3 +++ tests/nvme-test.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 tests/nvme-test.c
tests/Makefile +3 -0
@@ -104,6 +104,8 @@ check-qtest-pci-y += tests/eepro100-test$(EXESUF) gcov-files-pci-y += hw/net/eepro100.c check-qtest-pci-y += tests/ne2000-test$(EXESUF) gcov-files-pci-y += hw/net/ne2000.c +check-qtest-pci-y += tests/nvme-test$(EXESUF) +gcov-files-pci-y += hw/block/nvme.c check-qtest-pci-y += $(check-qtest-virtio-y) gcov-files-pci-y += $(gcov-files-virtio-y) hw/virtio/virtio-pci.c check-qtest-pci-y += tests/tpci200-test$(EXESUF)
@@ -275,6 +277,7 @@ tests/qom-test$(EXESUF): tests/qom-test.o tests/blockdev-test$(EXESUF): tests/blockdev-test.o $(libqos-pc-obj-y) tests/qdev-monitor-test$(EXESUF): tests/qdev-monitor-test.o $(libqos-pc-obj-y) tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o +tests/nvme-test$(EXESUF): tests/nvme-test.o tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o # QTest rules
tests/nvme-test.c new file +34 -0
@@ -0,0 +1,34 @@ +/* +* QTest testcase for NVMe +* +* Copyright (c) 2014 SUSE LINUX Products GmbH +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#include <glib.h> +#include <string.h> +#include "libqtest.h" +#include "qemu/osdep.h" + +/* Tests only initialization so far. TODO: Replace with functional tests */ +static void nop (void ) +{ +} + +int main (int argc,char **argv) +{ +int ret; + +g_test_init (&argc, &argv,NULL ); +qtest_add_func ("/nvme/nop" , nop); + +qtest_start ("-drive id=drv0,if=none,file=/dev/null " +"-device nvme,drive=drv0,serial=foo" ); + ret =g_test_run (); + +qtest_end (); + +return ret; +}
Signature · 1 line
1.8.4.5
PATCH v3 9/15 tests: Add pvpanic qtest
In reply to Andreas Färber--- tests/Makefile | 3 +++ tests/pvpanic-test.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 tests/pvpanic-test.c
tests/Makefile +3 -0
@@ -130,6 +130,8 @@ check-qtest-i386-y += tests/vmxnet3-test$(EXESUF) gcov-files-i386-y += hw/net/vmxnet3.c gcov-files-i386-y += hw/net/vmxnet_rx_pkt.c gcov-files-i386-y += hw/net/vmxnet_tx_pkt.c +check-qtest-i386-y += tests/pvpanic-test$(EXESUF) +gcov-files-i386-y += i386-softmmu/hw/misc/pvpanic.c check-qtest-x86_64-y = $(check-qtest-i386-y) gcov-files-i386-y += i386-softmmu/hw/timer/mc146818rtc.c gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y))
@@ -272,6 +274,7 @@ tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o tests/qom-test$(EXESUF): tests/qom-test.o tests/blockdev-test$(EXESUF): tests/blockdev-test.o $(libqos-pc-obj-y) tests/qdev-monitor-test$(EXESUF): tests/qdev-monitor-test.o $(libqos-pc-obj-y) +tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o # QTest rules
tests/pvpanic-test.c new file +38 -0
@@ -0,0 +1,38 @@ +/* +* QTest testcase for PV Panic +* +* Copyright (c) 2014 SUSE LINUX Products GmbH +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#include <glib.h> +#include <string.h> +#include "libqtest.h" +#include "qemu/osdep.h" + +static void test_panic (void ) +{ +uint8_t val; + + val =inb (0x505 ); + g_assert_cmpuint(val, ==, 1); + +outb (0x505 ,0x1 ); +} + +int main (int argc,char **argv) +{ +int ret; + +g_test_init (&argc, &argv,NULL ); +qtest_add_func ("/pvpanic/panic" , test_panic); + +qtest_start ("-device pvpanic" ); + ret =g_test_run (); + +qtest_end (); + +return ret; +}
Signature · 1 line
1.8.4.5
PATCH v3 14/15 tests: Add i82801b11 qtest
In reply to Andreas Färber--- tests/Makefile | 3 +++ tests/i82801b11-test.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/i82801b11-test.c
tests/Makefile +3 -0
@@ -134,6 +134,8 @@ gcov-files-i386-y += hw/net/vmxnet_rx_pkt.c gcov-files-i386-y += hw/net/vmxnet_tx_pkt.c check-qtest-i386-y += tests/pvpanic-test$(EXESUF) gcov-files-i386-y += i386-softmmu/hw/misc/pvpanic.c +check-qtest-i386-y += tests/i82801b11-test$(EXESUF) +gcov-files-i386-y += hw/pci-bridge/i802801b11.c check-qtest-x86_64-y = $(check-qtest-i386-y) gcov-files-i386-y += i386-softmmu/hw/timer/mc146818rtc.c gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y))
@@ -278,6 +280,7 @@ tests/blockdev-test$(EXESUF): tests/blockdev-test.o $(libqos-pc-obj-y) tests/qdev-monitor-test$(EXESUF): tests/qdev-monitor-test.o $(libqos-pc-obj-y) tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o tests/nvme-test$(EXESUF): tests/nvme-test.o +tests/i82801b11-test$(EXESUF): tests/i82801b11-test.o tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o # QTest rules
tests/i82801b11-test.c new file +33 -0
@@ -0,0 +1,33 @@ +/* +* QTest testcase for i82801b11 +* +* Copyright (c) 2014 SUSE LINUX Products GmbH +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#include <glib.h> +#include <string.h> +#include "libqtest.h" +#include "qemu/osdep.h" + +/* Tests only initialization so far. TODO: Replace with functional tests */ +static void nop (void ) +{ +} + +int main (int argc,char **argv) +{ +int ret; + +g_test_init (&argc, &argv,NULL ); +qtest_add_func ("/i82801b11/nop" , nop); + +qtest_start ("-machine q35 -device i82801b11-bridge,bus=pcie.0,addr=1e.0" ); + ret =g_test_run (); + +qtest_end (); + +return ret; +}
Signature · 1 line
1.8.4.5
Re: [Qemu-devel] [PATCH qom-next v3 05/15] tests: Add virtio-scsi qtest
In reply to Andreas FärberIl 12/03/2014 19:28, Andreas Färber ha scritto:
Quoted 61 lines
Cc Paolo Bonzini <[email protected]>Signed-off-by Andreas Färber <[email protected]>--- tests/Makefile | 3 +++ tests/virtio-scsi-test.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 tests/virtio-scsi-test.ctests/Makefile +3
-0@@ -78,6 +78,8 @@ check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF) gcov-files-virtio-y += i386-softmmu/hw/block/virtio-blk.c check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF) gcov-files-virtio-y += hw/virtio/virtio-rng.c +check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF) +gcov-files-virtio-y += i386-softmmu/hw/scsi/virtio-scsi.c check-qtest-pci-y += tests/e1000-test$(EXESUF) gcov-files-pci-y += hw/net/e1000.c@@ -249,6 +251,7 @@ tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o +tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o tests/qom-test$(EXESUF): tests/qom-test.otests/virtio-scsi-test.c new file +25
-0@@ -0,0 +1,35 @@ +/* +* QTest testcase for VirtIO SCSI +* +* Copyright (c) 2014 SUSE LINUX Products GmbH +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#include <glib.h> +#include <string.h> +#include "libqtest.h" +#include "qemu/osdep.h" + +/* Tests only initialization so far. TODO: Replace with functional tests */ +static void pci_nop (void ) +{ +} + +int main (int argc,char **argv) +{ +int ret; + +g_test_init (&argc, &argv,NULL ); +qtest_add_func ("/virtio/scsi/pci/nop" , pci_nop);
tests/virtio-scsi-test.c line 35
Quoted 10 lines
tests/virtio-scsi-test.c new file +10
-0+ +qtest_start ("-drive id=drv0,if=none,file=/dev/null " +"-device virtio-scsi-pci,id=vscsi0 " +"-device scsi-hd,bus=vscsi0.0,drive=drv0" ); + ret =g_test_run (); + +qtest_end (); + +return ret; +}
ACK
If we get a summer of code student, we could aim at making these tests work on all PCI platforms.
Paolo
Keith Busch
AppliedRe: [Qemu-devel] [PATCH qom-next v3 12/15] nvme: Permit zero-length block devices
In reply to Andreas FärberQuoted 2 lines · Andreas Färber
It may not be sensible for normal use cases, but it allows to use
/dev/nullin QTest.
Thanks! Sounds useful despite not being usable as storage. :)
I applied to my nvme tree here:
http://git.infradead.org/users/kbusch/qemu-nvme.git
It's quite a bit ahead of the upstream on 'nvme features'. I often hear from people in various orgs using this, so might be time I roll it into a pull request.
Quoted 24 lines
Signed-off-by Andreas Färber <[email protected]>---
hw/block/nvme.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)hw/block/nvme.c +2
-2@@ -752,8 +752,8 @@ static int nvme_init(PCIDevice *pci_dev)return -1 ; } - bs_size =bdrv_getlength (n->conf.bs); -if (bs_size <=0 ) { + bs_size =bdrv_getlength (n->conf.bs); +if (bs_size <0 ) {return -1 ; }Signature · 1 line
1.8.4.5
Re: [Qemu-devel] [PATCH qom-next v3 12/15] nvme: Permit zero-length block devices
Am 12.03.2014 20:13, schrieb Keith Busch:
Quoted 5 lines · Andreas Färber
Quoted 2 lines
It may not be sensible for normal use cases, but it allows to use
/dev/nullin QTest.Thanks! Sounds useful despite not being usable as storage. :)
Thanks for the quick review!
Quoted 7 lines
I applied to my nvme tree here:
http://git.infradead.org/users/kbusch/qemu-nvme.git
It's quite a bit ahead of the upstream on 'nvme features'. I often hear from people in various orgs using this, so might be time I roll it into a pull request.
Tonight is Hard Freeze for 2.0. If you could also review the matching test case http://patchwork.ozlabs.org/patch/329627/ I would put both in my pull. I guess you'll need to submit your queue for review first? Hard to see in a non-rebased tree.
Thanks,
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Re: [Qemu-devel] [PATCH qom-next v3 12/15] nvme: Permit zero-length block devices
Quoted 3 lines · Andreas Färber
Tonight is Hard Freeze for 2.0. If you could also review the matching test case http://patchwork.ozlabs.org/patch/329627/ I would put both in my pull.
Looks great! I'd apply the new test case, but it won't without the previous "pvpanic-test" patch in your series.
Quoted 2 lines
I guess you'll need to submit your queue for review first? Hard to see in a non-rebased tree.
For sure. I pushed a new rebased branch to my repo so it could be more easily observed. My first commit below really ought to have been split into a dozen or so individuals, so my own fault if it fails review for that or any other reason. I have no concerns about waiting for the next window if I need to split it up better and fix anything.
A pull request at this point would look like this:
The following changes since commit 750036a848ea913ba6343718ffa70da98f7eef6b:
Merge remote-tracking branch 'remotes/afaerber/tags/prep-for-upstream' into staging (2014-03-12 17:53:37 +0000)
are available in the git repository at:
git://git.infradead.org/users/kbusch/qemu-nvme.git v2.0-updates
for you to fetch changes up to 9323763f1b9db24c575a5f8afc13e460a63cac22:
nvme: Permit zero-length block devices (2014-03-12 13:17:58 -0600)
----------------------------------------------------------------
Andreas Färber (1):
nvme: Permit zero-length block devices
Keith Busch (4):
NVMe: Implement remainder from spec
NVMe: Clear allocated bitmap after format
NVMe: Use aio flush
NVMe: completion queue coalescing
default-configs/pci.mak | 1 + hw/block/nvme.c | 1640 +++++++++++++++++++++++++++++++++++++++++++---- hw/block/nvme.h | 114 ++++ 3 files changed, 1621 insertions(+), 134 deletions(-)
Re: [Qemu-devel] [PATCH qom-next v3 06/15] tests: Add virtio-9p qtest
In reply to Andreas FärberAm 12.03.2014 19:28, schrieb Andreas Färber:
Quoted 9 lines
Make it conditional to 9p availability.
Create a temporary directory to share.Signed-off-by Andreas Färber <[email protected]>--- tests/Makefile | 6 ++++++ tests/virtio-9p-test.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 tests/virtio-9p-test.c
Ping! Any objections to applying this first conditional test case? This would complete the virtio tests, I believe.
Thanks,
Andreas
Quoted 78 lines
tests/Makefile +6
-0@@ -80,6 +80,11 @@ check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF) gcov-files-virtio-y += hw/virtio/virtio-rng.c check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF) gcov-files-virtio-y += i386-softmmu/hw/scsi/virtio-scsi.c +ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy) +check-qtest-virtio-y += tests/virtio-9p-test$(EXESUF) +gcov-files-virtio-y += hw/9pfs/virtio-9p.c +gcov-files-virtio-y += i386-softmmu/hw/9pfs/virtio-9p-device.c +endif check-qtest-pci-y += tests/e1000-test$(EXESUF) gcov-files-pci-y += hw/net/e1000.c@@ -252,6 +257,7 @@ tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o +tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o tests/qom-test$(EXESUF): tests/qom-test.otests/virtio-9p-test.c new file +46
-0@@ -0,0 +1,46 @@ +/* +* QTest testcase for VirtIO 9P +* +* Copyright (c) 2014 SUSE LINUX Products GmbH +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#include <stdlib.h> +#include <string.h> +#include <glib.h> +#include "libqtest.h" +#include "qemu-common.h" +#include "qemu/osdep.h" + +/* Tests only initialization so far. TODO: Replace with functional tests */ +static void pci_nop (void ) +{ +} + +static char test_share[] ="/tmp/qtest.XXXXXX" ; + +int main (int argc,char **argv) +{ +char *args; +int ret; + +g_test_init (&argc, &argv,NULL ); +qtest_add_func ("/virtio/9p/pci/nop" , pci_nop); + +g_assert (mkdtemp (test_share)); + + args =g_strdup_printf ("-fsdev local,id=fsdev0,security_model=none,path=%s " +"-device virtio-9p-pci,fsdev=fsdev0,mount_tag=qtest" , + test_share); +qtest_start (args); +g_free (args); + + ret =g_test_run (); + +qtest_end (); +rmdir (test_share); + +return ret; +}
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Re: [Qemu-devel] [PATCH qom-next v3 12/15] nvme: Permit zero-length block devices
In reply to Keith BuschHi Keith,
Am 12.03.2014 21:13, schrieb Keith Busch:
Quoted 7 lines · Andreas Färber
Quoted 3 lines
Tonight is Hard Freeze for 2.0. If you could also review the matching test case http://patchwork.ozlabs.org/patch/329627/ I would put both in my pull.
Looks great! I'd apply the new test case, but it won't without the previous "pvpanic-test" patch in your series.
I had held off putting them in my pull for -rc0, but not seeing patches/pull from your side I am queuing them now for -rc1. Can I formalize your review as an Acked-by of both, if not turn your Signed-off-by into a Reviewed-by for this patch here?
Thanks,
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Re: [Qemu-devel] [PATCH qom-next v3 13/15] tests: Add nvme qtest
In reply to Andreas FärberAm 12.03.2014 19:28, schrieb Andreas Färber:
Quoted 6 lines
Signed-off-by Andreas Färber <[email protected]>--- tests/Makefile | 3 +++ tests/nvme-test.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 tests/nvme-test.c
Squashing MAINTAINERS update:
MAINTAINERS +1 -0
@@ -648,6 +648,7 @@ nvme M: Keith Busch <[email protected]> S: Supported F: hw/block/nvme* +F: tests/nvme-test.c Xilinx EDK M: Peter Crosthwaite <[email protected]>
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Re: [Qemu-devel] [PATCH qom-next v3 06/15] tests: Add virtio-9p qtest
In reply to Andreas FärberIl 27/03/2014 17:01, Andreas Färber ha scritto:
Quoted 87 lines
Am 12.03.2014 19:28, schrieb Andreas Färber:
Quoted 9 lines
Make it conditional to 9p availability.
Create a temporary directory to share.Signed-off-by Andreas Färber <[email protected]>--- tests/Makefile | 6 ++++++ tests/virtio-9p-test.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 tests/virtio-9p-test.cPing! Any objections to applying this first conditional test case? This would complete the virtio tests, I believe.
Thanks,
AndreasQuoted 70 lines
tests/Makefile +6
-0@@ -80,6 +80,11 @@ check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF) gcov-files-virtio-y += hw/virtio/virtio-rng.c check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF) gcov-files-virtio-y += i386-softmmu/hw/scsi/virtio-scsi.c +ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy) +check-qtest-virtio-y += tests/virtio-9p-test$(EXESUF) +gcov-files-virtio-y += hw/9pfs/virtio-9p.c +gcov-files-virtio-y += i386-softmmu/hw/9pfs/virtio-9p-device.c +endif check-qtest-pci-y += tests/e1000-test$(EXESUF) gcov-files-pci-y += hw/net/e1000.c@@ -252,6 +257,7 @@ tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o +tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o tests/qom-test$(EXESUF): tests/qom-test.otests/virtio-9p-test.c new file +39
-0@@ -0,0 +1,46 @@ +/* +* QTest testcase for VirtIO 9P +* +* Copyright (c) 2014 SUSE LINUX Products GmbH +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#include <stdlib.h> +#include <string.h> +#include <glib.h> +#include "libqtest.h" +#include "qemu-common.h" +#include "qemu/osdep.h" + +/* Tests only initialization so far. TODO: Replace with functional tests */ +static void pci_nop (void ) +{ +} + +static char test_share[] ="/tmp/qtest.XXXXXX" ; + +int main (int argc,char **argv) +{ +char *args; +int ret; + +g_test_init (&argc, &argv,NULL ); +qtest_add_func ("/virtio/9p/pci/nop" , pci_nop); + +g_assert (mkdtemp (test_share)); + + args =g_strdup_printf ("-fsdev local,id=fsdev0,security_model=none,path=%s " +"-device virtio-9p-pci,fsdev=fsdev0,mount_tag=qtest" , + test_share); +qtest_start (args); +g_free (args); +
Quoted 10 lines
tests/virtio-9p-test.c line 46
Quoted 8 lines
tests/virtio-9p-test.c new file +7
-0+ ret =g_test_run (); + +qtest_end (); +rmdir (test_share); + +return ret; +}
Fine by me.
Paolo
Re: [Qemu-devel] [PATCH qom-next v3 14/15] tests: Add i82801b11 qtest
In reply to Andreas FärberAm 12.03.2014 19:28, schrieb Andreas Färber:
Quoted 12 lines
Signed-off-by Andreas Färber <[email protected]>--- tests/Makefile | 3 +++ tests/i82801b11-test.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/i82801b11-test.ctests/Makefile +0
-0
tests/Makefile gcov-files-i386-y += hw/net/vmxnet_rx_pkt.c · line 138
Quoted 5 lines
tests/Makefile +2
-0@@ -134,6 +134,8 @@ gcov-files-i386-y += hw/net/vmxnet_rx_pkt.c gcov-files-i386-y += hw/net/vmxnet_tx_pkt.c check-qtest-i386-y += tests/pvpanic-test$(EXESUF) gcov-files-i386-y += i386-softmmu/hw/misc/pvpanic.c +check-qtest-i386-y += tests/i82801b11-test$(EXESUF) +gcov-files-i386-y += hw/pci-bridge/i802801b11.c
Typo fixed: i82801b11.c
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Keith Busch
Acked-byRe: [Qemu-devel] [PATCH qom-next v3 12/15] nvme: Permit zero-length block devices
In reply to Andreas FärberQuoted 6 lines · Andreas Färber
Am 12.03.2014 21:13, schrieb Keith Busch:
Quoted 5 lines · Andreas Färber
Quoted 3 lines
Tonight is Hard Freeze for 2.0. If you could also review the matching test case http://patchwork.ozlabs.org/patch/329627/ I would put both in my pull.
Quoted 7 lines
Quoted 2 lines
Looks great! I'd apply the new test case, but it won't without the previous "pvpanic-test" patch in your series.
I had held off putting them in my pull for -rc0, but not seeing patches/pull from your side I am queuing them now for -rc1. Can I formalize your review as an Acked-by of both, if not turn your Signed-off-by into a Reviewed-by for this patch here?
Sounds good to me.