On Thu, Oct 20, 2022 at 16:59:05 -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.
For now, expect failure for tests that use sensitive data such as
passwords and cookies.
Signed-off-by: Jonathon Jongsma <jjongsma(a)redhat.com>
---
src/qemu/qemu_nbdkit.c | 4 +-
src/qemu/qemu_nbdkitpriv.h | 31 +++
tests/meson.build | 1 +
.../disk-network-ssh.args.disk0 | 7 +
tests/qemunbdkittest.c | 239 ++++++++++++++++++
5 files changed, 281 insertions(+), 1 deletion(-)
create mode 100644 src/qemu/qemu_nbdkitpriv.h
create mode 100644 tests/qemunbdkitdata/disk-network-ssh.args.disk0
create mode 100644 tests/qemunbdkittest.c
[...]
+#define DO_TEST_NOCAPS(_name) \
+ DO_TEST_FULL(_name, NBDKIT_ARG_END)
+
+ /* disks with cookies / passwords are not yet supported */
+ DO_TEST_FAILURE("disk-cdrom-network", QEMU_NBDKIT_CAPS_PLUGIN_CURL);
+ DO_TEST_FAILURE("disk-network-http", QEMU_NBDKIT_CAPS_PLUGIN_CURL);
+ DO_TEST_FAILURE("disk-network-source-curl-nbdkit-backing",
QEMU_NBDKIT_CAPS_PLUGIN_CURL);
+ DO_TEST_FAILURE("disk-network-source-curl",
QEMU_NBDKIT_CAPS_PLUGIN_CURL);
+ DO_TEST("disk-network-ssh", QEMU_NBDKIT_CAPS_PLUGIN_SSH);
This examplifies my previous comment about functionality being broken.
Enabling the nbdkit backend must happen only after full functionality is
implemented.
For this patch:
Reviewed-by: Peter Krempa <pkrempa(a)redhat.com>