[15/17] iotests: add default node-name
diff mbox

Message ID 1479837270-79005-16-git-send-email-vsementsov@virtuozzo.com
State New
Headers show

Commit Message

Vladimir Sementsov-Ogievskiy Nov. 22, 2016, 5:54 p.m. UTC
When testing migration, auto-generated by qemu node-names differs in
source and destination qemu and migration fails. After this patch,
auto-generated by iotest nodenames will be the same.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 tests/qemu-iotests/iotests.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Vladimir Sementsov-Ogievskiy Jan. 9, 2017, 4:04 p.m. UTC | #1
09.01.2017 18:57, Denis V. Lunev wrote:
> On 11/22/2016 08:54 PM, Vladimir Sementsov-Ogievskiy wrote:
>> When testing migration, auto-generated by qemu node-names differs in
>> source and destination qemu and migration fails. After this patch,
>> auto-generated by iotest nodenames will be the same.
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>> ---
>>   tests/qemu-iotests/iotests.py | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
>> index f5ca4b8..264ee20 100644
>> --- a/tests/qemu-iotests/iotests.py
>> +++ b/tests/qemu-iotests/iotests.py
>> @@ -162,7 +162,8 @@ class VM(qtest.QEMUQtestMachine):
>>       def add_drive(self, path, opts='', interface='virtio', format=imgfmt):
>>           '''Add a virtio-blk drive to the VM'''
>>           options = ['if=%s' % interface,
>> -                   'id=drive%d' % self._num_drives]
>> +                   'id=drive%d' % self._num_drives,
>> +                   'node-name=drivenode%d' % self._num_drives]
>>   
>>           if path is not None:
>>               options.append('file=%s' % path)
> this patch is rotten, it breaks 041 test
>
> Correct code should be like this as was implemented originally.
>
> Den
>
> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
> index 28295a2..9272dce 100644
> --- a/tests/qemu-iotests/iotests.py
> +++ b/tests/qemu-iotests/iotests.py
> @@ -199,6 +199,7 @@ class VM(object):
>               options.append('file=%s' % path)
>               options.append('format=%s' % imgfmt)
>               options.append('cache=%s' % cachemode)
> +            options.append('node-name=drivenode%d' % self._num_drives)
>   
>           if opts:
>               options.append(opts)

Yes. And now I think, it would also good to check  \'node-name' not in 
opts\ before appending this.

Patch
diff mbox

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index f5ca4b8..264ee20 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -162,7 +162,8 @@  class VM(qtest.QEMUQtestMachine):
     def add_drive(self, path, opts='', interface='virtio', format=imgfmt):
         '''Add a virtio-blk drive to the VM'''
         options = ['if=%s' % interface,
-                   'id=drive%d' % self._num_drives]
+                   'id=drive%d' % self._num_drives,
+                   'node-name=drivenode%d' % self._num_drives]
 
         if path is not None:
             options.append('file=%s' % path)