[PATCH] Fix typo in NetRASD creation that could have caused a break if we rearrange things
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1208191352 25200
# Node ID 857848be56f0bdc3480bb9f5a7ae6d0598b4d9a8
# Parent 041175667e48789b50efe550a3d7d41f42110caa
Fix typo in NetRASD creation that could have caused a break if we rearrange things
No changes, but separate from the larger set.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 041175667e48 -r 857848be56f0 src/Virt_RASD.c
--- a/src/Virt_RASD.c Mon Apr 14 09:42:01 2008 -0700
+++ b/src/Virt_RASD.c Mon Apr 14 09:42:32 2008 -0700
@@ -155,7 +155,7 @@ static CMPIInstance *rasd_from_vdev(cons
} else if (dev->type == CIM_RES_TYPE_NET) {
CMSetProperty(inst,
"NetworkType",
- (CMPIValue *)dev->dev.disk.type,
+ (CMPIValue *)dev->dev.net.type,
CMPI_chars);
} else if (dev->type == CIM_RES_TYPE_MEM) {
const char *units = "KiloBytes";
16 years, 8 months
[PATCH] Set PoolID on all allocated RASD objects for later correlation in DefineSystem
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1208191321 25200
# Node ID 041175667e48789b50efe550a3d7d41f42110caa
# Parent abf9b4881cc061cca318fe39c3c849f01316cdc8
Set PoolID on all allocated RASD objects for later correlation in DefineSystem
No changes, but this can be a standalone patch, so I'm submitting it outside
my other set.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r abf9b4881cc0 -r 041175667e48 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Mon Apr 14 09:15:30 2008 -0700
+++ b/src/Virt_SettingsDefineCapabilities.c Mon Apr 14 09:42:01 2008 -0700
@@ -829,6 +829,7 @@ static CMPIStatus alloc_cap_to_rasd(cons
CMPIStatus s = {CMPI_RC_OK};
uint16_t type;
const char *id = NULL;
+ int i;
if (!match_hypervisor_prefix(ref, info))
return s;
@@ -850,6 +851,10 @@ static CMPIStatus alloc_cap_to_rasd(cons
}
s = sdc_rasds_for_type(ref, list, type);
+
+ for (i = 0; i < list->cur; i++)
+ CMSetProperty(list->list[i], "PoolID",
+ (CMPIValue *)id, CMPI_chars);
out:
return s;
16 years, 8 months
[PATCH] [TEST] update processor id in CS.41_cs_to_settingdefinestate.py
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1208161017 25200
# Node ID fad36e2dbc79278a25beb47a45696ec19705f8d1
# Parent 137e5079c73fcbfc70e6654cee0b3c3eb3c6acd2
[TEST] update processor id in CS.41_cs_to_settingdefinestate.py
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 137e5079c73f -r fad36e2dbc79 suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Fri Apr 11 16:58:23 2008 +0530
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Mon Apr 14 01:16:57 2008 -0700
@@ -84,7 +84,7 @@ def rasd_init_list():
Creating the lists that will be used for comparisons.
"""
proc_rasd = {
- "InstanceID" : '%s/%s' %(test_dom,0),\
+ "InstanceID" : '%s/%s' %(test_dom, "proc"),\
"ResourceType" : 3,\
}
16 years, 8 months
[PATCH] [TEST] Fixing 04_defineStartVS.py tc
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1208157938 -19800
# Node ID f622bcacdd160dd9bd1ad5f1c7cbbc8101aabbbc
# Parent 137e5079c73fcbfc70e6654cee0b3c3eb3c6acd2
[TEST] Fixing 04_defineStartVS.py tc.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 137e5079c73f -r f622bcacdd16 suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Fri Apr 11 16:58:23 2008 +0530
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Mon Apr 14 12:55:38 2008 +0530
@@ -26,7 +26,8 @@
# This test case checks state of the VS is in enabled state after
# defining and starting the VS.
# By verifying the properties of EnabledState = 2 of the VS.
-# 10-Oct-2007
+#
+# 10-Oct-2007
import sys
from time import sleep
@@ -58,15 +59,17 @@ def main():
timeout = 10
try:
- # Need to poll for XenFV, since enabState is not getting set otherwise.
+ # Need to poll for XenFV, since enabState is not getting set
+ # otherwise.
for i in range(1, (timeout + 1)):
sleep(1)
- cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom)
+ cs = computersystem.get_cs_class(options.virt)(options.ip,
+ test_dom)
if cs.Name != test_dom:
Globals.logger.error("VS %s is not defined" % test_dom)
break
- # Success: VS is in Enabled State after Define and Start
+ # Success: VS is in Enabled State after Define and Start
enabState = cs.EnabledState
if enabState == 2:
status = PASS
@@ -76,10 +79,13 @@ def main():
Globals.logger.error(Globals.CIM_ERROR_GETINSTANCE,
get_typed_class(options.virt, 'ComputerSystem'))
Globals.logger.error("Exception: %s", detail)
- return status
+ cxml.destroy(options.ip)
+ cxml.undefine(options.ip)
+ return status
if status != PASS :
- Globals.logger.error("Error: property values are not set for VS %s" , test_dom)
+ Globals.logger.error("Error: property values are not set for VS %s",
+ test_dom)
cxml.destroy(options.ip)
cxml.undefine(options.ip)
16 years, 8 months
[TEST] KVM test on Fedora8
by Guo Lian Yun
The test is done on Beaverton lab machine, which I use for the last KVM
test.
The cimtest is updated, also applied some patches still in waiting for
reviews status.
Hopefully, it can help us fix issues compared to other reports.
stro: Fedora8
Kernel: kernel-2.6.23.1-42.fc8
Xen: xen-3.1.2-2.fc9
Libvirt: libvirt-0.4.0-4.fc8
CIMOM: sblim-sfcb-1.2.5-0
PyWBEM: pywbem-0.6-1
LibCMPIutil: 72
LibvirtCIM: 532
CIM Schema: cimv216Experimental
=============CIMTEST REPORT==================
AllocationCapabilities - 01_enum.py: PASS
AllocationCapabilities - 02_alloccap_gi_errs.py: PASS
ComputerSystem - 01_enum.py: PASS
ComputerSystem - 02_nosystems.py: PASS
ComputerSystem - 03_defineVS.py: PASS
ComputerSystem - 04_defineStartVS.py: PASS
ComputerSystem - 05_activate_defined_start.py: XFAIL Bug: 85769
ComputerSystem - 06_paused_active_suspend.py: XFAIL Bug: 85769
ComputerSystem - 22_define_suspend.py: PASS
ComputerSystem - 23_suspend_suspend.py: SKIP
ComputerSystem - 27_define_suspend_errs.py: SKIP
ComputerSystem - 32_start_reboot.py: SKIP
ComputerSystem - 33_suspend_reboot.py: SKIP
ComputerSystem - 35_start_reset.py: SKIP
ComputerSystem - 40_RSC_start.py: PASS
ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP
ComputerSystem - 42_cs_gi_errs.py: PASS
ComputerSystemIndication - 01_created_indication.py: PASS
ElementAllocatedFromPool - 01_forward.py: SKIP
ElementAllocatedFromPool - 02_reverse.py: SKIP
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: SKIP
ElementSettingData - 01_forward.py: SKIP
ElementSettingData - 03_esd_assoc_with_rasd_errs.py: SKIP
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: SKIP
HostSystem - 05_hs_gi_errs.py: PASS
HostSystem - 06_hs_to_vsms.py: PASS
HostedDependency - 01_forward.py: SKIP
HostedDependency - 02_reverse.py: SKIP
HostedDependency - 03_enabledstate.py: SKIP
HostedDependency - 04_reverse_errs.py: SKIP
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: PASS
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: FAIL
Processor - 01_processor.py: PASS
Processor - 02_definesys_get_procs.py: PASS
Processor - 03_proc_gi_errs.py: PASS
Profile - 01_enum.py: SKIP
Profile - 02_profile_to_elec.py: SKIP
Profile - 03_rprofile_gi_errs.py: SKIP
RASD - 01_verify_rasd_fields.py: PASS
RASD - 02_enum.py: PASS
RASD - 03_rasd_errs.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: SKIP
ResourcePool - 02_rp_gi_errors.py: SKIP
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: XFAIL
Bug: 92173
InvokeMethod(AddResourcesToResourcePool): Unknown Method
Bug:<92173>
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: SKIP
SettingsDefineCapabilities - 03_forward_errs.py: SKIP
SettingsDefineCapabilities - 04_forward_vsmsdata.py: SKIP
SettingsDefineCapabilities - 05_reverse_vsmcap.py: SKIP
SystemDevice - 01_forward.py: PASS
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: SKIP
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: FAIL
InvokeMethod(AddResourceSettings): Failed to create domain
VirtualSystemManagementService - 07_addresource_neg.py: PASS
VirtualSystemManagementService - 08_modifyresource.py: XFAIL Bug: 90853
InvokeMethod(ModifyResourceSettings): Failed to create domain
Bug:<90853>
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: SKIP
VirtualSystemSettingDataComponent - 02_reverse.py: SKIP
VirtualSystemSettingDataComponent - 03_vssdc_fwd_errs.py: SKIP
VirtualSystemSettingDataComponent - 04_vssdc_rev_errs.py: SKIP
VirtualSystemSnapshotService - 01_enum.py: FAIL
Provider not found or not loadable
VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: FAIL
VirtualSystemSnapshotServiceCapabilities - 01_enum.py: FAIL
Provider not found or not loadable
VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py:
FAIL
Best,
Regards
Daisy Guo Lian Yun
E-mail: yunguol(a)cn.ibm.com
IBM China Development Lab, Shanghai, China
TEL: (86)-21-61008057
16 years, 8 months
[PATCH] [TEST] #2 Fixing the 04_defineStartVS.py tc failure
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1207913303 -19800
# Node ID ee931f10e1f0b83d410f8e1c13d320b23bba7f1e
# Parent 19ff9c851ed8cb76b74d158a4c439dfa5f4ccb50
[TEST] #2 Fixing the 04_defineStartVS.py tc failure.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 19ff9c851ed8 -r ee931f10e1f0 suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Wed Apr 09 18:00:14 2008 +0530
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Fri Apr 11 16:58:23 2008 +0530
@@ -6,6 +6,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
@@ -28,10 +29,11 @@
# 10-Oct-2007
import sys
+from time import sleep
from XenKvmLib import vxml
from XenKvmLib import computersystem
-from VirtLib import utils
from CimTest import Globals
+from XenKvmLib.classes import get_typed_class
from CimTest.Globals import do_main
from CimTest.ReturnCodes import PASS, FAIL
@@ -53,18 +55,22 @@ def main():
Globals.logger.error("Failed to Start the dom: %s", test_dom)
cxml.undefine(options.ip)
return status
+
+ timeout = 10
+ try:
+ # Need to poll for XenFV, since enabState is not getting set otherwise.
+ for i in range(1, (timeout + 1)):
+ sleep(1)
+ cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom)
+ if cs.Name != test_dom:
+ Globals.logger.error("VS %s is not defined" % test_dom)
+ break
- try:
- cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom)
-
- if cs.Name == test_dom:
+ # Success: VS is in Enabled State after Define and Start
enabState = cs.EnabledState
- else:
- Globals.logger.error("VS %s is not defined" % test_dom)
-
- # Success: VS is in Enabled State after Define and Start
- if enabState == 2:
- status = PASS
+ if enabState == 2:
+ status = PASS
+ break
except Exception, detail:
Globals.logger.error(Globals.CIM_ERROR_GETINSTANCE,
16 years, 8 months
[PATCH] [TEST]Fixing 01_netport.py tc failure
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1207835007 -19800
# Node ID 0b1dc112438b0362c88891c4a690fd92bf6ca628
# Parent 19ff9c851ed8cb76b74d158a4c439dfa5f4ccb50
[TEST]Fixing 01_netport.py tc failure.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 19ff9c851ed8 -r 0b1dc112438b suites/libvirt-cim/cimtest/NetworkPort/01_netport.py
--- a/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Wed Apr 09 18:00:14 2008 +0530
+++ b/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Thu Apr 10 19:13:27 2008 +0530
@@ -51,6 +51,7 @@ def main():
def main():
options = main.options
log_param()
+ status = PASS
vsxml = get_class(options.virt)(test_dom, mac=test_mac)
vsxml.define(options.ip)
@@ -61,9 +62,7 @@ def main():
'SystemName' : test_dom,
'SystemCreationClassName' : get_typed_class(options.virt, "ComputerSystem")
}
-
dev = None
-
try:
dev = eval('devices.' + get_typed_class(options.virt, "NetworkPort"))(options.ip, key_list)
@@ -72,12 +71,10 @@ def main():
vsxml.undefine(options.ip)
return XFAIL_RC(bug)
- if dev == None:
+ if devid not in dev.DeviceID :
logger.error("Error retrieving instance for devid %s" % devid)
vsxml.undefine(options.ip)
return FAIL
-
- status = PASS
if dev.LinkTechnology != devices.LinkTechnology_Ethernet:
logger.error("LinkTechnology should be set to `%i' instead of `%s'" % \
@@ -86,20 +83,17 @@ def main():
addrs = dev.NetworkAddresses
if len(addrs) != 1:
- logger.error("Too many NetworkAddress entries (%i instead of %i)" % \
- (len(addrs), 1))
+ logger.error("Too many NetworkAddress entries (%i instead of %i)" % (len(addrs), 1))
status = FAIL
if addrs[0] != test_mac:
- logger.error("MAC address reported incorrectly (%s instead of %s)" % \
- (addrs[0], test_mac))
+ logger.error("MAC address reported incorrectly (%s instead of %s)" % (addrs[0], test_mac))
status = FAIL
if status == FAIL:
logger.error("Checked interface %s" % test_mac)
vsxml.undefine(options.ip)
-
return status
if __name__ == "__main__":
16 years, 8 months
[PATCH] [PATCH] fix vcpu dev error in xml_parse_test.c
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1207907205 25200
# Node ID a80c7a68af12a390861171e38d2b216c22fb2b41
# Parent a185e443ad6012d86690194112393d58e8c51967
[PATCH] fix vcpu dev error in xml_parse_test.c
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r a185e443ad60 -r a80c7a68af12 libxkutil/xml_parse_test.c
--- a/libxkutil/xml_parse_test.c Tue Apr 08 11:32:06 2008 -0400
+++ b/libxkutil/xml_parse_test.c Fri Apr 11 02:46:45 2008 -0700
@@ -93,7 +93,7 @@ static void print_dev_vcpu(struct virt_d
static void print_dev_vcpu(struct virt_device *dev,
FILE *d)
{
- print_u32(d, "Virtual CPU", dev->dev.vcpu.number);
+ print_u32(d, "Virtual CPU", dev->dev.vcpu.quantity);
}
static void print_dev_emu(struct virt_device *dev,
16 years, 8 months
libvirt-cim rpm for Fedora 9 versus recent provider repository
by Guo Lian Yun
Hi,
The processor id changed to domanin_name/proc, then does the libvirt-cim
rpm
for Fedora 9 will reflect this recent changes? If so, when is it time
to replace? Also the same issues in terms of MB versus KB for memory.
I'm not sure if libvirt-cim rpm freezed, then how cimtest are represent?
Do we have to branch cimtest into two parts, one for libvirt-cim rpm,
the other for recent provider changes?
Thanks!
Best,
Regards
Daisy Guo Lian Yun
E-mail: yunguol(a)cn.ibm.com
IBM China Development Lab, Shanghai, China
TEL: (86)-21-61008057
16 years, 8 months
[PATCH] [TEST]Fixing 06_paused_active_suspend.py tc failure
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1207834557 -19800
# Node ID dac8e3a5491b28fd6946e6fabf0d4b14cd9921fe
# Parent 0e7eb39ed839e03d1dd2635157f19e5acdc4c9be
[TEST]Fixing 06_paused_active_suspend.py tc failure.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 0e7eb39ed839 -r dac8e3a5491b suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py Thu Apr 10 19:04:30 2008 +0530
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py Thu Apr 10 19:05:57 2008 +0530
@@ -44,8 +44,6 @@ from time import sleep
from time import sleep
from XenKvmLib import computersystem
from XenKvmLib import vxml
-from VirtLib import utils
-from XenKvmLib.test_doms import destroy_and_undefine_all
from CimTest.Globals import log_param, logger
from CimTest.Globals import do_main
from XenKvmLib.common_util import call_request_state_change
@@ -61,6 +59,37 @@ FINAL_STATE = 9
FINAL_STATE = 9
REQUESTED_STATE = FINAL_STATE
TIME = "00000000000000.000000:000"
+
+def poll_for_status(server, virt, cxml, expstate):
+#Polling for the value of EnabledState to be set to expstate.
+#We need to wait for the EnabledState to be set appropriately since
+#it does not get set immediatley to value of expstate when created/suspended.
+ status = FAIL
+ timeout = 10
+ try:
+
+ for i in range(1, (timeout + 1)):
+ sleep(1)
+ cs = computersystem.get_cs_class(virt)(server, test_dom)
+ if cs.Name == test_dom:
+ to_RequestedState = cs.RequestedState
+ enabledState = cs.EnabledState
+ else:
+ logger.error("VS %s not found" % test_dom)
+ return status
+ if enabledState == expstate:
+ status = PASS
+ break
+
+ except Exception, detail:
+ logger.error("Exception variable: %s" % detail)
+
+ if status != PASS:
+ logger.error("Mismatching state values got %i instead of %i", enabledState, expstate)
+ cxml.destroy(server)
+ cxml.undefine(server)
+
+ return status, to_RequestedState, enabledState
@do_main(sup_types)
def main():
@@ -87,45 +116,26 @@ def main():
cxml.destroy(options.ip)
cxml.undefine(options.ip)
return status
-
+
+ status, to_RequestedState, enabledState = poll_for_status(options.ip, options.virt, cxml, 2)
+ if status != PASS or enabledState != 2:
+ return status
+
#Suspend the VS
- rc = call_request_state_change(test_dom, options.ip, REQUESTED_STATE,
- TIME, options.virt)
+ rc = call_request_state_change(test_dom, options.ip, REQUESTED_STATE, TIME, options.virt)
if rc != 0:
logger.error("Unable to suspend dom %s using RequestedStateChange()", test_dom)
cxml.destroy(options.ip)
cxml.undefine(options.ip)
return status
-#Polling for the value of EnabledState to be set to 9.
-#We need to wait for the EnabledState to be set appropriately since
-#it does not get set immediatley to value of 9 when suspended.
- timeout = 10
- try:
- for i in range(1, (timeout + 1)):
- sleep(1)
- cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom)
- if cs.Name == test_dom:
- to_RequestedState = cs.RequestedState
- enabledState = cs.EnabledState
- else:
- logger.error("VS %s not found" % test_dom)
- return status
- if enabledState == FINAL_STATE:
- status = PASS
- break
-
- except Exception, detail:
- logger.error("Exception variable: %s" % detail)
- return status
-
+ status, to_RequestedState, enabledState = poll_for_status(options.ip, options.virt, cxml,
+ FINAL_STATE)
if enabledState != FINAL_STATE:
logger.error("EnabledState has %i instead of %i", enabledState, FINAL_STATE)
logger.error("Try to increase the timeout and run the test again")
if status != PASS:
- ret = cxml.destroy(options.ip)
- cxml.undefine(options.ip)
return status
# Success:
@@ -134,9 +144,8 @@ def main():
# To state == 2
# Enabled_state == RequestedState
- if from_State == START_STATE and \
- to_RequestedState == FINAL_STATE and \
- enabledState == to_RequestedState:
+ if from_State == START_STATE and to_RequestedState == FINAL_STATE and \
+ enabledState == to_RequestedState:
status = PASS
else:
logger.error("ERROR: VS %s transition from suspend State to Activate state \
16 years, 8 months