# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1207834470 -19800
# Node ID 0e7eb39ed839e03d1dd2635157f19e5acdc4c9be
# Parent 1f4926b238908ff7f4c6610fde37490492ba559c
[TEST] Fixing the 04_defineStartVS.py tc failure.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 1f4926b23890 -r 0e7eb39ed839
suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Thu Apr 10 18:57:34
2008 +0530
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Thu Apr 10 19:04:30
2008 +0530
@@ -6,6 +6,7 @@
# Kaitlin Rupert <karupert(a)us.ibm.com>
# Veerendra Chandrappa <vechandr(a)in.ibm.com>
# Zhengang Li <lizg(a)cn.ibm.com>
+# Deepti B. kalakeri <deeptik(a)linux.vnet.ibm.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
@@ -28,10 +29,11 @@
# 10-Oct-2007
import sys
+from time import sleep
from XenKvmLib import vxml
from XenKvmLib import computersystem
-from VirtLib import utils
from CimTest import Globals
+from XenKvmLib.classes import get_typed_class
from CimTest.Globals import do_main
from CimTest.ReturnCodes import PASS, FAIL
@@ -53,18 +55,21 @@ def main():
Globals.logger.error("Failed to Start the dom: %s", test_dom)
cxml.undefine(options.ip)
return status
-
+
+ timeout = 10
try:
- cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom)
-
- if cs.Name == test_dom:
- enabState = cs.EnabledState
- else:
- Globals.logger.error("VS %s is not defined" % test_dom)
-
- # Success: VS is in Enabled State after Define and Start
- if enabState == 2:
- status = PASS
+ # Need to poll for XenFV, since enabState is not getting set otherwise.
+ for i in range(1, (timeout + 1)):
+ sleep(1)
+ cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom)
+ if cs.Name == test_dom:
+ enabState = cs.EnabledState
+ else:
+ Globals.logger.error("VS %s is not defined" % test_dom)
+ # Success: VS is in Enabled State after Define and Start
+ if enabState == 2:
+ status = PASS
+ break
except Exception, detail:
Globals.logger.error(Globals.CIM_ERROR_GETINSTANCE,