# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1208863320 -19800
# Node ID 9b46a2dcbecd8a7c00a12a667b6530a629c280da
# Parent 1369fdc3f3a9f10207a3b2e1966e6908c1af3fb8
[TEST] Adding XenFV and KVM support to 01_enum of VSSD
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 1369fdc3f3a9 -r 9b46a2dcbecd suites/libvirt-cim/cimtest/VSSD/01_enum.py
--- a/suites/libvirt-cim/cimtest/VSSD/01_enum.py Tue Apr 22 15:20:16 2008 +0530
+++ b/suites/libvirt-cim/cimtest/VSSD/01_enum.py Tue Apr 22 16:52:00 2008 +0530
@@ -28,40 +28,42 @@
import sys
from VirtLib import live
-from VirtLib import utils
from XenKvmLib import enumclass
from XenKvmLib.test_doms import destroy_and_undefine_all
-from XenKvmLib.vxml import XenXML, KVMXML, get_class
-from CimTest.Globals import do_main
-from CimTest.Globals import logger
+from XenKvmLib.vxml import get_class
+from CimTest.Globals import do_main, platform_sup
+from CimTest.Globals import log_param, logger
+from CimTest.ReturnCodes import PASS, FAIL
-sup_types = ['Xen', 'KVM']
+test_dom = "VSSD_dom"
-test_dom = "new"
-
-@do_main(sup_types)
+@do_main(platform_sup)
def main():
options = main.options
- status = 0
+ log_param()
+ status = PASS
destroy_and_undefine_all(options.ip)
vsxml = get_class(options.virt)(test_dom)
ret = vsxml.define(options.ip)
if not ret :
logger.error("error while create of VS")
- status = 1
+ status = FAIL
try:
live_cs = live.domain_list(options.ip, options.virt)
key_list = ["InstanceID"]
syslst = enumclass.enumerate(options.ip, \
"VirtualSystemSettingData", \
- key_list, \
- options.virt)
+ key_list, \
+ options.virt)
found = 0
for vssd in syslst :
- instid = "%s:%s" % (options.virt, test_dom)
+ if options.virt == 'XenFV':
+ instid = "%s:%s" % ('Xen', test_dom)
+ else:
+ instid = "%s:%s" % (options.virt, test_dom)
if vssd.InstanceID == instid:
found = 1
break
@@ -69,8 +71,8 @@ def main():
if vssd.ElementName != test_dom:
logger.error("Invalid ElementName- expecting %s, go %s" %
test_dom, vssd.ElementName)
- test_domain_function(test_dom, options.ip, "undefine")
- return 1
+ vsxml.undefine(options.ip)
+ return FAIL
logger.info("Examining VSSD class for the Guest %s" % test_dom)
try:
@@ -81,15 +83,15 @@ def main():
logger.error("Exception %s" % details)
logger.error("Provider reports VSSD `%s', but xm does not"
%
vssd.ElementName)
- status = 1
+ status = FAIL
else:
logger.error("Missing VSSD instance for the system %s " %
test_dom)
- status = 1
+ status = FAIL
except BaseException, details:
logger.error("Exception %s" % details)
- status = 1
+ status = FAIL
vsxml.undefine(options.ip)