[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/34] iotests: Add -o and --no-opts to _make_test_img
From: |
Max Reitz |
Subject: |
[PULL 16/34] iotests: Add -o and --no-opts to _make_test_img |
Date: |
Mon, 6 Jan 2020 15:41:48 +0100 |
Blindly overriding IMGOPTS is suboptimal as this discards user-specified
options. Whatever options the test needs should simply be appended.
Some tests do this (with IMGOPTS=$(_optstr_add "$IMGOPTS" "...")), but
that is cumbersome. It’s simpler to just give _make_test_img an -o
parameter with which tests can add options.
Some tests actually must override the user-specified options, though,
for example when creating an image in a different format than the test
$IMGFMT. For such cases, --no-opts allows clearing the current option
list.
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Maxim Levitsky <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/common.rc | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index f01165a66e..7d704f9573 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -308,6 +308,7 @@ _make_test_img()
local use_backing=0
local backing_file=""
local object_options=""
+ local opts_param=false
local misc_params=()
if [ -n "$TEST_IMG_FILE" ]; then
@@ -328,6 +329,10 @@ _make_test_img()
if [ "$use_backing" = "1" -a -z "$backing_file" ]; then
backing_file=$param
continue
+ elif $opts_param; then
+ optstr=$(_optstr_add "$optstr" "$param")
+ opts_param=false
+ continue
fi
case "$param" in
@@ -335,6 +340,14 @@ _make_test_img()
use_backing=1
;;
+ -o)
+ opts_param=true
+ ;;
+
+ --no-opts)
+ optstr=""
+ ;;
+
*)
misc_params=("${misc_params[@]}" "$param")
;;
--
2.24.1
- [PULL 06/34] throttle-groups: fix memory leak in throttle_group_set_limit:, (continued)
- [PULL 06/34] throttle-groups: fix memory leak in throttle_group_set_limit:, Max Reitz, 2020/01/06
- [PULL 07/34] qcow2-bitmaps: fix qcow2_can_store_new_dirty_bitmap, Max Reitz, 2020/01/06
- [PULL 08/34] iotests: s/qocw2/qcow2/, Max Reitz, 2020/01/06
- [PULL 09/34] iotests/qcow2.py: Add dump-header-exts, Max Reitz, 2020/01/06
- [PULL 10/34] iotests/qcow2.py: Split feature fields into bits, Max Reitz, 2020/01/06
- [PULL 11/34] iotests: Add _filter_json_filename, Max Reitz, 2020/01/06
- [PULL 13/34] iotests: Replace IMGOPTS by _unsupported_imgopts, Max Reitz, 2020/01/06
- [PULL 12/34] iotests: Filter refcount_order in 036, Max Reitz, 2020/01/06
- [PULL 14/34] iotests: Drop compat=1.1 in 050, Max Reitz, 2020/01/06
- [PULL 15/34] iotests: Let _make_test_img parse its parameters, Max Reitz, 2020/01/06
- [PULL 16/34] iotests: Add -o and --no-opts to _make_test_img,
Max Reitz <=
- [PULL 17/34] iotests: Inject space into -ocompat=0.10 in 051, Max Reitz, 2020/01/06
- [PULL 20/34] iotests: Drop IMGOPTS use in 267, Max Reitz, 2020/01/06
- [PULL 19/34] iotests: Replace IMGOPTS='' by --no-opts, Max Reitz, 2020/01/06
- [PULL 18/34] iotests: Replace IMGOPTS= by -o, Max Reitz, 2020/01/06
- [PULL 21/34] iotests: Avoid qemu-img create, Max Reitz, 2020/01/06
- [PULL 23/34] iotests: Avoid cp/mv of test images, Max Reitz, 2020/01/06
- [PULL 22/34] iotests: Use _rm_test_img for deleting test images, Max Reitz, 2020/01/06
- [PULL 24/34] iotests: Make 091 work with data_file, Max Reitz, 2020/01/06
- [PULL 25/34] iotests: Make 110 work with data_file, Max Reitz, 2020/01/06
- [PULL 26/34] iotests: Make 137 work with data_file, Max Reitz, 2020/01/06