[PATCH] [TEST] Fix domain created error in RASD.01

# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1207560373 25200 # Node ID 4578382726b1d2099c9b467a0532052b67af42e9 # Parent bedc7fc28125f9d6cc21f7a6752b479313f070e5 [TEST] Fix domain created error in RASD.01 Signed-off-by: Guolian Yun <yunguol@cn.ibm.com> diff -r bedc7fc28125 -r 4578382726b1 suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py --- a/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Fri Apr 04 12:25:02 2008 +0530 +++ b/suites/libvirt-cim/cimtest/RASD/01_verify_rasd_fields.py Mon Apr 07 02:26:13 2008 -0700 @@ -54,11 +54,12 @@ from XenKvmLib.test_doms import destroy_ from XenKvmLib.test_doms import destroy_and_undefine_all import XenKvmLib from XenKvmLib import assoc -from XenKvmLib.vxml import XenXML, KVMXML, get_class +from XenKvmLib import vxml from XenKvmLib.classes import get_typed_class from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \ verify_diskrasd_values, verify_memrasd_values from CimTest.Globals import log_param, logger +from CimTest.ReturnCodes import PASS, FAIL sup_types = ['Xen', 'KVM', 'XenFV'] @@ -66,7 +67,6 @@ test_vcpus = 1 test_vcpus = 1 test_mem = 128 test_mac = "00:11:22:33:44:aa" -test_disk = 'xvda' def init_list(virt="Xen"): """ @@ -86,7 +86,7 @@ def init_list(virt="Xen"): "CreationClassName": get_typed_class(virt, 'NetResourceAllocationSettingData') } - address = vsxml.xml_get_disk_source() + address = cxml.xml_get_disk_source() diskrasd = { "InstanceID" : '%s/%s' %(test_dom, test_disk), \ "ResourceType" : 17, \ @@ -133,28 +133,24 @@ def assoc_values(ip, assoc_info, virt="X @do_main(sup_types) def main(): - global vsxml + global cxml options = main.options status = 0 rc = 1 log_param() destroy_and_undefine_all(options.ip) - vsxml = get_class(options.virt)(test_dom, \ - mem=test_mem, \ - vcpus = test_vcpus, \ - mac = test_mac, \ - disk = test_disk) - try: - rc = vsxml.define(options.ip) - sc = vsxml.start(options.ip) - if rc == 0 or sc == 0: - logger.error("Define or start domain failed") - status = 1 - except Exception, details: - logger.error("Unknonw exception happened") - logger.error("Exception : %s" % details) - status = 1 - + global test_disk + if options.virt == 'Xen': + test_disk = 'xvda' + else: + test_disk = 'hda' + + virt_xml = vxml.get_class(options.virt) + cxml = virt_xml(test_dom, mem=test_mem, vcpus = test_vcpus, mac = test_mac, disk = test_disk) + ret = cxml.define(options.ip) + if not ret: + logger.error('Unable to create domain %s' % test_dom) + return FAIL if status == 1: destroy_and_undefine_all(options.ip) return 1 @@ -177,8 +173,8 @@ def main(): status = 1 try: - vsxml.destroy(options.ip) - vsxml.undefine(options.ip) + cxml.destroy(options.ip) + cxml.undefine(options.ip) except Exception: logger.error("Destroy or undefine domain failed") return status

GY> # HG changeset patch GY> # User Guolian Yun <yunguol@cn.ibm.com> GY> # Date 1207560373 25200 GY> # Node ID 4578382726b1d2099c9b467a0532052b67af42e9 GY> # Parent bedc7fc28125f9d6cc21f7a6752b479313f070e5 GY> [TEST] Fix domain created error in RASD.01 When I run the test suite with this patch applied, I get the following stack trace for this test (which I didn't get before): RASD - 01_verify_rasd_fields.py: FAIL Traceback (most recent call last): File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit msg = self.format(record) File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format return fmt.format(record) File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format record.message = record.getMessage() File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage msg = msg % self.args TypeError: not enough arguments for format string -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com

libvirt-cim-bounces@redhat.com wrote on 2008-04-07 23:27:39:
GY> # HG changeset patch GY> # User Guolian Yun <yunguol@cn.ibm.com> GY> # Date 1207560373 25200 GY> # Node ID 4578382726b1d2099c9b467a0532052b67af42e9 GY> # Parent bedc7fc28125f9d6cc21f7a6752b479313f070e5 GY> [TEST] Fix domain created error in RASD.01
When I run the test suite with this patch applied, I get the following stack trace for this test (which I didn't get before):
RASD - 01_verify_rasd_fields.py: FAIL Traceback (most recent call last): File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit msg = self.format(record) File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format return fmt.format(record) File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format record.message = record.getMessage() File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage msg = msg % self.args TypeError: not enough arguments for format string
This test with the patch pass for me. The TypeError seems to be a common issue, which repeated several times in cimtest running. I will try to track down. Also, the patch fix the domain created error, maybe you can apply it firstly.
-- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com [attachment "attld5ar.dat" deleted by Guo Lian Yun/China/IBM] _______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim

Guo Lian Yun wrote:
libvirt-cim-bounces@redhat.com wrote on 2008-04-07 23:27:39:
GY> # HG changeset patch GY> # User Guolian Yun <yunguol@cn.ibm.com> GY> # Date 1207560373 25200 GY> # Node ID 4578382726b1d2099c9b467a0532052b67af42e9 GY> # Parent bedc7fc28125f9d6cc21f7a6752b479313f070e5 GY> [TEST] Fix domain created error in RASD.01
When I run the test suite with this patch applied, I get the following stack trace for this test (which I didn't get before):
RASD - 01_verify_rasd_fields.py: FAIL Traceback (most recent call last): File "/usr/lib64/python2.5/logging/__init__.py", line 744, in emit msg = self.format(record) File "/usr/lib64/python2.5/logging/__init__.py", line 630, in format return fmt.format(record) File "/usr/lib64/python2.5/logging/__init__.py", line 418, in format record.message = record.getMessage() File "/usr/lib64/python2.5/logging/__init__.py", line 288, in getMessage msg = msg % self.args TypeError: not enough arguments for format string
This test with the patch pass for me. The TypeError seems to be a common issue, which repeated several times in cimtest running. I will try to track down. Also, the patch fix the domain created error, maybe you can apply it firstly.
- global vsxml + global cxml + global test_disk + if options.virt == 'Xen': + test_disk = 'xvda' + else: + test_disk = 'hda' I think avoiding globals when possible is a good idea. I realize that the test already used a global vsxml, but I think it'd be cleaner to see these variables passed in as arguments instead. -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com
participants (3)
-
Dan Smith
-
Guo Lian Yun
-
Kaitlin Rupert