[Libvirt-cim] [PATCH] [TEST] Update vxml.py to support input/graphics, also update SystemDevice[01_forward.py]

yunguol at cn.ibm.com yunguol at cn.ibm.com
Tue Dec 9 05:31:38 UTC 2008


# HG changeset patch
# User Guolian Yun <yunguol at cn.ibm.com>
# Date 1228800691 28800
# Node ID 7db927b03b2fc035b89092d40342d4117e4f28fa
# Parent  b12c6c2772b7b5540f06d32cdaa9c99a8bf4fb9d
[TEST] Update vxml.py to support input/graphics, also update SystemDevice[01_forward.py]

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

diff -r b12c6c2772b7 -r 7db927b03b2f suites/libvirt-cim/cimtest/SystemDevice/01_forward.py
--- a/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py	Sun Dec 07 23:50:29 2008 -0800
+++ b/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py	Mon Dec 08 21:31:31 2008 -0800
@@ -32,10 +32,11 @@
 from XenKvmLib import vxml
 from XenKvmLib.classes import get_typed_class
 from CimTest.Globals import logger
-from XenKvmLib.const import do_main
+from XenKvmLib.const import do_main, get_provider_version
 from CimTest.ReturnCodes import PASS, FAIL
 
 sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
+input_graphics_pool_rev = 757
 
 test_dom = "test_domain"
 test_mac = "00:11:22:33:44:55"
@@ -93,6 +94,14 @@
         exp_pllist[net_cn]  = ['%s/%s' % (test_dom, test_mac)]
         exp_pllist[disk_cn] = [ '%s/%s' % (test_dom, test_disk)]
 
+        curr_cim_rev, changeset = get_provider_version(virt, server)
+        if curr_cim_rev >= input_graphics_pool_rev:
+            input_cn = get_typed_class(virt, "PointingDevice")
+            graphics_cn = get_typed_class(virt, "DisplayController")
+            exp_pllist[input_cn] = ['%s/mouse:ps2' % test_dom]
+            exp_pllist[graphics_cn] = ['%s/graphics' % test_dom]
+
+ 
     try:
         res_pllist = {}
         for items in devs: 
diff -r b12c6c2772b7 -r 7db927b03b2f suites/libvirt-cim/lib/XenKvmLib/vxml.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py	Sun Dec 07 23:50:29 2008 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py	Mon Dec 08 21:31:31 2008 -0800
@@ -663,6 +663,10 @@
         self.add_sub_node(disk, 'source', file=disk_img)
         self.add_sub_node(disk, 'target', dev=disk_dev)
         self.set_interface_details(devices, net_mac, net_type, net_name, 'Xen')
+        self.add_sub_node(devices, 'input', type='mouse', bus='xen')
+        self.add_sub_node(devices, 'graphics', type='vnc', port='5900',
+                          keymap='en-us')
+
 
     def set_bootloader(self, ip, gtype=0):
         bldr = bootloader(ip, gtype)
@@ -713,6 +717,9 @@
         disk = self.add_sub_node(devices, 'disk', type='file', device='disk')
         self.add_sub_node(disk, 'source', file=disk_img)
         self.add_sub_node(disk, 'target', dev=disk_dev)
+        self.add_sub_node(devices, 'input', type='mouse', bus='ps2')
+        self.add_sub_node(devices, 'graphics', type='vnc', port='5900',
+                          keymap='en-us')
 
         self.set_interface_details(devices, net_mac, net_type, net_name, 'KVM')
 




More information about the Libvirt-cim mailing list