[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/11] iotests: Consistent $IMGOPTS boundary matching
From: |
Kevin Wolf |
Subject: |
[PULL 02/11] iotests: Consistent $IMGOPTS boundary matching |
Date: |
Mon, 15 Feb 2021 16:00:51 +0100 |
From: Max Reitz <mreitz@redhat.com>
To disallow certain refcount_bits values, some _unsupported_imgopts
invocations look like "refcount_bits=1[^0-9]", i.e. they match an
integer boundary with [^0-9]. This expression does not match the end of
the string, though, so it breaks down when refcount_bits is the last
option (which it tends to be after the rewrite of the check script in
Python).
Those invocations could use \b or \> instead, but those are not
portable. They could use something like \([^0-9]\|$\), but that would
be cumbersome. To make it simple and keep the existing invocations
working, just let _unsupported_imgopts match the regex against $IMGOPTS
plus a trailing space.
Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20210210095128.22732-1-mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
tests/qemu-iotests/common.rc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 77c37e8312..65cdba5723 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -885,7 +885,9 @@ _unsupported_imgopts()
{
for bad_opt
do
- if echo "$IMGOPTS" | grep -q 2>/dev/null "$bad_opt"
+ # Add a space so tests can match for whitespace that marks the
+ # end of an option (\b or \> are not portable)
+ if echo "$IMGOPTS " | grep -q 2>/dev/null "$bad_opt"
then
_notrun "not suitable for image option: $bad_opt"
fi
--
2.29.2
- [PULL 04/11] hw/ide/ahci: map cmd_fis as DMA_DIRECTION_TO_DEVICE, (continued)
- [PULL 04/11] hw/ide/ahci: map cmd_fis as DMA_DIRECTION_TO_DEVICE, Kevin Wolf, 2021/02/15
- [PULL 01/11] qemu-storage-daemon: Enable object-add, Kevin Wolf, 2021/02/15
- [PULL 05/11] xen-block: fix reporting of discard feature, Kevin Wolf, 2021/02/15
- [PULL 09/11] block: qcow2: remove the created file on initialization error, Kevin Wolf, 2021/02/15
- [PULL 06/11] tests/qemu-iotests: Remove test 259 from the "auto" group, Kevin Wolf, 2021/02/15
- [PULL 03/11] blockjob: Fix crash with IOthread when block commit after snapshot, Kevin Wolf, 2021/02/15
- [PULL 10/11] monitor: Fix assertion failure on shutdown, Kevin Wolf, 2021/02/15
- [PULL 07/11] crypto: luks: Fix tiny memory leak, Kevin Wolf, 2021/02/15
- [PULL 08/11] block: add bdrv_co_delete_file_noerr, Kevin Wolf, 2021/02/15
- [PULL 11/11] monitor/qmp: Stop processing requests when shutdown is requested, Kevin Wolf, 2021/02/15
- [PULL 02/11] iotests: Consistent $IMGOPTS boundary matching,
Kevin Wolf <=
- Re: [PULL 00/11] Block layer patches, Peter Maydell, 2021/02/15