From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Jeff Cody <jcody@redhat.com>,
qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH v2 2/4] iotests: Respect -nodefaults in tests 41 and 55
Date: Wed, 2 Sep 2015 20:52:26 +0200 [thread overview]
Message-ID: <1441219948-13242-3-git-send-email-mreitz@redhat.com> (raw)
In-Reply-To: <1441219948-13242-1-git-send-email-mreitz@redhat.com>
While -nodefaults is set in $QEMU_OPTIONS, this is currently (wrongly)
ignored for Python iotests. In order to be prepared for when this is
fixed, we should explicitly add an IDE CD-ROM drive instead of relying
on it being created automatically.
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
tests/qemu-iotests/041 | 12 +++++++++---
tests/qemu-iotests/055 | 10 +++++++---
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
index de8ea15..38ca5f1 100755
--- a/tests/qemu-iotests/041
+++ b/tests/qemu-iotests/041
@@ -42,6 +42,8 @@ class TestSingleDrive(iotests.QMPTestCase):
iotests.create_image(backing_img, self.image_len)
qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img)
self.vm = iotests.VM().add_drive(test_img)
+ if iotests.qemu_default_machine == 'pc':
+ self.vm.add_drive(None, 'media=cdrom', 'ide')
self.vm.launch()
def tearDown(self):
@@ -170,8 +172,8 @@ class TestSingleDrive(iotests.QMPTestCase):
if iotests.qemu_default_machine != 'pc':
return
- result = self.vm.qmp('drive-mirror', device='ide1-cd0', sync='full',
- target=target_img)
+ result = self.vm.qmp('drive-mirror', device='drive1', # CD-ROM
+ sync='full', target=target_img)
self.assert_qmp(result, 'error/class', 'GenericError')
def test_image_not_found(self):
@@ -710,6 +712,9 @@ class TestRepairQuorum(iotests.QMPTestCase):
def setUp(self):
self.vm = iotests.VM()
+ if iotests.qemu_default_machine == 'pc':
+ self.vm.add_drive(None, 'media=cdrom', 'ide')
+
# Add each individual quorum images
for i in self.IMAGES:
qemu_img('create', '-f', iotests.imgfmt, i,
@@ -837,7 +842,8 @@ class TestRepairQuorum(iotests.QMPTestCase):
if iotests.qemu_default_machine != 'pc':
return
- result = self.vm.qmp('drive-mirror', device='ide1-cd0', sync='full',
+ result = self.vm.qmp('drive-mirror', device='drive0', # CD-ROM
+ sync='full',
node_name='repair0',
replaces='img1',
target=quorum_repair_img, format=iotests.imgfmt)
diff --git a/tests/qemu-iotests/055 b/tests/qemu-iotests/055
index e6e0ac4..c8e3578 100755
--- a/tests/qemu-iotests/055
+++ b/tests/qemu-iotests/055
@@ -42,6 +42,8 @@ class TestSingleDrive(iotests.QMPTestCase):
qemu_img('create', '-f', iotests.imgfmt, blockdev_target_img, str(TestSingleDrive.image_len))
self.vm = iotests.VM().add_drive(test_img).add_drive(blockdev_target_img)
+ if iotests.qemu_default_machine == 'pc':
+ self.vm.add_drive(None, 'media=cdrom', 'ide')
self.vm.launch()
def tearDown(self):
@@ -107,7 +109,7 @@ class TestSingleDrive(iotests.QMPTestCase):
if iotests.qemu_default_machine != 'pc':
return
- result = self.vm.qmp('drive-backup', device='ide1-cd0',
+ result = self.vm.qmp('drive-backup', device='drive2', # CD-ROM
target=target_img, sync='full')
self.assert_qmp(result, 'error/class', 'GenericError')
@@ -115,7 +117,7 @@ class TestSingleDrive(iotests.QMPTestCase):
if iotests.qemu_default_machine != 'pc':
return
- result = self.vm.qmp('blockdev-backup', device='ide1-cd0',
+ result = self.vm.qmp('blockdev-backup', device='drive2', # CD-ROM
target='drive1', sync='full')
self.assert_qmp(result, 'error/class', 'GenericError')
@@ -255,6 +257,8 @@ class TestSingleTransaction(iotests.QMPTestCase):
qemu_img('create', '-f', iotests.imgfmt, blockdev_target_img, str(TestSingleDrive.image_len))
self.vm = iotests.VM().add_drive(test_img).add_drive(blockdev_target_img)
+ if iotests.qemu_default_machine == 'pc':
+ self.vm.add_drive(None, 'media=cdrom', 'ide')
self.vm.launch()
def tearDown(self):
@@ -334,7 +338,7 @@ class TestSingleTransaction(iotests.QMPTestCase):
result = self.vm.qmp('transaction', actions=[{
'type': cmd,
- 'data': { 'device': 'ide1-cd0',
+ 'data': { 'device': 'drive2', # CD-ROM
'target': target,
'sync': 'full' },
}
--
2.5.1
next prev parent reply other threads:[~2015-09-02 18:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-02 18:52 [Qemu-devel] [PATCH v2 0/4] iotests: Emit signal-kill messages Max Reitz
2015-09-02 18:52 ` [Qemu-devel] [PATCH v2 1/4] iotests: More options for VM.add_drive() Max Reitz
2015-09-02 18:52 ` Max Reitz [this message]
2015-09-02 19:55 ` [Qemu-devel] [PATCH v2 2/4] iotests: Respect -nodefaults in tests 41 and 55 Eric Blake
2015-09-02 18:52 ` [Qemu-devel] [PATCH v2 3/4] iotests: Do not suppress segfaults in bash tests Max Reitz
2015-09-02 20:02 ` Eric Blake
2015-09-02 18:52 ` [Qemu-devel] [PATCH v2 4/4] iotests: Warn if python subprocess is killed Max Reitz
2015-09-02 20:17 ` Eric Blake
2015-09-03 15:25 ` [Qemu-devel] [PATCH v2 0/4] iotests: Emit signal-kill messages Kevin Wolf
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=1441219948-13242-3-git-send-email-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=jcody@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).