[Libguestfs] [libnbd PATCH 1/6] info: Require nbdkit >= 1.14 for info-can.sh

Martin Kletzander mkletzan at redhat.com
Tue Jul 13 21:26:03 UTC 2021


The can_cache flag was introduced in 1.13.4, so the tests might fail on an older
one.  To make the check easier, only run this test with nbdkit >= 1.14

Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
---
 info/info-can.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/info/info-can.sh b/info/info-can.sh
index 4154e38e85ba..afa6043e24bc 100755
--- a/info/info-can.sh
+++ b/info/info-can.sh
@@ -24,6 +24,10 @@ set -x
 requires nbdkit --version
 requires nbdkit sh --version
 
+# This test requires nbdkit >= 1.13.3 due to can_cache, check for at least 1.14.
+minor=$( nbdkit --dump-config | grep ^version_minor | cut -d= -f2 )
+requires test $minor -ge 14
+
 # --is read-only and --can write are tested in info-is-read-only.sh
 
 # --can connect is tested in info-can-connect.sh
-- 
2.32.0




More information about the Libguestfs mailing list