
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "DomST1" -mem = 128 # MB START_STATE = 2 FINAL_STATE = 9
We can use const.CIM_ENABLE and const.CIM_PAUSE for START_STATE and FINAL_STATE respectively.
Good catch.
+ cs_class = get_typed_class(virt, 'ComputerSystem') + keys = { 'Name' : test_dom, 'CreationClassName' : cs_class } + + dom_cs = GetInstance(server, cs_class, keys) + if dom_cs.Name != test_dom: + raise Exception("Instance matching %s was not returned" % test_dom) + + if int(dom_cs.EnabledState) != int(START_STATE): + raise Exception("%s start state is %s, exp %s" % (test_dom, + dom_cs.EnabledState, START_STATE))
The below piece of code is repeated :
cs = GetInstance(options.ip, cs_class, keys) if cs.Name != test_dom: raise Exception("VS '%s' is not available" % test_dom)
if int(cs.EnabledState) != int(START_STATE): raise Exception("%s start state is %s, exp %s" % (test_dom, cs.EnabledState, START_STATE))
We can put this in a fn like check_state() , any thoughts ??
Yep, that's a good idea. I'll send a patch for this. -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com