[Libvirt-cim] [PATCH] [TEST] Update CS to call enumclass.py instead of computersystem.py
Kaitlin Rupert
kaitlin at linux.vnet.ibm.com
Wed Sep 3 00:38:52 UTC 2008
>> diff -r 946fd46b9686 -r db9789b5145f
>> suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py
>> --- a/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py
>> Thu Aug 28 14:07:25 2008 -0700
>> +++ b/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py
>> Sun Aug 31 19:31:03 2008 -0700
>> @@ -32,7 +32,7 @@
>> import sys
>> from time import sleep
>> from XenKvmLib import vxml
>> -from XenKvmLib import computersystem
>> +from XenKvmLib import enumclass
>> from CimTest import Globals
>> from XenKvmLib.classes import get_typed_class
>> from XenKvmLib.const import do_main
>> @@ -62,8 +62,8 @@
>> # otherwise. for i in range(1, (timeout + 1)):
>> sleep(1)
>> - cs = computersystem.get_cs_class(options.virt)(options.ip,
>> - test_dom)
>> + cs = get_typed_class(options.virt, 'ComputerSystem')\
>> + (options.ip, test_dom
You'll need to use enumclass.getInstance() here
>> if cs.Name != test_dom:
>> Globals.logger.error("VS %s is not defined" % test_dom)
>> break
> This tc fails with the following error:
> --------------------------------------------------------------------
> ComputerSystem - 04_defineStartVS.py: FAIL
> File "04_defineStartVS.py", line 67
> if cs.Name != test_dom:
> ^
> SyntaxError: invalid syntax
> --------------------------------------------------------------------
>
>> diff -r 946fd46b9686 -r db9789b5145f
>> suites/libvirt-cim/cimtest/ComputerSystem/05_activate_defined_start.py
>> ---
>> a/suites/libvirt-cim/cimtest/ComputerSystem/05_activate_defined_start.py
>> Thu Aug 28 14:07:25 2008 -0700
>> +++
>> b/suites/libvirt-cim/cimtest/ComputerSystem/05_activate_defined_start.py
>> Sun Aug 31 19:31:03 2008 -0700
>> @@ -42,8 +42,8 @@
>> # Date : 17-10-2007
>>
>> import sys
>> -from XenKvmLib import computersystem
>> from XenKvmLib import vxml
>> +from XenKvmLib.classes import get_typed_class
>> from VirtLib import utils
>> from CimTest.Globals import logger
>> from XenKvmLib.const import do_main
>> @@ -73,7 +73,8 @@
>> logger.error("ERROR: VS %s was not defined" % test_dom)
>> return status
>> - cs = computersystem.get_cs_class(options.virt)(options.ip,
>> test_dom)
>> + cs = get_typed_class(options.virt, 'ComputerSystem')\
>> + (options.ip, test_dom)
>> if cs.Name == test_dom:
>> from_State = cs.EnabledState
>> else:
>> @@ -95,7 +96,8 @@
>>
>> #Get the value of the EnabledState property and RequestedState property.
>> try:
>> - cs = computersystem.get_cs_class(options.virt)(options.ip,
>> test_dom)
>> + cs = get_typed_class(options.virt, 'ComputerSystem')\
>> + (options.ip, test_dom)
Same here - use enumclass.getInstance()
>> if cs.Name == test_dom:
>> to_RequestedState = cs.RequestedState
>> enabledState = cs.EnabledState
>>
> The tc fails with the following error
> --------------------------------------------------------------------
> ComputerSystem - 05_activate_defined_start.py: FAIL
> ERROR - Exception: 'str' object is not callable
> --------------------------------------------------------------------
>
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com
More information about the Libvirt-cim
mailing list