Re: [Qemu-block] [Qemu-devel] [PULL 06/29] iotests: Make BD-{remove, insert}-medium use @id

2018-02-12 Thread Max Reitz
On 2018-02-12 12:33, Christian Borntraeger wrote:
> Adding Max and Alberto,
> 
> I think the issue is that on s390 you cannot add a floppy

Thanks for letting me know.  I don't know why I resorted to floppy when
virtio would have worked (in this test) just as well...

Max



signature.asc
Description: OpenPGP digital signature


Re: [Qemu-block] [Qemu-devel] [PULL 06/29] iotests: Make BD-{remove, insert}-medium use @id

2018-02-12 Thread Christian Borntraeger
Adding Max and Alberto,

I think the issue is that on s390 you cannot add a floppy


On 02/12/2018 12:16 PM, Christian Borntraeger wrote:
> 
> On 01/23/2018 03:01 PM, Kevin Wolf wrote:
>> From: Max Reitz 
>>
>> In some cases, these commands still use the deprecated @device
>> parameter.  Fix that so we can later drop that parameter from their
>> interface.
>>
>> Signed-off-by: Max Reitz 
>> Message-id: 20171110224302.14424-2-mre...@redhat.com
>> Reviewed-by: Alberto Garcia 
>> Signed-off-by: Max Reitz 
>> ---
>>  tests/qemu-iotests/118 | 184 
>> +++--
>>  tests/qemu-iotests/155 |  60 
> 
> This broke 155 on s390:
> 
> -...
> +EEE
> +==
> +ERROR: testFull (__main__.TestBlockdevMirrorBacking)
> +--
> +Traceback (most recent call last):
> +  File "155", line 68, in setUp
> +self.vm.launch()
> +  File "/home/cborntra/REPOS/qemu/tests/qemu-iotests/../../scripts/qemu.py", 
> line 203, in launch
> +self._post_launch()
> +  File 
> "/home/cborntra/REPOS/qemu/tests/qemu-iotests/../../scripts/qtest.py", line 
> 100, in _post_launch
> +super(QEMUQtestMachine, self)._post_launch()
> +  File "/home/cborntra/REPOS/qemu/tests/qemu-iotests/../../scripts/qemu.py", 
> line 181, in _post_launch
> +self._qmp.accept()
> +  File 
> "/home/cborntra/REPOS/qemu/tests/qemu-iotests/../../scripts/qmp/qmp.py", line 
> 157, in accept
> +return self.__negotiate_capabilities()
> +  File 
> "/home/cborntra/REPOS/qemu/tests/qemu-iotests/../../scripts/qmp/qmp.py", line 
> 75, in __negotiate_capabilities
> +resp = self.cmd('qmp_capabilities')
> +  File 
> "/home/cborntra/REPOS/qemu/tests/qemu-iotests/../../scripts/qmp/qmp.py", line 
> 191, in cmd
> +return self.cmd_obj(qmp_cmd)
> +  File 
> "/home/cborntra/REPOS/qemu/tests/qemu-iotests/../../scripts/qmp/qmp.py", line 
> 174, in cmd_obj
> +resp = self.__json_read()
> +  File 
> "/home/cborntra/REPOS/qemu/tests/qemu-iotests/../../scripts/qmp/qmp.py", line 
> 82, in __json_read
> +data = self.__sockfile.readline()
> +  File "/usr/lib64/python2.7/socket.py", line 451, in readline
> +data = self._sock.recv(self._rbufsize)
> +error: [Errno 104] Connection reset by peer
> [...]
> 
> 
> 
>>  2 files changed, 113 insertions(+), 131 deletions(-)
>>
>> diff --git a/tests/qemu-iotests/118 b/tests/qemu-iotests/118
>> index 8a9e838c90..ca6965d23c 100755
>> --- a/tests/qemu-iotests/118
>> +++ b/tests/qemu-iotests/118
>> @@ -28,6 +28,14 @@ from iotests import qemu_img
>>  old_img = os.path.join(iotests.test_dir, 'test0.img')
>>  new_img = os.path.join(iotests.test_dir, 'test1.img')
>>
>> +def interface_to_device_name(interface):
>> +if interface == 'ide':
>> +return 'ide-cd'
>> +elif interface == 'floppy':
>> +return 'floppy'
>> +else:
>> +return None
>> +
>>  class ChangeBaseClass(iotests.QMPTestCase):
>>  has_opened = False
>>  has_closed = False
>> @@ -63,7 +71,7 @@ class ChangeBaseClass(iotests.QMPTestCase):
>>
>>  class GeneralChangeTestsBaseClass(ChangeBaseClass):
>>
>> -device_name = None
>> +device_name = 'qdev0'
>>
>>  def test_change(self):
>>  result = self.vm.qmp('change', device='drive0', target=new_img,
>> @@ -79,14 +87,9 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass):
>>  self.assert_qmp(result, 'return[0]/inserted/image/filename', 
>> new_img)
>>
>>  def test_blockdev_change_medium(self):
>> -if self.device_name is not None:
>> -result = self.vm.qmp('blockdev-change-medium',
>> - id=self.device_name, filename=new_img,
>> - format=iotests.imgfmt)
>> -else:
>> -result = self.vm.qmp('blockdev-change-medium',
>> - device='drive0', filename=new_img,
>> - format=iotests.imgfmt)
>> +result = self.vm.qmp('blockdev-change-medium',
>> + id=self.device_name, filename=new_img,
>> + format=iotests.imgfmt)
>>
>>  self.assert_qmp(result, 'return', {})
>>
>> @@ -99,10 +102,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass):
>>  self.assert_qmp(result, 'return[0]/inserted/image/filename', 
>> new_img)
>>
>>  def test_eject(self):
>> -if self.device_name is not None:
>> -result = self.vm.qmp('eject', id=self.device_name, force=True)
>> -else:
>> -result = self.vm.qmp('eject', device='drive0', force=True)
>> +result = self.vm.qmp('eject', id=self.device_name, force=True)
>>  self.assert_qmp(result, 'return', {})
>>
>>  self.wait_for_open()
>> @@ -113,10 +113,7 @@ class 

