All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [PATCH] iotests: Fix unsupported_imgopts for refcount_bits
Date: Tue,  9 Feb 2021 19:27:45 +0100	[thread overview]
Message-ID: <20210209182745.501662-1-mreitz@redhat.com> (raw)

Many _unsupported_imgopts lines for refcount_bits values use something
like "refcount_bits=1[^0-9]" to forbid everything but "refcount_bits=1"
(e.g. "refcount_bits=16" is allowed).

That does not work when $IMGOPTS does not have any entry past the
refcount_bits option, which now became apparent with the "check" script
rewrite.

Use \b instead of [^0-9] to check for a word boundary, which is what we
really want.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
Reproducible with:
$ ./check -qcow2 -o refcount_bits=1
(The tests touched here should be skipped)

I don't know whether \b is portable.  I hope it is.
(This is why I CC-ed you, Eric.)

Then again, it appears that nobody ever runs the iotests with
refcount_bits=1 but me, and I do that on Linux.  So even if it isn't
portable, it shouldn't be an issue in practice... O:)
---
 tests/qemu-iotests/007 | 2 +-
 tests/qemu-iotests/015 | 2 +-
 tests/qemu-iotests/029 | 2 +-
 tests/qemu-iotests/058 | 2 +-
 tests/qemu-iotests/062 | 2 +-
 tests/qemu-iotests/066 | 2 +-
 tests/qemu-iotests/068 | 2 +-
 tests/qemu-iotests/080 | 2 +-
 tests/qemu-iotests/103 | 2 +-
 tests/qemu-iotests/201 | 2 +-
 tests/qemu-iotests/214 | 2 +-
 tests/qemu-iotests/217 | 2 +-
 tests/qemu-iotests/267 | 2 +-
 tests/qemu-iotests/271 | 3 ++-
 tests/qemu-iotests/286 | 2 +-
 15 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/tests/qemu-iotests/007 b/tests/qemu-iotests/007
index 936d3f14fb..a014f50a6b 100755
--- a/tests/qemu-iotests/007
+++ b/tests/qemu-iotests/007
@@ -44,7 +44,7 @@ _supported_proto generic
 # refcount_bits must be at least 4 so we can create ten internal snapshots
 # (1 bit supports none, 2 bits support two, 4 bits support 14);
 # snapshot are generally impossible with external data files
-_unsupported_imgopts 'refcount_bits=\(1\|2\)[^0-9]' data_file
+_unsupported_imgopts 'refcount_bits=\(1\|2\)\b' data_file
 
 echo
 echo "creating image"
diff --git a/tests/qemu-iotests/015 b/tests/qemu-iotests/015
index 40c23235a6..24e28643e4 100755
--- a/tests/qemu-iotests/015
+++ b/tests/qemu-iotests/015
@@ -43,7 +43,7 @@ _supported_fmt qcow2
 _supported_proto generic
 # Internal snapshots are (currently) impossible with refcount_bits=1,
 # and generally impossible with external data files
-_unsupported_imgopts 'refcount_bits=1[^0-9]' data_file
+_unsupported_imgopts 'refcount_bits=1\b' data_file
 
 echo
 echo "creating image"
diff --git a/tests/qemu-iotests/029 b/tests/qemu-iotests/029
index bd71dd2f22..9b345060e5 100755
--- a/tests/qemu-iotests/029
+++ b/tests/qemu-iotests/029
@@ -44,7 +44,7 @@ _supported_fmt qcow2
 _supported_proto generic
 # Internal snapshots are (currently) impossible with refcount_bits=1,
 # and generally impossible with external data files
-_unsupported_imgopts 'refcount_bits=1[^0-9]' data_file
+_unsupported_imgopts 'refcount_bits=1\b' data_file
 
 offset_size=24
 offset_l1_size=36
