[Libguestfs] [libnbd PATCH v2 10/23] tests: Do not use magic parameter for some nbdkit plugins

Martin Kletzander mkletzan at redhat.com
Thu Jun 10 23:12:14 UTC 2021


The 'memory' and 'pattern' plugins gained support for that some time ago,
however on some systems such nbdkit is not in the official repositories.  This
makes sure that the tests don't fail unnecessarily on such systems.

Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
---
 copy/copy-block-to-nbd.sh             | 2 +-
 copy/copy-nbd-to-block.sh             | 2 +-
 copy/copy-nbd-to-small-block-error.sh | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/copy/copy-block-to-nbd.sh b/copy/copy-block-to-nbd.sh
index 00d45427e967..6894e17dd79e 100755
--- a/copy/copy-block-to-nbd.sh
+++ b/copy/copy-block-to-nbd.sh
@@ -35,7 +35,7 @@ cleanup_fn rm -f $pidfile $sock
 cleanup_fn nbd-client -d /dev/nbd0
 
 # Run an nbdkit server to act as the backing for /dev/nbd0.
-nbdkit --exit-with-parent -f -v -P $pidfile -U $sock pattern 5M &
+nbdkit --exit-with-parent -f -v -P $pidfile -U $sock pattern size=5M &
 # Wait for the pidfile to appear.
 for i in {1..60}; do
     if test -f $pidfile; then
diff --git a/copy/copy-nbd-to-block.sh b/copy/copy-nbd-to-block.sh
index b3e6402c38a6..9961c3f7bd6b 100755
--- a/copy/copy-nbd-to-block.sh
+++ b/copy/copy-nbd-to-block.sh
@@ -50,7 +50,7 @@ fi
 
 nbd-client -unix $sock /dev/nbd0 -b 512
 
-$VG nbdcopy -- [ nbdkit --exit-with-parent -v pattern 5M ] /dev/nbd0
+$VG nbdcopy -- [ nbdkit --exit-with-parent -v pattern size=5M ] /dev/nbd0
 
 # Check that /dev/nbd0 is still a block device and we didn't
 # accidentally overwrite it with a regular file.
diff --git a/copy/copy-nbd-to-small-block-error.sh b/copy/copy-nbd-to-small-block-error.sh
index ef5da9a0df62..75032e5b0d49 100755
--- a/copy/copy-nbd-to-small-block-error.sh
+++ b/copy/copy-nbd-to-small-block-error.sh
@@ -36,8 +36,8 @@ sock2=$(mktemp -u /tmp/libnbd-test-copy.XXXXXX)
 cleanup_fn rm -f $pidfile1 $pidfile2 $sock1 $sock2
 cleanup_fn nbd-client -d /dev/nbd0
 
-nbdkit --exit-with-parent -f -v -P $pidfile1 -U $sock1 pattern 10M &
-nbdkit --exit-with-parent -f -v -P $pidfile2 -U $sock2 memory 5M &
+nbdkit --exit-with-parent -f -v -P $pidfile1 -U $sock1 pattern size=10M &
+nbdkit --exit-with-parent -f -v -P $pidfile2 -U $sock2 memory size=5M &
 # Wait for the pidfiles to appear.
 for i in {1..60}; do
     if test -f $pidfile1 && test -f $pidfile2; then
-- 
2.32.0




More information about the Libguestfs mailing list