[PATCH] [TEST] Fixing 40_RSC_start.py tc

# HG changeset patch # User Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> # Date 1213872100 25200 # Node ID aca3e392c2b66f0a50af5c417c819b8e669abd72 # Parent f67381970add8e02ecd3ebbdc600f397c7fa51fe [TEST] Fixing 40_RSC_start.py tc. Signed-off-by: Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> diff -r f67381970add -r aca3e392c2b6 suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Thu Jun 19 02:35:43 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Thu Jun 19 03:41:40 2008 -0700 @@ -44,6 +44,7 @@ from CimTest.ReturnCodes import PASS, FA sup_types = ['Xen', 'KVM', 'XenFV'] bug = "00001" +bug_req_state = "00002" default_dom = 'test_domain' REQUESTED_STATE = 2 @@ -52,7 +53,7 @@ def check_attributes(domain_name, ip, vi def check_attributes(domain_name, ip, virt): rc, cs = get_cs_instance(domain_name, ip, virt) if rc != 0: - return rc + return rc if cs.RequestedState != REQUESTED_STATE: logger.error("RequestedState should be %d not %d", @@ -69,30 +70,33 @@ def check_attributes(domain_name, ip, vi @do_main(sup_types) def main(): options = main.options - status = PASS + status = FAIL try: rc = create_using_definesystem(default_dom, options.ip, virt=options.virt) if rc != 0: - raise Exception("Unable create domain %s using DefineSystem()", + raise Exception("DefineSystem() failed to create domain:", default_dom) rc = call_request_state_change(default_dom, options.ip, REQUESTED_STATE, TIME, options.virt) if rc != 0: - rc = XFAIL_RC(bug) - raise Exception("Unable start dom %s using RequestedStateChange()", - default_dom) + status = XFAIL_RC(bug) + raise Exception("RequestedStateChange() could not be used to start " + "domain:", default_dom) + rc = check_attributes(default_dom, options.ip, options.virt) if rc != 0: - raise Exception("Attributes for %s not set as expected.", + status = XFAIL_RC(bug_req_state) + raise Exception("Attributes were not set as expected for domain:", default_dom) + else: + status = PASS except Exception, detail: logger.error("Exception: %s", detail) - status = FAIL undefine_test_domain(default_dom, options.ip, options.virt)

if rc != 0: - rc = XFAIL_RC(bug) - raise Exception("Unable start dom %s using RequestedStateChange()", - default_dom) + status = XFAIL_RC(bug) + raise Exception("RequestedStateChange() could not be used to start " + "domain:", default_dom) +
I know this was originally in the code (and my mistake too, I believe), but can you fix the strings the the raise call to use %s instead of a comma: raise Exception("RequestedStateChange() could not be used to start " "domain: %s" % default_dom) As the code is now, it prints like: ('RequestedStateChange() could not be used to start domain:', 'test_domain') This isn't bad, but the following is cleaner: ('RequestedStateChange() could not be used to start domain: test_domain') Thanks! -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com
participants (2)
-
Deepti B. Kalakeri
-
Kaitlin Rupert