diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-12-20 14:02:13 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-12-20 14:02:13 +0000 |
| commit | 59206947af095cbeadde27a88a40eb4fec266948 (patch) | |
| tree | cb8561d73ff73e9473a33bbdb2d91b7a9aed6ed9 /nova/tests | |
| parent | ae4fb9974df79e4eb3f20638a3071b409fc70a9e (diff) | |
| parent | 095759640dd48e2ea470dc160726a3a8501800a1 (diff) | |
Merge "Export custom SMBIOS info to QEMU/KVM guests"
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_libvirt.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py index af8991d09..28d680f5c 100644 --- a/nova/tests/test_libvirt.py +++ b/nova/tests/test_libvirt.py @@ -48,6 +48,7 @@ from nova.tests import fake_network import nova.tests.image.fake from nova.tests import matchers from nova import utils +from nova import version from nova.virt.disk import api as disk from nova.virt import driver from nova.virt import fake @@ -596,6 +597,7 @@ class LibvirtConnTestCase(test.TestCase): nova.tests.image.fake.stub_out_image_service(self.stubs) self.test_instance = { + 'uuid': '32dfcb37-5af1-552b-357c-be8c3aa38310', 'memory_kb': '1024000', 'basepath': '/some/path', 'bridge_name': 'br100', @@ -1830,6 +1832,43 @@ class LibvirtConnTestCase(test.TestCase): check_list.append(check) if hypervisor_type in ['qemu', 'kvm']: + xpath = "./sysinfo/system/entry" + check = (lambda t: t.findall(xpath)[0].get("name"), + "manufacturer") + check_list.append(check) + check = (lambda t: t.findall(xpath)[0].text, + version.vendor_string()) + check_list.append(check) + + check = (lambda t: t.findall(xpath)[1].get("name"), + "product") + check_list.append(check) + check = (lambda t: t.findall(xpath)[1].text, + version.product_string()) + check_list.append(check) + + check = (lambda t: t.findall(xpath)[2].get("name"), + "version") + check_list.append(check) + check = (lambda t: t.findall(xpath)[2].text, + version.version_string_with_package()) + check_list.append(check) + + check = (lambda t: t.findall(xpath)[3].get("name"), + "serial") + check_list.append(check) + check = (lambda t: t.findall(xpath)[3].text, + "cef19ce0-0ca2-11df-855d-b19fbce37686") + check_list.append(check) + + check = (lambda t: t.findall(xpath)[4].get("name"), + "uuid") + check_list.append(check) + check = (lambda t: t.findall(xpath)[4].text, + instance['uuid']) + check_list.append(check) + + if hypervisor_type in ['qemu', 'kvm']: check = (lambda t: t.findall('./devices/serial')[0].get( 'type'), 'file') check_list.append(check) |
