[Kimchi-devel] [PATCH 3/3] test/test_model: Power architecture fixes

Daniel Henrique Barboza dhbarboza82 at gmail.com
Fri Mar 20 16:48:45 UTC 2015



On 03/20/2015 10:29 AM, Aline Manera wrote:
>
>
> On 16/03/2015 16:29, Daniel Henrique Barboza wrote:
>> - test_vm_disk now uses osinfo 'get_template_default' to get the default
>> value for 'disk_bus'.
>>
>> - kimchi_iso now generates a Ubuntu 14.04 fake iso to allow modern Power
>> template in the tests (Ubuntu 12.04 is not considered a modern distro 
>> for
>> Power).
>>
>> - iso_gen.py was updated to allow the creation of Ubuntu 14.04 fake 
>> isos.
>>
>> Signed-off-by: Daniel Henrique Barboza <dhbarboza82 at gmail.com>
>> ---
>>   tests/iso_gen.py    |  3 ++-
>>   tests/test_model.py | 10 ++++++----
>>   2 files changed, 8 insertions(+), 5 deletions(-)
>>
>> diff --git a/tests/iso_gen.py b/tests/iso_gen.py
>> index 5a0262f..096161d 100644
>> --- a/tests/iso_gen.py
>> +++ b/tests/iso_gen.py
>> @@ -48,7 +48,8 @@ iso_des = [
>>       ('debian', lambda v: True, lambda v: 'Debian %s' % v),
>>       ('ubuntu',
>>        lambda v: v in ('7.10', '8.04', '8.10', '9.04', '9.10', 
>> '10.04', '10.10',
>> -                     '11.04', '11.10', '12.04', '12.10', '13.04', 
>> '13.10'),
>> +                     '11.04', '11.10', '12.04', '12.10', '13.04', 
>> '13.10',
>> +                     '14.04'),
>>        lambda v: 'Ubuntu %s' % v),
>>       ('fedora',
>>        lambda v: v in ('16', '17', '18', '19'),
>> diff --git a/tests/test_model.py b/tests/test_model.py
>> index decc5f1..76deb12 100644
>> --- a/tests/test_model.py
>> +++ b/tests/test_model.py
>> @@ -40,6 +40,7 @@ from kimchi import netinfo
>>   from kimchi.config import config
>>   from kimchi.exception import InvalidOperation
>>   from kimchi.exception import InvalidParameter, NotFoundError, 
>> OperationFailed
>> +from kimchi.osinfo import get_template_default
>>   from kimchi.model import model
>>   from kimchi.model.libvirtconnection import LibvirtConnection
>>   from kimchi.rollbackcontext import RollbackContext
>> @@ -59,7 +60,7 @@ class ModelTests(unittest.TestCase):
>>           if not os.path.exists(self.iso_path):
>>               os.makedirs(self.iso_path)
>>           self.kimchi_iso = self.iso_path + 'ubuntu12.04.iso'
>> -        iso_gen.construct_fake_iso(self.kimchi_iso, True, '12.04', 
>> 'ubuntu')
>> +        iso_gen.construct_fake_iso(self.kimchi_iso, True, '14.04', 
>> 'ubuntu')
>
> Just update the kimchi_iso value as it is still pointing to 12.04
ok!
>
>>       def tearDown(self):
>>           # FIXME: Tests using 'test:///default' URI should be moved to
>> @@ -337,8 +338,9 @@ class ModelTests(unittest.TestCase):
>>       def test_vm_disk(self):
>>           disk_path = '/tmp/existent2.iso'
>>           open(disk_path, 'w').close()
>> +        modern_disk_bus = get_template_default('modern', 'disk_bus')
>>
>> -        def _attach_disk(expect_bus='virtio'):
>> +        def _attach_disk(expect_bus=modern_disk_bus):
>>               disk_args = {"type": "disk",
>>                            "pool": pool,
>>                            "vol": vol}
>> @@ -432,8 +434,8 @@ class ModelTests(unittest.TestCase):
>>               inst.vms_create(params)
>>               rollback.prependDefer(inst.vm_delete, vm_name)
>>
>> -            # Attach will choose IDE bus for old distro
>> -            disk = _attach_disk('ide')
>> +            # Need to check the right disk_bus for old distro
>> +            disk = _attach_disk(get_template_default('old', 
>> 'disk_bus'))
>>               inst.vmstorage_delete('kimchi-ide-bus-vm', disk)
>>
>>               # Hot plug IDE bus disk does not work
>




More information about the Kimchi-devel mailing list