Re: [Qemu-block] [Qemu-devel] [PULL 06/29] iotests: Make BD-{remove, insert}-medium use @id

2018-02-12 Thread Christian Borntraeger

On 01/23/2018 03:01 PM, Kevin Wolf wrote:
> From: Max Reitz 
> 
> In some cases, these commands still use the deprecated @device
> parameter.  Fix that so we can later drop that parameter from their
> interface.
> 
> Signed-off-by: Max Reitz 
> Message-id: 20171110224302.14424-2-mre...@redhat.com
> Reviewed-by: Alberto Garcia 
> Signed-off-by: Max Reitz 
> ---
>  tests/qemu-iotests/118 | 184 
> +++--
>  tests/qemu-iotests/155 |  60 

This broke 155 on s390:

-...
+EEE
+==
+ERROR: testFull (__main__.TestBlockdevMirrorBacking)
+--
+Traceback (most recent call last):
+  File "155", line 68, in setUp
+self.vm.launch()
+  File "/home/cborntra/REPOS/qemu/tests/qemu-iotests/../../scripts/qemu.py", 
line 203, in launch
+self._post_launch()
+  File "/home/cborntra/REPOS/qemu/tests/qemu-iotests/../../scripts/qtest.py", 
line 100, in _post_launch
+super(QEMUQtestMachine, self)._post_launch()
+  File "/home/cborntra/REPOS/qemu/tests/qemu-iotests/../../scripts/qemu.py", 
line 181, in _post_launch
+self._qmp.accept()
+  File 
"/home/cborntra/REPOS/qemu/tests/qemu-iotests/../../scripts/qmp/qmp.py", line 
157, in accept
+return self.__negotiate_capabilities()
+  File 
"/home/cborntra/REPOS/qemu/tests/qemu-iotests/../../scripts/qmp/qmp.py", line 
75, in __negotiate_capabilities
+resp = self.cmd('qmp_capabilities')
+  File 
"/home/cborntra/REPOS/qemu/tests/qemu-iotests/../../scripts/qmp/qmp.py", line 
191, in cmd
+return self.cmd_obj(qmp_cmd)
+  File 
"/home/cborntra/REPOS/qemu/tests/qemu-iotests/../../scripts/qmp/qmp.py", line 
174, in cmd_obj
+resp = self.__json_read()
+  File 
"/home/cborntra/REPOS/qemu/tests/qemu-iotests/../../scripts/qmp/qmp.py", line 
82, in __json_read
+data = self.__sockfile.readline()
+  File "/usr/lib64/python2.7/socket.py", line 451, in readline
+data = self._sock.recv(self._rbufsize)
+error: [Errno 104] Connection reset by peer
[...]



>  2 files changed, 113 insertions(+), 131 deletions(-)
> 
> diff --git a/tests/qemu-iotests/118 b/tests/qemu-iotests/118
> index 8a9e838c90..ca6965d23c 100755
> --- a/tests/qemu-iotests/118
> +++ b/tests/qemu-iotests/118
> @@ -28,6 +28,14 @@ from iotests import qemu_img
>  old_img = os.path.join(iotests.test_dir, 'test0.img')
>  new_img = os.path.join(iotests.test_dir, 'test1.img')
> 
> +def interface_to_device_name(interface):
> +if interface == 'ide':
> +return 'ide-cd'
> +elif interface == 'floppy':
> +return 'floppy'
> +else:
> +return None
> +
>  class ChangeBaseClass(iotests.QMPTestCase):
>  has_opened = False
>  has_closed = False
> @@ -63,7 +71,7 @@ class ChangeBaseClass(iotests.QMPTestCase):
> 
>  class GeneralChangeTestsBaseClass(ChangeBaseClass):
> 
> -device_name = None
> +device_name = 'qdev0'
> 
>  def test_change(self):
>  result = self.vm.qmp('change', device='drive0', target=new_img,
> @@ -79,14 +87,9 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass):
>  self.assert_qmp(result, 'return[0]/inserted/image/filename', new_img)
> 
>  def test_blockdev_change_medium(self):
> -if self.device_name is not None:
> -result = self.vm.qmp('blockdev-change-medium',
> - id=self.device_name, filename=new_img,
> - format=iotests.imgfmt)
> -else:
> -result = self.vm.qmp('blockdev-change-medium',
> - device='drive0', filename=new_img,
> - format=iotests.imgfmt)
> +result = self.vm.qmp('blockdev-change-medium',
> + id=self.device_name, filename=new_img,
> + format=iotests.imgfmt)
> 
>  self.assert_qmp(result, 'return', {})
> 
> @@ -99,10 +102,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass):
>  self.assert_qmp(result, 'return[0]/inserted/image/filename', new_img)
> 
>  def test_eject(self):
> -if self.device_name is not None:
> -result = self.vm.qmp('eject', id=self.device_name, force=True)
> -else:
> -result = self.vm.qmp('eject', device='drive0', force=True)
> +result = self.vm.qmp('eject', id=self.device_name, force=True)
>  self.assert_qmp(result, 'return', {})
> 
>  self.wait_for_open()
> @@ -113,10 +113,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass):
>  self.assert_qmp_absent(result, 'return[0]/inserted')
> 
>  def test_tray_eject_change(self):
> -if self.device_name is not None:
> -result = self.vm.qmp('eject', id=self.device_name, force=True)
> -else:
> -result =