# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1236098860 28800
# Node ID c3a6bfa4f41b69ed75f511e199b57fa2b9afd129
# Parent 7a6fc176e1ea497b2bdb361b44da6cc5d32f923f
[TEST] Modifying HostedDependency/04_reverse_errs.py tc to use cim_define() and
cim_start(), cim_destroy().
Also, removed un necessary import statements.
Tested with Xen/XenFV for RHEL 5.3 rpm.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 7a6fc176e1ea -r c3a6bfa4f41b
suites/libvirt-cim/cimtest/HostedDependency/04_reverse_errs.py
--- a/suites/libvirt-cim/cimtest/HostedDependency/04_reverse_errs.py Tue Mar 03 08:35:58
2009 -0800
+++ b/suites/libvirt-cim/cimtest/HostedDependency/04_reverse_errs.py Tue Mar 03 08:47:40
2009 -0800
@@ -71,9 +71,12 @@ def verify_err_fields(cxml, server, conn
bug_no="")
if ret != PASS:
logger.error("--- FAILED: %s---", msg)
- cxml.destroy(server)
+ cxml.cim_destroy(server)
+ cxml.cim_undefine(server)
except Exception, details:
logger.error("Exception: %s", details)
+ cxml.cim_destroy(server)
+ cxml.cim_undefine(server)
return FAIL
return ret
@@ -89,9 +92,15 @@ def main():
else:
cxml = virtxml(test_dom, mac = test_mac)
- ret = cxml.create(server)
+ ret = cxml.cim_define(server)
if not ret:
- logger.error("Failed to Create the dom: %s", test_dom)
+ logger.error("Failed to define the dom: %s", test_dom)
+ return FAIL
+
+ status = cxml.cim_start(server)
+ if status != PASS:
+ cxml.undefine(server)
+ logger.error("Failed to start the dom: %s", test_dom)
return FAIL
conn = assoc.myWBEMConnection('http://%s' % server,
@@ -101,7 +110,8 @@ def main():
status, host_inst = get_host_info(server, virt)
if status:
logger.error("Unable to get host info")
- cxml.destroy(server)
+ cxml.cim_destroy(server)
+ cxml.undefine(server)
return status
classname = host_inst.CreationClassName
@@ -138,7 +148,9 @@ def main():
keys = { 'CreationClassName' : field, 'Name' : host_name }
ret_value = verify_err_fields(cxml, server, conn, keys, classname,
acn, msg, field, expr_values)
- cxml.destroy(server)
+ if ret_value == PASS:
+ cxml.cim_destroy(server)
+ cxml.undefine(server)
return ret_value
if __name__ == "__main__":
sys.exit(main())