mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
iotests: Respect -nodefaults in tests 41 and 55
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> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
8e4922535b
commit
0ed82f7a09
2 changed files with 16 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue