qemu-iotests: make assert_no_active_block_jobs() common

Tests 030 and 041 both use query-block-jobs to check whether any block
jobs are active.  Make this code common so that 'drive-backup' and other
new feature tests will be able to reuse it.

Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Stefan Hajnoczi 2013-05-28 17:11:34 +02:00 committed by Kevin Wolf
parent b64ec4e4ad
commit ecc1c88efd
3 changed files with 57 additions and 61 deletions

View file

@ -170,6 +170,10 @@ class QMPTestCase(unittest.TestCase):
result = self.dictpath(d, path)
self.assertEqual(result, value, 'values not equal "%s" and "%s"' % (str(result), str(value)))
def assert_no_active_block_jobs(self):
result = self.vm.qmp('query-block-jobs')
self.assert_qmp(result, 'return', [])
def notrun(reason):
'''Skip this test suite'''
# Each test in qemu-iotests has a number ("seq")