On Wed, Aug 31, 2022 at 13:40:59 -0500, Jonathon Jongsma wrote:
We were testing the arguments that were being passed to qemu when a
disk
was being served by nbdkit, but the arguments used to start nbdkit
itself were not testable. This adds a test to ensure that we're invoking
nbdkit correctly for various disk source definitions.
Signed-off-by: Jonathon Jongsma <jjongsma(a)redhat.com>
---
[...]
diff --git a/tests/qemunbdkittest.c b/tests/qemunbdkittest.c
new file mode 100644
index 0000000000..c53601dac8
--- /dev/null
+++ b/tests/qemunbdkittest.c
@@ -0,0 +1,220 @@
[...]
+#define DO_TEST(_name, ...) \
+ DO_TEST_FULL(_name, NBDKIT_ARG_CAPS, __VA_ARGS__, QEMU_NBDKIT_CAPS_LAST,
NBDKIT_ARG_END)
+
+#define DO_TEST_NOCAPS(_name) \
+ DO_TEST_FULL(_name, NBDKIT_ARG_END)
+
+ DO_TEST("disk-cdrom-network", QEMU_NBDKIT_CAPS_PLUGIN_CURL);
+ DO_TEST("disk-network-http", QEMU_NBDKIT_CAPS_PLUGIN_CURL);
+ DO_TEST("disk-network-source-curl-nbdkit-backing",
QEMU_NBDKIT_CAPS_PLUGIN_CURL);
+ DO_TEST("disk-network-source-curl", QEMU_NBDKIT_CAPS_PLUGIN_CURL);
+ DO_TEST("disk-network-ssh", QEMU_NBDKIT_CAPS_PLUGIN_SSH);
+
+ qemuTestDriverFree(&driver);
Would it be possible to actually test all of this inside
qemuxml2argvtest?
If there is a split-up test procedure any upcoming changes may not
involve adding test cases to this specific test binary.