[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 41/45] iotests.py: introduce VM.assert_edges_list() method
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v5 41/45] iotests.py: introduce VM.assert_edges_list() method |
Date: |
Thu, 31 Mar 2022 00:28:58 +0300 |
Add an alternative method to check block graph, to be used in further
commit.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
---
tests/qemu-iotests/iotests.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index c7a38a95a4..aaa77b5105 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -1084,6 +1084,23 @@ def check_bitmap_status(self, node_name, bitmap_name,
fields):
return fields.items() <= ret.items()
+ def get_block_graph(self):
+ """
+ Returns block graph in form of edges list, where each edge is a tuple:
+ (parent_node_name, child_name, child_node_name)
+ """
+ graph = self.qmp('x-debug-query-block-graph')['return']
+
+ nodes = {n['id']: n['name'] for n in graph['nodes']}
+ # Check that all names are unique:
+ assert len(set(nodes.values())) == len(nodes)
+
+ return [(nodes[e['parent']], e['name'], nodes[e['child']])
+ for e in graph['edges']]
+
+ def assert_edges_list(self, edges):
+ assert sorted(edges) == sorted(self.get_block_graph())
+
def assert_block_path(self, root, path, expected_node, graph=None):
"""
Check whether the node under the given path in the block graph
--
2.35.1
- [PATCH v5 05/45] tests-bdrv-drain: bdrv_replace_test driver: declare supports_backing, (continued)
- [PATCH v5 05/45] tests-bdrv-drain: bdrv_replace_test driver: declare supports_backing, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 08/45] block/snapshot: stress that we fallback to primary child, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 14/45] block/snapshot: drop indirection around bdrv_snapshot_fallback_ptr, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 17/45] block: drop bdrv_remove_filter_or_cow_child, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 28/45] qapi: block: add blockdev-del transaction action, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 35/45] block: make bdrv_find_child() function public, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 09/45] Revert "block: Let replace_child_noperm free children", Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 10/45] Revert "block: Let replace_child_tran keep indirect pointer", Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 13/45] block: Manipulate bs->file / bs->backing pointers in .attach/.detach, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 38/45] qapi: add x-blockdev-replace transaction action, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 41/45] iotests.py: introduce VM.assert_edges_list() method,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v5 40/45] iotests.py: qemu_img_create: use imgfmt by default, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 06/45] test-bdrv-graph-mod: fix filters to be filters, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 11/45] Revert "block: Restructure remove_file_or_backing_child()", Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 18/45] block: bdrv_refresh_perms(): allow external tran, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 21/45] block: add bdrv_try_set_aio_context_tran transaction action, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 22/45] block: implemet bdrv_unref_tran(), Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 23/45] blockdev: refactor transaction to use Transaction API, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 45/45] block/copy-before-write: correct permission scheme, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 03/45] block/blklogwrites: don't care to remove bs->file child on failure, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 12/45] Revert "block: Pass BdrvChild ** to replace_child_noperm", Vladimir Sementsov-Ogievskiy, 2022/03/30