diff --git a/tests/qemu-iotests/058 b/tests/qemu-iotests/058
index ce35ff4ee0..0b0303fcd5 100755
--- a/tests/qemu-iotests/058
+++ b/tests/qemu-iotests/058
@@ -59,7 +59,7 @@ _supported_os Linux
 _require_command QEMU_NBD
 # Internal snapshots are (currently) impossible with refcount_bits=1,
 # and generally impossible with external data files
-_unsupported_imgopts 'refcount_bits=1[^0-9]' data_file
+_unsupported_imgopts 'refcount_bits=1\b' data_file
 
 nbd_snapshot_img="nbd:unix:$nbd_unix_socket"
 
diff --git a/tests/qemu-iotests/062 b/tests/qemu-iotests/062
index 321252298d..d7307f24ac 100755
--- a/tests/qemu-iotests/062
+++ b/tests/qemu-iotests/062
@@ -42,7 +42,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow2
 _supported_proto generic
 # We need zero clusters and snapshots
-_unsupported_imgopts 'compat=0.10' 'refcount_bits=1[^0-9]' data_file
+_unsupported_imgopts 'compat=0.10' 'refcount_bits=1\b' data_file
 
 IMG_SIZE=64M
 
diff --git a/tests/qemu-iotests/066 b/tests/qemu-iotests/066
index a780ed7ab5..ec9dab2025 100755
--- a/tests/qemu-iotests/066
+++ b/tests/qemu-iotests/066
@@ -43,7 +43,7 @@ _supported_proto generic
 # We need zero clusters and snapshots
 # (TODO: Consider splitting the snapshot part into a separate test
 #        file, so this one runs with refcount_bits=1 and data_file)
-_unsupported_imgopts 'compat=0.10' 'refcount_bits=1[^0-9]' data_file
+_unsupported_imgopts 'compat=0.10' 'refcount_bits=1\b' data_file
 
 # Intentionally create an unaligned image
 IMG_SIZE=$((64 * 1024 * 1024 + 512))
diff --git a/tests/qemu-iotests/068 b/tests/qemu-iotests/068
index 03e03508a6..39a04a6ab6 100755
--- a/tests/qemu-iotests/068
+++ b/tests/qemu-iotests/068
@@ -42,7 +42,7 @@ _supported_fmt qcow2
 _supported_proto generic
 # Internal snapshots are (currently) impossible with refcount_bits=1,
 # and generally impossible with external data files
-_unsupported_imgopts 'compat=0.10' 'refcount_bits=1[^0-9]' data_file
+_unsupported_imgopts 'compat=0.10' 'refcount_bits=1\b' data_file
 
 IMG_SIZE=128K
 
diff --git a/tests/qemu-iotests/080 b/tests/qemu-iotests/080
index 3306500683..a7cf938204 100755
--- a/tests/qemu-iotests/080
+++ b/tests/qemu-iotests/080
@@ -44,7 +44,7 @@ _supported_os Linux
 # - Internal snapshots are (currently) impossible with refcount_bits=1,
 #   and generally impossible with external data files
 # - This is generally a test for compat=1.1 images
-_unsupported_imgopts 'refcount_bits=1[^0-9]' data_file 'compat=0.10'
+_unsupported_imgopts 'refcount_bits=1\b' data_file 'compat=0.10'
 
 header_size=112
 
diff --git a/tests/qemu-iotests/103 b/tests/qemu-iotests/103
index 726f8313ef..6276369052 100755
--- a/tests/qemu-iotests/103
+++ b/tests/qemu-iotests/103
@@ -41,7 +41,7 @@ _supported_fmt qcow2
 _supported_proto file nfs fuse
 # Internal snapshots are (currently) impossible with refcount_bits=1,
 # and generally impossible with external data files
-_unsupported_imgopts 'refcount_bits=1[^0-9]' data_file
+_unsupported_imgopts 'refcount_bits=1\b' data_file
 
 IMG_SIZE=64K
 
