[PATCH] [TEST]Fixing RASD/02_enum.py
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1250069419 25200
# Node ID ba7c3a6ecb409faad1395a19d1782fda6c525f67
# Parent 302b70f9ef5dea6cc4f5c685718cf7d8cfea8a60
[TEST]Fixing RASD/02_enum.py
Tested with KVM on F10 and Xen on RHEL5.3 with current sources.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 302b70f9ef5d -r ba7c3a6ecb40 suites/libvirt-cim/cimtest/RASD/02_enum.py
--- a/suites/libvirt-cim/cimtest/RASD/02_enum.py Tue Aug 11 06:25:13 2009 -0700
+++ b/suites/libvirt-cim/cimtest/RASD/02_enum.py Wed Aug 12 02:30:19 2009 -0700
@@ -129,7 +129,6 @@
else:
vsxml = virtxml(test_dom, mem=test_mem, vcpus = test_vcpus,
mac = test_mac, disk = test_disk)
- vsxml.set_vbridge(server, default_network_name)
class_list = [ get_typed_class(virt, rasd.dasd_cn),
get_typed_class(virt, rasd.masd_cn),
get_typed_class(virt, rasd.pasd_cn),
15 years, 4 months
[PATCH] [TEST] Don't force the MAC address for all guests
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1250030447 25200
# Node ID ad3738df2b5f64ce7e8523e380f77a67b44d1fdd
# Parent 302b70f9ef5dea6cc4f5c685718cf7d8cfea8a60
[TEST] Don't force the MAC address for all guests.
The providers will set a MAC in the case one isn't specified. This will prevent
address clashes in the case a guest isn't cleaned up properly.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 302b70f9ef5d -r ad3738df2b5f suites/libvirt-cim/lib/XenKvmLib/vxml.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Aug 11 06:25:13 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Tue Aug 11 15:40:47 2009 -0700
@@ -791,7 +791,7 @@
mem=const.default_memory,
mem_allocunits=const.default_mallocunits,
vcpus=const.default_vcpus,
- mac=const.Xen_default_mac,
+ mac=None,
disk_file_path=const.Xen_disk_path,
disk=const.Xen_default_disk_dev,
ntype=const.default_net_type,
@@ -857,7 +857,7 @@
mem=const.default_memory,
mem_allocunits=const.default_mallocunits,
vcpus=const.default_vcpus,
- mac=const.KVM_default_mac,
+ mac=None,
disk_file_path=const.KVM_disk_path,
disk=const.KVM_default_disk_dev,
ntype=const.default_net_type,
@@ -913,7 +913,7 @@
mem=const.default_memory,
mem_allocunits=const.default_mallocunits,
vcpus=const.default_vcpus,
- mac=const.XenFV_default_mac,
+ mac=None,
disk_file_path=const.XenFV_disk_path,
disk=const.XenFV_default_disk_dev,
ntype=const.default_net_type,
@@ -973,7 +973,7 @@
uuid=None,
mem=const.default_memory,
vcpus=const.default_vcpus,
- mac=const.LXC_default_mac,
+ mac=None,
ntype=const.default_net_type,
net_name=const.default_network_name,
tty=const.LXC_default_tty, grstype="vnc",
15 years, 4 months
[PATCH] [TEST] #2 Add test for verifying disabled RequestStateChange()
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1249668560 25200
# Node ID 01244d56c0603ec80515823e50bd425ddb22f8a0
# Parent ad3738df2b5f64ce7e8523e380f77a67b44d1fdd
[TEST] #2 Add test for verifying disabled RequestStateChange()
Changes from 1 to 2:
-Remove XFAIL
-Be sure guest is in proper state after disabling it
-Update test description
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r ad3738df2b5f -r 01244d56c060 suites/libvirt-cim/cimtest/ComputerSystem/34_start_disable.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/34_start_disable.py Fri Aug 07 11:09:20 2009 -0700
@@ -0,0 +1,93 @@
+#!/usr/bin/python
+#
+# Copyright 2009 IBM Corp.
+#
+# Authors:
+# Kaitlin Rupert <karupert(a)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
+#
+# Test Case Info:
+# --------------
+# This test case is used to verify the Virtual System State Transition
+# information is captured in the RequestedState Property of the VS.
+# The test is considered to be successful if RequestedState Property
+# has a value of enabled/disabled when the VS is moved from active state
+# to a disabled state.
+#
+# For providers older than 945, the guest will be rebooted. Otherwise, it will
+# be destroyed and placed in the 'defined' state.
+#
+# Date: 08-07-2009
+
+import sys
+from CimTest.Globals import logger
+from XenKvmLib.const import do_main, CIM_ENABLE, CIM_DISABLE, \
+ get_provider_version
+from CimTest.ReturnCodes import PASS, FAIL
+from XenKvmLib.vxml import get_class
+
+sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
+
+default_dom = 'cs_test_domain'
+
+disable_change_rev = 945
+
+@do_main(sup_types)
+def main():
+ options = main.options
+ status = FAIL
+ server = options.ip
+ virt = options.virt
+
+ try:
+ cxml = get_class(virt)(default_dom)
+ ret = cxml.cim_define(server)
+ if not ret:
+ raise Exception("Failed to define the guest: %s" % default_dom)
+
+ status = cxml.cim_start(server)
+ if status != PASS:
+ raise Exception("Unable start dom '%s'" % default_dom)
+
+ status = cxml.cim_disable(server)
+ if status != PASS:
+ raise Exception("Unable disable dom '%s'" % default_dom)
+
+ rev, changeset = get_provider_version(virt, server)
+ if rev >= disable_change_rev:
+ exp_state = CIM_DISABLE
+ else:
+ exp_state = CIM_ENABLE
+
+ status = cxml.check_guest_state(server, exp_state)
+ if status != PASS:
+ raise Exception("%s not in expected state %d" % \
+ (default_dom, exp_state))
+
+ except Exception, detail:
+ logger.error("Exception: %s", detail)
+ status = FAIL
+
+ #Call destroy incase disable fails or for older provider
+ #version where disable causes guest to be rebooted
+ cxml.cim_destroy(server)
+ cxml.undefine(server)
+
+ return status
+
+if __name__ == "__main__":
+ sys.exit(main())
15 years, 4 months
[PATCH] [TEST] Add test for verifying disabled RequestStateChange()
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1249668560 25200
# Node ID 9f740b6fe6cfe41317514182f245d1eb9938122c
# Parent 12fd8bac01f25251dbfb64dd5e764f533108964b
[TEST] Add test for verifying disabled RequestStateChange()
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 12fd8bac01f2 -r 9f740b6fe6cf suites/libvirt-cim/cimtest/ComputerSystem/34_start_disable.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/34_start_disable.py Fri Aug 07 11:09:20 2009 -0700
@@ -0,0 +1,74 @@
+#!/usr/bin/python
+#
+# Copyright 2009 IBM Corp.
+#
+# Authors:
+# Kaitlin Rupert <karupert(a)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
+#
+# Test Case Info:
+# --------------
+# This test case is used to verify the Virtual System State Transition
+# information is captured in the RequestedState Property of the VS.
+# The test is considered to be successful if RequestedState Property
+# has a value of 3 when the VS is moved from active state to a disabled state.
+#
+# Date: 08-07-2009
+
+import sys
+from CimTest.Globals import logger
+from XenKvmLib.const import do_main
+from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
+from XenKvmLib.vxml import get_class
+
+sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
+
+default_dom = 'cs_test_domain'
+
+@do_main(sup_types)
+def main():
+ options = main.options
+ status = FAIL
+ server = options.ip
+ virt = options.virt
+
+ try:
+ # define the vs
+ cxml = get_class(virt)(default_dom)
+ ret = cxml.cim_define(server)
+ if not ret:
+ raise Exception("Failed to define the guest: %s" % default_dom)
+
+ status = cxml.cim_start(server)
+ if status != PASS:
+ raise Exception("Unable start dom '%s'" % default_dom)
+
+ status = cxml.cim_disable(server)
+ if status != PASS:
+ raise Exception("Unable disable dom '%s'" % default_dom)
+
+ except Exception, detail:
+ logger.error("Exception: %s", detail)
+ status = FAIL
+
+ cxml.cim_destroy(server)
+ cxml.undefine(server)
+
+ return status
+
+if __name__ == "__main__":
+ sys.exit(main())
15 years, 4 months
[PATCH] (#2) Add LibvirtVersion to VSMS
by Jim Fehlig
# HG changeset patch
# User Jim Fehlig <jfehlig(a)novell.com>
# Date 1250021734 21600
# Node ID 9bb1d8852a07160ab0d4572d55a4ea21db830e12
# Parent 2de7d9bdb9af3414ddc01f28d7a007d6c3d19bbc
(#2) Add LibvirtVersion to VSMS
I've had users ask for libvirt version available through libvirt-cim.
This patch add LibvirtVersion property to VSMS, which is a proxy for
libvirt and seems the most appropriate place to add the property.
I consider VSMSC, but that class describes what the associated service
is capable of as opposed to version information about the service.
#2:
If unable to determine libvirt version, set property to
"Unknown libvirt version" instead of "Unknown libvirt".
Signed-off-by: Jim Fehlig <jfehlig novell com>
diff -r 2de7d9bdb9af -r 9bb1d8852a07 schema/VirtualSystemManagementService.mof
--- a/schema/VirtualSystemManagementService.mof Fri Aug 07 15:53:57 2009 -0700
+++ b/schema/VirtualSystemManagementService.mof Tue Aug 11 14:15:34 2009 -0600
@@ -11,6 +11,9 @@
[Description("Package Version")]
string Release;
+
+ [Description("libvirt Version")]
+ string LibvirtVersion;
};
[Provider("cmpi::Virt_VirtualSystemManagementService")]
@@ -24,6 +27,9 @@
[Description("Package Version")]
string Release;
+
+ [Description("libvirt Version")]
+ string LibvirtVersion;
};
[Provider("cmpi::Virt_VirtualSystemManagementService")]
@@ -37,4 +43,7 @@
[Description("Package Version")]
string Release;
+
+ [Description("libvirt Version")]
+ string LibvirtVersion;
};
diff -r 2de7d9bdb9af -r 9bb1d8852a07 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Fri Aug 07 15:53:57 2009 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Tue Aug 11 14:15:34 2009 -0600
@@ -2418,8 +2418,10 @@
const char *ccname = NULL;
virConnectPtr conn = NULL;
unsigned long hv_version = 0;
+ unsigned long lv_version = 0;
const char * hv_type = NULL;
char *caption = NULL;
+ char *lv_version_string = NULL;
CMPIArray *array;
uint16_t op_status;
@@ -2483,6 +2485,26 @@
CMSetProperty(inst, "Caption",
(CMPIValue *)"Unknown Hypervisor", CMPI_chars);
+ if (virGetVersion(&lv_version, hv_type, &hv_version) < 0) {
+ CU_DEBUG("Unable to get libvirt version");
+ lv_version= 0;
+ hv_version= 0;
+ }
+
+ if (asprintf(&lv_version_string, "%lu.%lu.%lu",
+ lv_version / 1000000,
+ (lv_version % 1000000) / 1000,
+ (lv_version % 1000000) % 1000) == -1)
+ lv_version_string = NULL;
+
+ if (lv_version_string != NULL)
+ CMSetProperty(inst, "LibvirtVersion",
+ (CMPIValue *)lv_version_string, CMPI_chars);
+ else
+ CMSetProperty(inst, "LibvirtVersion",
+ (CMPIValue *)"Unknown libvirt version",
+ CMPI_chars);
+
CMSetProperty(inst, "Name",
(CMPIValue *)"Management Service", CMPI_chars);
@@ -2522,6 +2544,7 @@
"");
out:
free(caption);
+ free(lv_version_string);
virConnectClose(conn);
*_inst = inst;
15 years, 4 months
[PATCH] Add LibvirtVersion to VSMS
by Jim Fehlig
# HG changeset patch
# User Jim Fehlig <jfehlig(a)novell.com>
# Date 1249688466 21600
# Node ID cca9b991128c170d03177e33b88e1b5bac930bd6
# Parent 8c9cb3efdbad40890a5408267bc6a0d7b4b3de6e
Add LibvirtVersion to VSMS
I've had users ask for libvirt version available through libvirt-cim.
This patch add LibvirtVersion property to VSMS, which is a proxy for
libvirt and seems the most appropriate place to add the property.
I consider VSMSC, but that class describes what the associated service
is capable of as opposed to version information about the service.
Signed-off-by: Jim Fehlig <jfehlig(a)novell.com>
diff -r 8c9cb3efdbad -r cca9b991128c schema/VirtualSystemManagementService.mof
--- a/schema/VirtualSystemManagementService.mof Wed Aug 05 14:07:00 2009 -0300
+++ b/schema/VirtualSystemManagementService.mof Fri Aug 07 17:41:06 2009 -0600
@@ -11,6 +11,9 @@
[Description("Package Version")]
string Release;
+
+ [Description("libvirt Version")]
+ string LibvirtVersion;
};
[Provider("cmpi::Virt_VirtualSystemManagementService")]
@@ -24,6 +27,9 @@
[Description("Package Version")]
string Release;
+
+ [Description("libvirt Version")]
+ string LibvirtVersion;
};
[Provider("cmpi::Virt_VirtualSystemManagementService")]
@@ -37,4 +43,7 @@
[Description("Package Version")]
string Release;
+
+ [Description("libvirt Version")]
+ string LibvirtVersion;
};
diff -r 8c9cb3efdbad -r cca9b991128c src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Wed Aug 05 14:07:00 2009 -0300
+++ b/src/Virt_VirtualSystemManagementService.c Fri Aug 07 17:41:06 2009 -0600
@@ -2418,8 +2418,10 @@
const char *ccname = NULL;
virConnectPtr conn = NULL;
unsigned long hv_version = 0;
+ unsigned long lv_version = 0;
const char * hv_type = NULL;
char *caption = NULL;
+ char *lv_version_string = NULL;
CMPIArray *array;
uint16_t op_status;
@@ -2483,6 +2485,25 @@
CMSetProperty(inst, "Caption",
(CMPIValue *)"Unknown Hypervisor", CMPI_chars);
+ if (virGetVersion(&lv_version, hv_type, &hv_version) < 0) {
+ CU_DEBUG("Unable to get libvirt version");
+ lv_version= 0;
+ hv_version= 0;
+ }
+
+ if (asprintf(&lv_version_string, "%lu.%lu.%lu",
+ lv_version / 1000000,
+ (lv_version % 1000000) / 1000,
+ (lv_version % 1000000) % 1000) == -1)
+ lv_version_string = NULL;
+
+ if (lv_version_string != NULL)
+ CMSetProperty(inst, "LibvirtVersion",
+ (CMPIValue *)lv_version_string, CMPI_chars);
+ else
+ CMSetProperty(inst, "LibvirtVersion",
+ (CMPIValue *)"Unknown libvirt", CMPI_chars);
+
CMSetProperty(inst, "Name",
(CMPIValue *)"Management Service", CMPI_chars);
@@ -2522,6 +2543,7 @@
"");
out:
free(caption);
+ free(lv_version_string);
virConnectClose(conn);
*_inst = inst;
15 years, 4 months
[PATCH] [TEST] Fixing EAFP/04_forward_errs.py
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1249997113 25200
# Node ID 2f339d5b932d957cccc6432c6b979ad6bff02a8b
# Parent 12fd8bac01f25251dbfb64dd5e764f533108964b
[TEST] Fixing EAFP/04_forward_errs.py.
Tested with KVM on F10 and Xen on RHEL5.3 with current sources.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 12fd8bac01f2 -r 2f339d5b932d suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py
--- a/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py Mon Aug 10 04:39:27 2009 -0700
+++ b/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py Tue Aug 11 06:25:13 2009 -0700
@@ -498,10 +498,9 @@
else:
test_disk = "hda"
destroy_and_undefine_all(options.ip)
- vsxml = get_class(virt)(test_dom, vcpus = test_vcpus, mac = test_mac, \
- disk = test_disk)
+ vsxml = get_class(virt)(test_dom, vcpus = test_vcpus,
+ mac = test_mac, disk = test_disk)
- bridge = vsxml.set_vbridge(options.ip, default_network_name)
ret = vsxml.cim_define(options.ip)
if not ret:
logger.error("Failed to define the dom: %s", test_dom)
15 years, 4 months
[PATCH] [TEST] Modifying rasd.py to include strorage vol info when libvirt>= 0.4.1
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1249976643 25200
# Node ID e1a54be4fedf4527eebbb7b225c9ea9a75e815c8
# Parent 12fd8bac01f25251dbfb64dd5e764f533108964b
[TEST] Modifying rasd.py to include strorage vol info when libvirt>= 0.4.1
Tested with KVM on F10 and Xen on RHEL5.3 with current sources.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 12fd8bac01f2 -r e1a54be4fedf suites/libvirt-cim/lib/XenKvmLib/rasd.py
--- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Mon Aug 10 04:39:27 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Tue Aug 11 00:44:03 2009 -0700
@@ -360,7 +360,8 @@
volumes = enum_volumes(virt, ip, id[1])
exp_len = (volumes * exp_base_num) + exp_cdrom
- if rev >= libvirt_rasd_storagepool_changes and virt != 'LXC':
+ if rev >= libvirt_rasd_storagepool_changes and libvirt_ver >= '0.4.1' \
+ and virt != 'LXC':
exp_len += exp_storagevol_rasd
return exp_len
15 years, 4 months
[PATCH 0 of 3] Initial image creation support
by Kaitlin Rupert
Right now, the CreateResourceInPool() doesn't do anything other than check the
parameters that are parsed in. Subsequent patches will add additional
functionality.
15 years, 4 months