[Libvirt-cim] [PATCH] [TEST] New test to check SwitchService provider

Sharad Mishra snmishra at us.ibm.com
Tue Mar 8 11:50:34 UTC 2011


# HG changeset patch
# User Sharad Mishra <snmishra at us.ibm.com>
# Date 1299548429 28800
# Node ID f5bc7977f2d5813474b2c56981bd93e2cf9d96b7
# Parent  4f2bf0006818d2ca4903a0b550dde65e4d581d7c
[TEST] New test to check SwitchService provider

This test enumerates SwitchService and checks to see if VSI is supported or not.

Signed-off-by: Sharad Mishra <snmishra at us.ibm.com>

diff -r 4f2bf0006818 -r f5bc7977f2d5 suites/libvirt-cim/cimtest/SwitchService/01_enum.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/SwitchService/01_enum.py	Mon Mar 07 17:40:29 2011 -0800
@@ -0,0 +1,51 @@
+#!/usr/bin/python
+#
+# Copyright 2011 IBM Corp.
+#
+# Authors:
+#    Sharad Mishra <snmishra at us.ibm.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+#
+
+import sys
+from XenKvmLib.const import do_main
+from XenKvmLib import enumclass
+from XenKvmLib.classes import get_typed_class
+from CimTest.Globals import logger
+from CimTest.ReturnCodes import XFAIL
+
+SUPPORTED_TYPES = ['Xen', 'KVM', 'XenFV']
+
+ at do_main(SUPPORTED_TYPES)
+def main():
+    options = main.options 
+
+    cs_class = get_typed_class(options.virt, 'SwitchService')
+    try:
+        cs = enumclass.EnumInstances(options.ip, cs_class)
+        print "Please check if this is the expected result ---"
+        for name in cs:
+            if name.IsVSISupported:
+                print "*** VSI supported ***"
+            else:
+                print "*** VSI NOT supported ***"
+    except Exception, detail:
+        logger.error("Exception: %s", detail)
+
+    return XFAIL
+
+if __name__ == "__main__":
+    sys.exit(main())




More information about the Libvirt-cim mailing list