[PATCH] [TEST] Move some functions from live.py and utils.py to xm_virt_util.py
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1225865149 28800
# Node ID 79b321ebebfda4cde38ecb4fe0ea7bd9e4f51539
# Parent 319e2e9509d360334c0e38e17abc9bf2b163e1cb
[TEST] Move some functions from live.py and utils.py to xm_virt_util.py
The moved functions are:
processors_count()
memory_count()
network_macs()
run_remote_guest()
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 319e2e9509d3 -r 79b321ebebfd lib/VirtLib/live.py
--- a/lib/VirtLib/live.py Tue Nov 04 05:22:21 2008 -0800
+++ b/lib/VirtLib/live.py Tue Nov 04 22:05:49 2008 -0800
@@ -25,59 +25,6 @@
import os
import utils
import socket
-
-def processors_count(ip, vs_name):
- """Returns the number of processors of the specified VS
- """
-
- guest_cmd = "grep '^$' /proc/cpuinfo | wc -l"
-
- rc, out = utils.run_remote_guest(ip, vs_name, guest_cmd)
- if rc != 0:
- return -1
-
- try:
- cpus = int(out)
- return cpus
- except ValueError:
- return -1
-
-def memory_count(ip, vs_name):
- """Returns the memory size (in Bytes) of the specified VS.
- """
-
- guest_cmd = "grep MemTotal /proc/meminfo"
-
- rc, out = utils.run_remote_guest(ip, vs_name, guest_cmd)
- if rc != 0:
- return -1
-
- try:
- mem = int( out.split()[1] )
- return mem * 1024
- except (IndexError, ValueError):
- return -1
-
-def network_macs(ip, vs_name):
- """Returns a list of MAC address of the specified VS.
- """
-
- guest_cmd = "ifconfig -a | grep eth"
-
- rc, out = utils.run_remote_guest(ip, vs_name, guest_cmd)
- if rc != 0:
- return []
-
- ret = []
- lines = out.splitlines()
- for l in lines:
- try:
- mac = l.split()[-1]
- ret.append( mac )
- except IndexError:
- pass
-
- return ret
def available_bridges(ip):
"""Return a list of the available bridges in the running dom0.
diff -r 319e2e9509d3 -r 79b321ebebfd lib/VirtLib/utils.py
--- a/lib/VirtLib/utils.py Tue Nov 04 05:22:21 2008 -0800
+++ b/lib/VirtLib/utils.py Tue Nov 04 22:05:49 2008 -0800
@@ -103,11 +103,3 @@
cmd = 'ssh-keygen -y -f %s' % SSH_KEY
pubkey = commands.getoutput(cmd)
write_pubkey(pubkey)
-
-def run_remote_guest(ip, domain, command):
- """ Execute commands on remote guest console.
- """
-
- cmd = 'python %s %s "%s"' % (CONSOLE_APP_PATH, domain, command)
-
- return run_remote(ip, cmd)
diff -r 319e2e9509d3 -r 79b321ebebfd suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Tue Nov 04 05:22:21 2008 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Tue Nov 04 22:05:49 2008 -0800
@@ -287,3 +287,65 @@
if virt == "LXC":
return "lxc:///system"
return ""
+
+def run_remote_guest(ip, domain, command):
+ """ Execute commands on remote guest console.
+ """
+
+ cmd = 'python %s %s "%s"' % (CONSOLE_APP_PATH, domain, command)
+
+ return run_remote(ip, cmd)
+
+def processors_count(ip, vs_name):
+ """Returns the number of processors of the specified VS
+ """
+
+ guest_cmd = "grep '^$' /proc/cpuinfo | wc -l"
+
+ rc, out = run_remote_guest(ip, vs_name, guest_cmd)
+ if rc != 0:
+ return -1
+
+ try:
+ cpus = int(out)
+ return cpus
+ except ValueError:
+ return -1
+
+def memory_count(ip, vs_name):
+ """Returns the memory size (in Bytes) of the specified VS.
+ """
+
+ guest_cmd = "grep MemTotal /proc/meminfo"
+
+ rc, out = run_remote_guest(ip, vs_name, guest_cmd)
+ if rc != 0:
+ return -1
+
+ try:
+ mem = int( out.split()[1] )
+ return mem * 1024
+ except (IndexError, ValueError):
+ return -1
+
+def network_macs(ip, vs_name):
+ """Returns a list of MAC address of the specified VS.
+ """
+
+ guest_cmd = "ifconfig -a | grep eth"
+
+ rc, out = run_remote_guest(ip, vs_name, guest_cmd)
+ if rc != 0:
+ return []
+
+ ret = []
+ lines = out.splitlines()
+ for l in lines:
+ try:
+ mac = l.split()[-1]
+ ret.append( mac )
+ except IndexError:
+ pass
+
+ return ret
+
16 years
[PATCH] Add KVMRedirectionSAP header to noinst_HEADERS list
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1225833046 28800
# Node ID 29c875cab8b808655c04d2f971c0d6c9a9f03dbd
# Parent 1e1954312a8adb776cc62703d3363fe7f82c0069
Add KVMRedirectionSAP header to noinst_HEADERS list.
Without this, building an rpm fails.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 1e1954312a8a -r 29c875cab8b8 src/Makefile.am
--- a/src/Makefile.am Fri Oct 31 13:06:10 2008 -0700
+++ b/src/Makefile.am Tue Nov 04 13:10:46 2008 -0800
@@ -22,7 +22,8 @@
Virt_VirtualSystemSnapshotServiceCapabilities.h \
Virt_VSMigrationSettingData.h \
Virt_ConsoleRedirectionService.h \
- Virt_ConsoleRedirectionServiceCapabilities.h
+ Virt_ConsoleRedirectionServiceCapabilities.h \
+ Virt_KVMRedirectionSAP.h
XKUADD = $(top_builddir)/libxkutil/libxkutil.la
16 years
KVM on Pegasus Test Run Summary for Nov 05 2008 [ F9 rpm ]
by Deepti B Kalakeri
=================================================
KVM on Pegasus Test Run Summary for Nov 05 2008
=================================================
Distro: Fedora release 9 (Sulphur)
Kernel: 2.6.25.14-108.fc9.x86_64
libvirt: 0.4.4
Hypervisor: QEMU 0.9.1
CIMOM: Pegasus 2.7.0
Libvirt-cim revision: 712
Libvirt-cim changeset: 668097d4b27c
Cimtest revision: 475
Cimtest changeset: 319e2e9509d3
=================================================
FAIL : 3
XFAIL : 2
SKIP : 6
PASS : 128
-----------------
Total : 139
=================================================
FAIL Test Summary:
SystemDevice - 01_forward.py: FAIL
VirtualSystemManagementService - 09_procrasd_persist.py: FAIL
VirtualSystemManagementService - 15_mod_system_settings.py: FAIL
=================================================
XFAIL Test Summary:
ComputerSystem - 32_start_reboot.py: XFAIL
ComputerSystem - 33_suspend_reboot.py: XFAIL
=================================================
SKIP Test Summary:
ComputerSystem - 02_nosystems.py: SKIP
LogicalDisk - 02_nodevs.py: SKIP
VSSD - 02_bootldr.py: SKIP
VirtualSystemMigrationService - 01_migratable_host.py: SKIP
VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP
VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP
=================================================
Full report:
--------------------------------------------------------------------
AllocationCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
AllocationCapabilities - 02_alloccap_gi_errs.py: PASS
--------------------------------------------------------------------
ComputerSystem - 01_enum.py: PASS
--------------------------------------------------------------------
ComputerSystem - 02_nosystems.py: SKIP
ERROR - System has defined domains; unable to run
--------------------------------------------------------------------
ComputerSystem - 03_defineVS.py: PASS
--------------------------------------------------------------------
ComputerSystem - 04_defineStartVS.py: PASS
--------------------------------------------------------------------
ComputerSystem - 05_activate_defined_start.py: PASS
--------------------------------------------------------------------
ComputerSystem - 06_paused_active_suspend.py: PASS
--------------------------------------------------------------------
ComputerSystem - 22_define_suspend.py: PASS
--------------------------------------------------------------------
ComputerSystem - 23_suspend_suspend.py: PASS
--------------------------------------------------------------------
ComputerSystem - 27_define_suspend_errs.py: PASS
--------------------------------------------------------------------
ComputerSystem - 32_start_reboot.py: XFAIL
ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain Operation Failed')
ERROR - Unable to 'Reboot' dom 'cs_test_domain' using RequestedStateChange()
InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain Operation Failed
Bug:<00005>
--------------------------------------------------------------------
ComputerSystem - 33_suspend_reboot.py: XFAIL
ERROR - Exception: (1, u'CIM_ERR_FAILED: Domain Operation Failed')
ERROR - Unable to 'Reboot' dom 'test_domain' using RequestedStateChange()
InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain Operation Failed
Bug:<00005>
--------------------------------------------------------------------
ComputerSystem - 35_start_reset.py: PASS
--------------------------------------------------------------------
ComputerSystem - 40_RSC_start.py: PASS
--------------------------------------------------------------------
ComputerSystem - 41_cs_to_settingdefinestate.py: PASS
--------------------------------------------------------------------
ComputerSystem - 42_cs_gi_errs.py: PASS
--------------------------------------------------------------------
ComputerSystemIndication - 01_created_indication.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 01_forward.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 02_reverse.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 03_reverse_errs.py: PASS
--------------------------------------------------------------------
ElementAllocatedFromPool - 04_forward_errs.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 01_forward.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 02_reverse.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 03_forward_errs.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
ElementCapabilities - 05_hostsystem_cap.py: PASS
--------------------------------------------------------------------
ElementConforms - 01_forward.py: PASS
--------------------------------------------------------------------
ElementConforms - 02_reverse.py: PASS
--------------------------------------------------------------------
ElementConforms - 03_ectp_fwd_errs.py: PASS
--------------------------------------------------------------------
ElementConforms - 04_ectp_rev_errs.py: PASS
--------------------------------------------------------------------
ElementSettingData - 01_forward.py: PASS
--------------------------------------------------------------------
ElementSettingData - 03_esd_assoc_with_rasd_errs.py: PASS
--------------------------------------------------------------------
EnabledLogicalElementCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS
--------------------------------------------------------------------
HostSystem - 01_enum.py: PASS
--------------------------------------------------------------------
HostSystem - 02_hostsystem_to_rasd.py: PASS
--------------------------------------------------------------------
HostSystem - 03_hs_to_settdefcap.py: PASS
--------------------------------------------------------------------
HostSystem - 04_hs_to_EAPF.py: PASS
--------------------------------------------------------------------
HostSystem - 05_hs_gi_errs.py: PASS
--------------------------------------------------------------------
HostSystem - 06_hs_to_vsms.py: PASS
--------------------------------------------------------------------
HostedDependency - 01_forward.py: PASS
--------------------------------------------------------------------
HostedDependency - 02_reverse.py: PASS
--------------------------------------------------------------------
HostedDependency - 03_enabledstate.py: PASS
--------------------------------------------------------------------
HostedDependency - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
HostedResourcePool - 01_forward.py: PASS
--------------------------------------------------------------------
HostedResourcePool - 02_reverse.py: PASS
--------------------------------------------------------------------
HostedResourcePool - 03_forward_errs.py: PASS
--------------------------------------------------------------------
HostedResourcePool - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
HostedService - 01_forward.py: PASS
--------------------------------------------------------------------
HostedService - 02_reverse.py: PASS
--------------------------------------------------------------------
HostedService - 03_forward_errs.py: PASS
--------------------------------------------------------------------
HostedService - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
LogicalDisk - 01_disk.py: PASS
--------------------------------------------------------------------
LogicalDisk - 02_nodevs.py: SKIP
ERROR - System has defined domains; unable to run
--------------------------------------------------------------------
LogicalDisk - 03_ld_gi_errs.py: PASS
--------------------------------------------------------------------
Memory - 01_memory.py: PASS
--------------------------------------------------------------------
Memory - 02_defgetmem.py: PASS
--------------------------------------------------------------------
Memory - 03_mem_gi_errs.py: PASS
--------------------------------------------------------------------
NetworkPort - 01_netport.py: PASS
--------------------------------------------------------------------
NetworkPort - 02_np_gi_errors.py: PASS
--------------------------------------------------------------------
NetworkPort - 03_user_netport.py: PASS
--------------------------------------------------------------------
Processor - 01_processor.py: PASS
--------------------------------------------------------------------
Processor - 02_definesys_get_procs.py: PASS
--------------------------------------------------------------------
Processor - 03_proc_gi_errs.py: PASS
--------------------------------------------------------------------
Profile - 01_enum.py: PASS
--------------------------------------------------------------------
Profile - 02_profile_to_elec.py: PASS
--------------------------------------------------------------------
Profile - 03_rprofile_gi_errs.py: PASS
--------------------------------------------------------------------
RASD - 01_verify_rasd_fields.py: PASS
--------------------------------------------------------------------
RASD - 02_enum.py: PASS
--------------------------------------------------------------------
RASD - 03_rasd_errs.py: PASS
--------------------------------------------------------------------
RASD - 04_disk_rasd_size.py: PASS
--------------------------------------------------------------------
RedirectionService - 01_enum_crs.py: PASS
--------------------------------------------------------------------
RedirectionService - 02_enum_crscap.py: PASS
--------------------------------------------------------------------
ReferencedProfile - 01_verify_refprof.py: PASS
--------------------------------------------------------------------
ReferencedProfile - 02_refprofile_errs.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 01_forward.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 02_reverse.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 03_forward_errs.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 04_reverse_errs.py: PASS
--------------------------------------------------------------------
ResourceAllocationFromPool - 05_RAPF_err.py: PASS
--------------------------------------------------------------------
ResourcePool - 01_enum.py: PASS
--------------------------------------------------------------------
ResourcePool - 02_rp_gi_errors.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationCapabilities - 02_rpcc_gi_errs.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 01_enum.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 02_rcps_gi_errors.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 03_CreateResourcePool.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: PASS
--------------------------------------------------------------------
ResourcePoolConfigurationService - 07_DeleteResourcePool.py: PASS
--------------------------------------------------------------------
SettingsDefine - 01_forward.py: PASS
--------------------------------------------------------------------
SettingsDefine - 02_reverse.py: PASS
--------------------------------------------------------------------
SettingsDefine - 03_sds_fwd_errs.py: PASS
--------------------------------------------------------------------
SettingsDefine - 04_sds_rev_errs.py: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 01_forward.py: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 03_forward_errs.py: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 04_forward_vsmsdata.py: PASS
--------------------------------------------------------------------
SettingsDefineCapabilities - 05_reverse_vsmcap.py: PASS
--------------------------------------------------------------------
SystemDevice - 01_forward.py: FAIL
ERROR - NameError : name 'KVM_NetworkPort' is not defined
Traceback (most recent call last):
File "./lib/XenKvmLib/const.py", line 116, in do_try
File "01_forward.py", line 92, in main
device = devices.device_of(options.ip, key_list)
File "./lib/XenKvmLib/devices.py", line 48, in device_of
File "<string>", line 1, in <module>
NameError: name 'KVM_NetworkPort' is not defined
ERROR - None
--------------------------------------------------------------------
SystemDevice - 02_reverse.py: PASS
--------------------------------------------------------------------
SystemDevice - 03_fwderrs.py: PASS
--------------------------------------------------------------------
VSSD - 01_enum.py: PASS
--------------------------------------------------------------------
VSSD - 02_bootldr.py: SKIP
--------------------------------------------------------------------
VSSD - 03_vssd_gi_errs.py: PASS
--------------------------------------------------------------------
VSSD - 04_vssd_to_rasd.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 01_definesystem_name.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 02_destroysystem.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 03_definesystem_ess.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 04_definesystem_ers.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 05_destroysystem_neg.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 06_addresource.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 07_addresource_neg.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 08_modifyresource.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 09_procrasd_persist.py: FAIL
ERROR - Exception: details (1, u"CIM_ERR_FAILED: ResourceSettings Error: Missing `VirtualQuantity' field in Processor RASD")
InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Missing `VirtualQuantity' field in Processor RASD
--------------------------------------------------------------------
VirtualSystemManagementService - 10_hv_version.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 11_define_memrasdunits.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 12_referenced_config.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 13_refconfig_additional_devs.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 14_define_sys_disk.py: PASS
--------------------------------------------------------------------
VirtualSystemManagementService - 15_mod_system_settings.py: FAIL
ERROR - rstest_domain not updated properly.
ERROR - Exp AutomaticRecoveryAction=3, got 2
--------------------------------------------------------------------
VirtualSystemMigrationCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationCapabilities - 02_vsmc_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationService - 01_migratable_host.py: SKIP
--------------------------------------------------------------------
VirtualSystemMigrationService - 02_host_migrate_type.py: SKIP
--------------------------------------------------------------------
VirtualSystemMigrationService - 05_migratable_host_errs.py: SKIP
--------------------------------------------------------------------
VirtualSystemMigrationSettingData - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemMigrationSettingData - 02_vsmsd_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemSettingDataComponent - 01_forward.py: PASS
--------------------------------------------------------------------
VirtualSystemSettingDataComponent - 02_reverse.py: PASS
--------------------------------------------------------------------
VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemSnapshotService - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS
--------------------------------------------------------------------
VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS
--------------------------------------------------------------------
VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS
--------------------------------------------------------------------
Thanks and Regards,
Deepti.
16 years
[PATCH] [TEST] Fixing 09_procrasd_persist.py of VSMS
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1225880784 28800
# Node ID b1d7f871c2553a461600ef7f82cc8fd931e11551
# Parent 319e2e9509d360334c0e38e17abc9bf2b163e1cb
[TEST] Fixing 09_procrasd_persist.py of VSMS.
The tc was failing bcs of the changes made to ProcResourceAllocationSettingData of vsms.py
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 319e2e9509d3 -r b1d7f871c255 suites/libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py Tue Nov 04 05:22:21 2008 -0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py Wed Nov 05 02:26:24 2008 -0800
@@ -47,7 +47,7 @@
vssd, rasd = vsms.default_vssd_rasd_str(default_dom, virt=vtype)
class_pasd = vsms.get_pasd_class(vtype)
- proc_inst = class_pasd(nvcpu, default_dom, weight, limit)
+ proc_inst = class_pasd(default_dom, nvcpu, weight, limit)
proc_mof = proc_inst.mof()
for i in range(len(rasd)):
16 years
[PATCH] [TEST] #3 Fixing 01_forward.py tc of SystemDevice
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1225873834 28800
# Node ID 0814061c13e22cdfa552a2e7e578fb717195e26c
# Parent 319e2e9509d360334c0e38e17abc9bf2b163e1cb
[TEST] #3 Fixing 01_forward.py tc of SystemDevice.
changes form patch2:
--------------------
Modified the for loop.
The test needs to be updated with cim_define().
Tested on KVM, LXC and Xen with current sources and F9 rpm.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 319e2e9509d3 -r 0814061c13e2 suites/libvirt-cim/cimtest/SystemDevice/01_forward.py
--- a/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py Tue Nov 04 05:22:21 2008 -0800
+++ b/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py Wed Nov 05 00:30:34 2008 -0800
@@ -8,6 +8,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
@@ -25,10 +26,10 @@
#
import sys
+from sets import Set
from VirtLib import utils
from XenKvmLib import assoc
from XenKvmLib import vxml
-from XenKvmLib import devices
from XenKvmLib.classes import get_typed_class
from CimTest.Globals import logger
from XenKvmLib.const import do_main
@@ -38,72 +39,88 @@
test_dom = "test_domain"
test_mac = "00:11:22:33:44:55"
-test_cpu = 1
+test_cpu = 3
@do_main(sup_types)
def main():
- options= main.options
-
- if options.virt == 'Xen':
+ options = main.options
+ server = options.ip
+ virt = options.virt
+
+ if virt == 'Xen':
test_disk = 'xvdb'
else:
test_disk = 'hdb'
status = PASS
- virt_xml = vxml.get_class(options.virt)
- if options.virt == 'LXC':
- cxml = virt_xml(test_dom)
+ virt_xml = vxml.get_class(virt)
+ if virt == 'LXC':
+ cxml = virt_xml(test_dom, vcpus = test_cpu, mac = test_mac)
else:
- cxml = virt_xml(test_dom, vcpus = test_cpu, mac = test_mac, disk = test_disk)
- ret = cxml.create(options.ip)
+ cxml = virt_xml(test_dom, vcpus = test_cpu, mac = test_mac,
+ disk = test_disk)
+
+ ret = cxml.create(server)
if not ret:
logger.error('Unable to create domain %s' % test_dom)
return FAIL
- sd_classname = get_typed_class(options.virt, 'SystemDevice')
- cs_classname = get_typed_class(options.virt, 'ComputerSystem')
+ sd_classname = get_typed_class(virt, 'SystemDevice')
+ cs_classname = get_typed_class(virt, 'ComputerSystem')
- devs = assoc.AssociatorNames(options.ip, sd_classname, cs_classname,
+ devs = assoc.AssociatorNames(server, sd_classname, cs_classname,
Name=test_dom, CreationClassName=cs_classname)
if devs == None:
- logger.error("System association failed")
- return FAIL
- elif len(devs) == 0:
- logger.error("No devices returned")
+ logger.error("'%s' association failed", sd_classname)
+ cxml.destroy(server)
return FAIL
- cn_devid = {
- get_typed_class(options.virt, "NetworkPort") : '%s/%s' % (test_dom, test_mac),
- get_typed_class(options.virt, "Memory") : '%s/mem' % test_dom,
- get_typed_class(options.virt, "LogicalDisk") : '%s/%s' % (test_dom, test_disk),
- get_typed_class(options.virt, "Processor") : '%s/%s' % (test_dom, test_cpu-1)
- }
+ if len(devs) == 0:
+ logger.error("No devices returned")
+ cxml.destroy(server)
+ return FAIL
- key_list = {'DeviceID' : '',
- 'CreationClassName' : '',
- 'SystemName' : test_dom,
- 'SystemCreationClassname' : cs_classname
- }
-
- for dev_cn in cn_devid.keys():
- for dev in devs:
- key_list['CreationClassName'] = dev['CreationClassname']
- key_list['DeviceID'] = dev['DeviceID']
- device = devices.device_of(options.ip, key_list)
- if device.CreationClassName != dev_cn:
- continue
- devid = device.DeviceID
+ mem_cn = get_typed_class(virt, "Memory")
+ exp_pllist = { mem_cn : ['%s/mem' % test_dom] }
+ proc_cn = get_typed_class(virt, "Processor")
+ exp_pllist[proc_cn] = []
+ for i in range(test_cpu):
+ exp_pllist[proc_cn].append( '%s/%s' % (test_dom, i))
- _devid = cn_devid[dev_cn]
- if devid != _devid:
- logger.error("DeviceID `%s` != `%s'" % (devid, _devid))
- status = FAIL
- else:
- logger.info("Examined %s" % _devid)
-
- cxml.destroy(options.ip)
- cxml.undefine(options.ip)
+ if virt != 'LXC':
+ net_cn = get_typed_class(virt, "NetworkPort")
+ disk_cn = get_typed_class(virt, "LogicalDisk")
+ exp_pllist[net_cn] = ['%s/%s' % (test_dom, test_mac)]
+ exp_pllist[disk_cn] = [ '%s/%s' % (test_dom, test_disk)]
+ try:
+ res_pllist = {}
+ for items in devs:
+ if items.classname in res_pllist.keys():
+ res_pllist[items.classname].append(items['DeviceID'])
+ else:
+ res_pllist[items.classname] = [items['DeviceID']]
+
+ #Verifying we get all the expected device class info
+ if Set(exp_pllist.keys()) != Set(res_pllist.keys()):
+ logger.error("Device Class mismatch")
+ raise Exception("Expected Device class list: %s \n \t Got: %s"
+ % (sorted(exp_pllist.keys()),
+ sorted(res_pllist.keys())))
+
+ #Verifying that we get only the expected deviceid
+ #for every device class
+ for key in exp_pllist.keys():
+ if Set(exp_pllist[key]) != Set(res_pllist[key]):
+ logger.error("DeviceID mismatch")
+ raise Exception("Expected DeviceID: %s \n \t Got: %s"
+ % (sorted(exp_pllist[key]),
+ sorted(res_pllist[key])))
+ except Exception, details:
+ logger.error("Exception %s", details)
+ status = FAIL
+
+ cxml.destroy(server)
return status
if __name__ == "__main__":
16 years
[PATCH] [TEST] Updating 01_forward.py tc of SettingsDefineCapabilities
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1225865973 28800
# Node ID f0c349a1321c590b172b3ecaa279e5d0c2f0b26d
# Parent f5a2c1cc3df0bc76fbdcefad05c2254669a42428
[TEST] Updating 01_forward.py tc of SettingsDefineCapabilities.
This modification is required for libvirt-cim providers which does not include
the properties of template RASDs changes.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r f5a2c1cc3df0 -r f0c349a1321c suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py
--- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Tue Nov 04 22:09:41 2008 -0800
+++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Tue Nov 04 22:19:33 2008 -0800
@@ -63,8 +63,10 @@ from XenKvmLib.const import do_main, def
from XenKvmLib.const import do_main, default_pool_name, default_network_name
from XenKvmLib.classes import get_typed_class
from XenKvmLib.common_util import print_field_error
+from XenKvmLib.const import get_provider_version
platform_sup = ['Xen', 'KVM', 'XenFV', 'LXC']
+libvirt_rasd_template_changes = 707
memid = "MemoryPool/0"
procid = "ProcessorPool/0"
@@ -168,7 +170,9 @@ def verify_sdc_with_ac(virt, server, poo
assoc_info = assoc.Associators(server, assoc_cname, cn,
InstanceID = instid)
- if 'DiskPool' in instid and (virt =='Xen' or virt == 'XenFV'):
+ curr_cim_rev, changeset = get_provider_version(virt, server)
+ if 'DiskPool' in instid and (virt =='Xen' or virt == 'XenFV') and \
+ curr_cim_rev >= libvirt_rasd_template_changes:
# For Diskpool, we have info 1 for each of Min, Max,
# default, Increment and 1 for each of PV and FV
# hence 4 * 2 = 8 records
16 years
[PATCH] [TEST] Updating 03_hs_to_settdefcap.py tc of HostSystem
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1225865381 28800
# Node ID f5a2c1cc3df0bc76fbdcefad05c2254669a42428
# Parent b1634f5d4f0b0cb0f373e3790754536786e9b008
[TEST] Updating 03_hs_to_settdefcap.py tc of HostSystem .
This modification is required for libvirt-cim providers which does not include
the properties of template RASDs changes.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r b1634f5d4f0b -r f5a2c1cc3df0 suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py
--- a/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Tue Nov 04 21:25:46 2008 -0800
+++ b/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Tue Nov 04 22:09:41 2008 -0800
@@ -50,11 +50,13 @@ from CimTest.ReturnCodes import PASS, FA
from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
from XenKvmLib.test_xml import testxml
from XenKvmLib.test_doms import destroy_and_undefine_all
+from XenKvmLib.const import get_provider_version
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
test_dom = "domgst_test"
test_vcpus = 1
bug_sblim='00007'
+libvirt_rasd_template_changes = 707
def setup_env(server, virt="Xen"):
status = PASS
@@ -215,7 +217,9 @@ def get_rasddetails(server, alloccap, vi
ccn,
InstanceID = ap['InstanceID'])
- if 'DiskPool' in ap['InstanceID'] and virt =='Xen':
+ curr_cim_rev, changeset = get_provider_version(virt, server)
+ if 'DiskPool' in ap['InstanceID'] and virt =='Xen' and \
+ curr_cim_rev >= libvirt_rasd_template_changes:
# For Diskpool, we have info 1 for each of Min, Max,
# default, Increment and 1 for each of PV and FV
# hence 4 * 2 = 8 records
16 years
[PATCH] [TEST] Updating the tc to verify fewer Profile when rev < 680
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1225862746 28800
# Node ID b1634f5d4f0b0cb0f373e3790754536786e9b008
# Parent f5bac806db6e00499b572364216031240a31fe8f
[TEST] Updating the tc to verify fewer Profile when rev < 680.
This tc will still fail since the following query does not work yet.
Will send a follow up patch for the same.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r f5bac806db6e -r b1634f5d4f0b suites/libvirt-cim/cimtest/ElementConforms/01_forward.py
--- a/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Tue Nov 04 20:55:00 2008 -0800
+++ b/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Tue Nov 04 21:25:46 2008 -0800
@@ -51,11 +51,13 @@ from CimTest.ReturnCodes import PASS, FA
from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
from XenKvmLib.enumclass import EnumInstances
from XenKvmLib.const import default_network_name, default_pool_name
+from XenKvmLib.const import get_provider_version
sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
test_dom = "domU"
bug_sblim = '00007'
+libvirt_cim_ectp_changes = 680
def pool_init(verify_list, pool_cn, pool_name, virt):
ccn = get_typed_class(virt, pool_cn)
@@ -141,9 +143,14 @@ def get_proflist(server, reg_classname,
status = PASS
try:
proflist = EnumInstances(server, reg_classname)
- if len(proflist) < 7:
- logger.error("'%s' returned '%d' '%s' objects, expected atleast 7",
- reg_classname, len(proflist), 'Profile')
+ curr_cim_rev, changeset = get_provider_version(virt, server)
+ if curr_cim_rev < libvirt_cim_ectp_changes:
+ len_prof_list = 5
+ else:
+ len_prof_list = 7
+ if len(proflist) < len_prof_list:
+ logger.error("'%s' returned '%d' '%s' objects, expected atleast %d",
+ reg_classname, len(proflist), 'Profile', len_prof_list)
status = FAIL
except Exception, detail:
16 years
[PATCH] [TEST] Fixing xm_virt_util.py to import fv_cap
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1225860900 28800
# Node ID f5bac806db6e00499b572364216031240a31fe8f
# Parent 319e2e9509d360334c0e38e17abc9bf2b163e1cb
[TEST] Fixing xm_virt_util.py to import fv_cap.
This is req for tc which use bootloader() will fail otherwise.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 319e2e9509d3 -r f5bac806db6e suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Tue Nov 04 05:22:21 2008 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/xm_virt_util.py Tue Nov 04 20:55:00 2008 -0800
@@ -25,6 +25,7 @@ import os
import os
from VirtLib import utils
import socket
+from VirtLib.live import fv_cap
def xm_domname(ip, domid):
16 years