aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2019-02-01 20:29:11 +0100
committerMax Reitz <mreitz@redhat.com>2019-02-25 15:11:26 +0100
commitef7afd63997d2928bcda9230b36c8fb6b08266bd (patch)
tree2fc595715c2c868a272d03145bce20f1b5abadbd /tests/qemu-iotests
parentf2ea0b2082ef2783abb5dfef0e8cab3d41ac6d5f (diff)
iotests.py: Add node_info()
This function queries a node; since we cannot do that right now, it executes query-named-block-nodes and returns the matching node's object. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 20190201192935.18394-8-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'tests/qemu-iotests')
-rw-r--r--tests/qemu-iotests/iotests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index d80fd7fc2a..82dd096c6e 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -543,6 +543,13 @@ class VM(qtest.QEMUQtestMachine):
else:
iotests.log(ev)
+ def node_info(self, node_name):
+ nodes = self.qmp('query-named-block-nodes')
+ for x in nodes['return']:
+ if x['node-name'] == node_name:
+ return x
+ return None
+
index_re = re.compile(r'([^\[]+)\[([^\]]+)\]')