From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
Juan Quintela <quintela@redhat.com>, John Snow <jsnow@redhat.com>,
qemu-devel@nongnu.org,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
Peter Krempa <pkrempa@redhat.com>, Max Reitz <mreitz@redhat.com>
Subject: [PATCH for-5.2 v3 2/3] iotests.py: Add wait_for_runstate()
Date: Wed, 22 Jul 2020 10:05:15 +0200 [thread overview]
Message-ID: <20200722080516.126147-3-mreitz@redhat.com> (raw)
In-Reply-To: <20200722080516.126147-1-mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
tests/qemu-iotests/iotests.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 3590ed78a0..20645a6e7d 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -28,6 +28,7 @@ import signal
import struct
import subprocess
import sys
+import time
from typing import (Any, Callable, Dict, Iterable,
List, Optional, Sequence, Tuple, TypeVar)
import unittest
@@ -803,6 +804,10 @@ class VM(qtest.QEMUQtestMachine):
'Found node %s under %s (but expected %s)' % \
(node['name'], path, expected_node)
+ def wait_for_runstate(self, runstate: str) -> None:
+ while self.qmp('query-status')['return']['status'] != runstate:
+ time.sleep(0.2)
+
index_re = re.compile(r'([^\[]+)\[([^\]]+)\]')
class QMPTestCase(unittest.TestCase):
--
2.26.2
next prev parent reply other threads:[~2020-07-22 8:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-22 8:05 [PATCH for-5.2 v3 0/3] migration: Add block-bitmap-mapping parameter Max Reitz
2020-07-22 8:05 ` [PATCH for-5.2 v3 1/3] " Max Reitz
2020-08-12 14:32 ` Eric Blake
2020-08-13 13:03 ` Max Reitz
2020-07-22 8:05 ` Max Reitz [this message]
2020-07-22 8:05 ` [PATCH for-5.2 v3 3/3] iotests: Test node/bitmap aliases during migration Max Reitz
2020-08-12 14:15 ` [PATCH for-5.2 v3 0/3] migration: Add block-bitmap-mapping parameter Max Reitz
2020-08-12 14:38 ` Vladimir Sementsov-Ogievskiy
2020-08-13 13:04 ` Max Reitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200722080516.126147-3-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=dgilbert@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=pkrempa@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).