[Libvirt-cim] [PATCH] [TEST] Update SystemDevice.01~03 for LXC support

yunguol at cn.ibm.com yunguol at cn.ibm.com
Tue Jun 3 06:12:33 UTC 2008


# HG changeset patch
# User Guolian Yun <yunguol at cn.ibm.com>
# Date 1212473545 -28800
# Node ID 37c9c0b22ced6e757a1342aab7e509d06247118c
# Parent  351d11163eaa0b0af28a9064177ad637aeeb2a8c
[TEST] Update SystemDevice.01~03 for LXC support

Signed-off-by: Guolian Yun <yunguol at cn.ibm.com>

diff -r 351d11163eaa -r 37c9c0b22ced suites/libvirt-cim/cimtest/SystemDevice/01_forward.py
--- a/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py	Fri May 30 10:47:26 2008 +0800
+++ b/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py	Tue Jun 03 14:12:25 2008 +0800
@@ -33,7 +33,7 @@
 from CimTest.Globals import logger, do_main
 from CimTest.ReturnCodes import PASS, FAIL
 
-sup_types = ['Xen', 'KVM', 'XenFV']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
 
 test_dom = "test_domain"
 test_mac = "00:11:22:33:44:55"
@@ -50,7 +50,10 @@
 
     status = PASS
     virt_xml = vxml.get_class(options.virt)
-    cxml = virt_xml(test_dom, vcpus = test_cpu, mac = test_mac, disk = test_disk)
+    if options.virt == "LXC":
+        cxml = virt_xml(test_dom, vcpus = test_cpu)
+    else:
+        cxml = virt_xml(test_dom, vcpus = test_cpu, mac = test_mac, disk = test_disk)
     ret = cxml.create(options.ip)
     if not ret:
         logger.error('Unable to create domain %s' % test_dom)
diff -r 351d11163eaa -r 37c9c0b22ced suites/libvirt-cim/cimtest/SystemDevice/02_reverse.py
--- a/suites/libvirt-cim/cimtest/SystemDevice/02_reverse.py	Fri May 30 10:47:26 2008 +0800
+++ b/suites/libvirt-cim/cimtest/SystemDevice/02_reverse.py	Tue Jun 03 14:12:25 2008 +0800
@@ -33,7 +33,7 @@
 from CimTest.Globals import logger, do_main
 from CimTest.ReturnCodes import PASS, FAIL 
 
-sup_types = ['Xen', 'KVM', 'XenFV']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
 
 test_dom = "test_domain"
 test_mac = "00:11:22:33:44:55"
@@ -44,10 +44,14 @@
 
     status = FAIL
     virt_xml = vxml.get_class(options.virt)
-    cxml = virt_xml(test_dom, mac=test_mac)
+    if options.virt == "LXC":
+        cxml = virt_xml(test_dom)
+        devlist = [ "Memory" ]
+    else:
+        cxml = virt_xml(test_dom, mac=test_mac)
+        devlist = [ "NetworkPort", "Memory", "LogicalDisk", "Processor" ]
     cxml.create(options.ip)
 
-    devlist = [ "NetworkPort", "Memory", "LogicalDisk", "Processor" ]
 
     key_list = ["DeviceID", "CreationClassName", "SystemName",
                 "SystemCreationClassName"]
diff -r 351d11163eaa -r 37c9c0b22ced suites/libvirt-cim/cimtest/SystemDevice/03_fwderrs.py
--- a/suites/libvirt-cim/cimtest/SystemDevice/03_fwderrs.py	Fri May 30 10:47:26 2008 +0800
+++ b/suites/libvirt-cim/cimtest/SystemDevice/03_fwderrs.py	Tue Jun 03 14:12:25 2008 +0800
@@ -40,7 +40,7 @@
 from CimTest import Globals
 from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
 
-sup_types = ['Xen', 'KVM', 'XenFV']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
 
 test_dom = "virt1"
 test_mac = "00:11:22:33:44:55"
@@ -64,15 +64,19 @@
 
     status = PASS
     virt_xml = vxml.get_class(options.virt)
-    cxml = virt_xml(test_dom, vcpus = test_cpu, mac = test_mac,
-                    disk = test_disk)
+    if options.virt == "LXC":
+        cxml = virt_xml(test_dom, vcpus = test_cpu)
+        devlist = [ "Memory" ]
+    else:
+        cxml = virt_xml(test_dom, vcpus = test_cpu, mac = test_mac,
+                        disk = test_disk)
+        devlist = [ "NetworkPort", "Memory", "LogicalDisk", "Processor" ]
 
     ret = cxml.create(options.ip)
     if not ret :
         logger.info("error while 'create' of VS")
         return FAIL
 
-    devlist = [ "NetworkPort", "Memory", "LogicalDisk", "Processor" ]
 
     # Building the dict for avoiding the correct key:val pairs 
     # while verifying with the Invalid values for the association
diff -r 351d11163eaa -r 37c9c0b22ced suites/libvirt-cim/lib/XenKvmLib/devices.py
--- a/suites/libvirt-cim/lib/XenKvmLib/devices.py	Fri May 30 10:47:26 2008 +0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/devices.py	Tue Jun 03 14:12:25 2008 +0800
@@ -75,10 +75,16 @@
 class KVM_LogicalDisk(CIM_LogicalDisk):
     pass
 
+class LXC_LogicalDisk(CIM_LogicalDisk):
+    pass
+
 class Xen_NetworkPort(CIM_NetworkPort):
     pass
 
 class KVM_NetworkPort(CIM_NetworkPort):
+    pass
+
+class LXC_NetworkPort(CIM_NetworkPort):
     pass
 
 class Xen_Memory(CIM_Memory):
@@ -94,6 +100,9 @@
     pass
 
 class KVM_Processor(CIM_Processor):
+    pass
+
+class LXC_Processor(CIM_Processor):
     pass
 
 def get_class(classname):




More information about the Libvirt-cim mailing list