[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/34] iotests: Add _filter_json_filename
From: |
Max Reitz |
Subject: |
[PULL 11/34] iotests: Add _filter_json_filename |
Date: |
Mon, 6 Jan 2020 15:41:43 +0100 |
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.filter | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
index 5367deea39..116cc8a840 100644
--- a/tests/qemu-iotests/common.filter
+++ b/tests/qemu-iotests/common.filter
@@ -232,5 +232,29 @@ _filter_qmp_empty_return()
grep -v '{"return": {}}'
}
+_filter_json_filename()
+{
+ $PYTHON -c 'import sys
+result, *fnames = sys.stdin.read().split("json:{")
+depth = 0
+for fname in fnames:
+ depth += 1 # For the opening brace in the split separator
+ for chr_i, chr in enumerate(fname):
+ if chr == "{":
+ depth += 1
+ elif chr == "}":
+ depth -= 1
+ if depth == 0:
+ break
+
+ # json:{} filenames may be nested; filter out everything from
+ # inside the outermost one
+ if depth == 0:
+ chr_i += 1 # First character past the filename
+ result += "json:{ /* filtered */ }" + fname[chr_i:]
+
+sys.stdout.write(result)'
+}
+
# make sure this script returns success
true
--
2.24.1
- [PULL 00/34] Block patches, Max Reitz, 2020/01/06
- [PULL 01/34] block: Add bdrv_qapi_perm_to_blk_perm(), Max Reitz, 2020/01/06
- [PULL 02/34] block: Use bdrv_qapi_perm_to_blk_perm(), Max Reitz, 2020/01/06
- [PULL 03/34] blkdebug: Allow taking/unsharing permissions, Max Reitz, 2020/01/06
- [PULL 04/34] iotests: Add @error to wait_until_completed, Max Reitz, 2020/01/06
- [PULL 05/34] iotests: Add test for failing mirror complete, Max Reitz, 2020/01/06
- [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 11/34] iotests: Add _filter_json_filename,
Max Reitz <=
- [PULL 10/34] iotests/qcow2.py: Split feature fields into bits, Max Reitz, 2020/01/06
- [PULL 12/34] iotests: Filter refcount_order in 036, Max Reitz, 2020/01/06
- [PULL 13/34] iotests: Replace IMGOPTS by _unsupported_imgopts, 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, 2020/01/06
- [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 18/34] iotests: Replace IMGOPTS= by -o, Max Reitz, 2020/01/06
- [PULL 19/34] iotests: Replace IMGOPTS='' by --no-opts, Max Reitz, 2020/01/06