Skip to content

Commit

Permalink
iotests.py: Add node_info()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
XanClic committed Feb 25, 2019
1 parent f2ea0b2 commit ef7afd6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/qemu-iotests/iotests.py
Expand Up @@ -543,6 +543,13 @@ def run_job(self, job, auto_finalize=True, auto_dismiss=False):
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'([^\[]+)\[([^\]]+)\]')

Expand Down

0 comments on commit ef7afd6

Please sign in to comment.