diff --git a/tests/qemu-iotests/201 b/tests/qemu-iotests/201
index 1b8eb51d8f..723d792adb 100755
--- a/tests/qemu-iotests/201
+++ b/tests/qemu-iotests/201
@@ -46,7 +46,7 @@ _supported_os Linux
 
 # Internal snapshots are (currently) impossible with refcount_bits=1,
 # and generally impossible with external data files
-_unsupported_imgopts 'refcount_bits=1[^0-9]' data_file
+_unsupported_imgopts 'refcount_bits=1\b' data_file
 
 size=64M
 _make_test_img $size
diff --git a/tests/qemu-iotests/214 b/tests/qemu-iotests/214
index 0889089d81..e57e477f7c 100755
--- a/tests/qemu-iotests/214
+++ b/tests/qemu-iotests/214
@@ -41,7 +41,7 @@ _supported_proto file fuse
 # Repairing the corrupted image requires qemu-img check to store a
 # refcount up to 3, which requires at least two refcount bits.
 # External data files do not support compressed clusters.
-_unsupported_imgopts 'refcount_bits=1[^0-9]' data_file
+_unsupported_imgopts 'refcount_bits=1\b' data_file
 
 
 echo
diff --git a/tests/qemu-iotests/217 b/tests/qemu-iotests/217
index e693f326a3..8b5df8d6bc 100755
--- a/tests/qemu-iotests/217
+++ b/tests/qemu-iotests/217
@@ -42,7 +42,7 @@ _supported_proto file fuse
 # This test needs clusters with at least a refcount of 2 so that
 # OFLAG_COPIED is not set.  refcount_bits=1 is therefore unsupported.
 # (As are external data files.)
-_unsupported_imgopts 'refcount_bits=1[^0-9]' data_file
+_unsupported_imgopts 'refcount_bits=1\b' data_file
 
 echo
 echo '=== Simulating an I/O error during snapshot deletion ==='
diff --git a/tests/qemu-iotests/267 b/tests/qemu-iotests/267
index 2e2afdad9c..eb42b1ec02 100755
--- a/tests/qemu-iotests/267
+++ b/tests/qemu-iotests/267
@@ -45,7 +45,7 @@ _require_drivers copy-on-read
 
 # Internal snapshots are (currently) impossible with refcount_bits=1,
 # and generally impossible with external data files
-_unsupported_imgopts 'refcount_bits=1[^0-9]' data_file
+_unsupported_imgopts 'refcount_bits=1\b' data_file
 
 _require_devices virtio-blk
 
diff --git a/tests/qemu-iotests/271 b/tests/qemu-iotests/271
index 599b849cc6..251afa0923 100755
--- a/tests/qemu-iotests/271
+++ b/tests/qemu-iotests/271
@@ -43,7 +43,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow2
 _supported_proto file nfs
 _supported_os Linux
-_unsupported_imgopts extended_l2 compat=0.10 cluster_size data_file refcount_bits=1[^0-9]
+_unsupported_imgopts extended_l2 compat=0.10 cluster_size data_file \
+    'refcount_bits=1\b'
 
 l2_offset=$((0x40000))
 
diff --git a/tests/qemu-iotests/286 b/tests/qemu-iotests/286
index 120a8375b7..76b3f80fa9 100755
--- a/tests/qemu-iotests/286
+++ b/tests/qemu-iotests/286
@@ -39,7 +39,7 @@ _supported_fmt qcow2
 _supported_proto file fuse
 # Internal snapshots are (currently) impossible with refcount_bits=1,
 # and generally impossible with external data files
-_unsupported_imgopts 'refcount_bits=1[^0-9]' data_file
+_unsupported_imgopts 'refcount_bits=1\b' data_file
 
 _make_test_img 64M
 
-- 
2.29.2



             reply	other threads:[~2021-02-09 18:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 18:27 Max Reitz [this message]
2021-02-09 18:49 ` [PATCH] iotests: Fix unsupported_imgopts for refcount_bits Eric Blake
2021-02-10  8:48   ` Max Reitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210209182745.501662-1-mreitz@redhat.com \
    --to=mreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.