[Kimchi-devel] [PATCH 3/3 v2] test/test_model: Power architecture fixes
Aline Manera
alinefm at linux.vnet.ibm.com
Fri Mar 20 21:14:46 UTC 2015
I was not able to apply this patch due a merge conflict.
Please, rebase and resend.
I will apply the other 2 patches, so you just need to resend this one.
Thanks,
Aline Manera
On 20/03/2015 15:38, 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 | 12 +++++++-----
> 2 files changed, 9 insertions(+), 6 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..35d8509 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
> @@ -58,8 +59,8 @@ class ModelTests(unittest.TestCase):
> self.iso_path = '/tmp/kimchi-model-iso/'
> 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')
> + self.kimchi_iso = self.iso_path + 'ubuntu14.04.iso'
> + iso_gen.construct_fake_iso(self.kimchi_iso, True, '14.04', 'ubuntu')
>
> 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