[PATCH] Add support for iscsi storage pools
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1242695586 25200
# Node ID 9ac4e06aa21334cf25b8096663dca6fea74dccd8
# Parent aa8e071730d2ce20064f1c0295a8005e31ef2cea
Add support for iscsi storage pools
You will need a system with iSCSI connected storage to test this
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r aa8e071730d2 -r 9ac4e06aa213 src/Virt_ResourcePoolConfigurationService.c
--- a/src/Virt_ResourcePoolConfigurationService.c Wed May 20 10:41:46 2009 -0700
+++ b/src/Virt_ResourcePoolConfigurationService.c Mon May 18 18:13:06 2009 -0700
@@ -179,6 +179,24 @@
return NULL;
}
+static const char *disk_iscsi_pool(CMPIInstance *inst,
+ struct virt_pool *pool)
+{
+ const char *val = NULL;
+
+ if (cu_get_str_prop(inst, "DevicePath", &val) != CMPI_RC_OK)
+ return "Missing `DevicePath' property";
+
+ pool->pool_info.disk.device_path = strdup(val);
+
+ if (cu_get_str_prop(inst, "Host", &val) != CMPI_RC_OK)
+ return "Missing `Host' property";
+
+ pool->pool_info.disk.host = strdup(val);
+
+ return NULL;
+}
+
static const char *disk_rasd_to_pool(CMPIInstance *inst,
struct virt_pool *pool)
{
@@ -201,6 +219,9 @@
case DISK_POOL_NETFS:
msg = disk_netfs_pool(inst, pool);
break;
+ case DISK_POOL_ISCSI:
+ msg = disk_iscsi_pool(inst, pool);
+ break;
default:
return "Storage pool type not supported";
}
15 years, 4 months
[PATCH] [TEST] Update RedirectionSerivce 01 to work with recent schema changes
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1243635120 25200
# Node ID 7dd85abd05e44f4a1c319e7284205a8365f56f5e
# Parent a22bbefc05e5b294b254c58236b0f2abda65a23a
[TEST] Update RedirectionSerivce 01 to work with recent schema changes
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r a22bbefc05e5 -r 7dd85abd05e4 suites/libvirt-cim/cimtest/RedirectionService/01_enum_crs.py
--- a/suites/libvirt-cim/cimtest/RedirectionService/01_enum_crs.py Fri May 29 13:59:02 2009 -0700
+++ b/suites/libvirt-cim/cimtest/RedirectionService/01_enum_crs.py Fri May 29 15:12:00 2009 -0700
@@ -40,6 +40,7 @@
REDIRECTION_SER_TYPE = 3
CRS_MAX_SAP_REV = 724
libvirtcim_hr_crs_changes = 688
+schema_upgrade_change = 881
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
@do_main(sup_types)
@@ -88,9 +89,13 @@
'EnabledState' : 2,
'EnabledDefault' : 2,
'RequestedState' : 12,
- 'MaxConcurrentEnabledSAPs': max_sap_sessions
}
+ if curr_cim_rev < schema_upgrade_change:
+ crs_list['MaxConcurrentEnabledSAPs'] = max_sap_sessions
+ else:
+ crs_list['MaxCurrentEnabledSAPs'] = max_sap_sessions
+
try:
crs = EnumInstances(server, classname)
except Exception, detail:
15 years, 5 months
[PATCH] A few schema cleanups after migrating from 2.16 to 2.21
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1242841306 25200
# Node ID aa8e071730d2ce20064f1c0295a8005e31ef2cea
# Parent 10e45fca47f0d19eddcf7bb1559ba9e7397aea24
A few schema cleanups after migrating from 2.16 to 2.21
Fixes:
-CIM_HostedResourcePool is needed in cimv2 to register Virt_HostedResourcePool
as a cross-namespace provider
-Implementation specific VirtualSystemSnapshotService should be a subclass of
CIM_VirtualSystemSnapshotService, not Virt_VirtualSystemSnapshotService
-CIM_VirtualSystemMigrationSettingData.mof and
CIM_VirtualSystemMigrationService.mof are needed in interop to properly
register ECTP asa cross-namespace provider
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 10e45fca47f0 -r aa8e071730d2 base_schema/cimv2.21.0-cimv2_mof
--- a/base_schema/cimv2.21.0-cimv2_mof Mon May 18 16:39:20 2009 -0700
+++ b/base_schema/cimv2.21.0-cimv2_mof Wed May 20 10:41:46 2009 -0700
@@ -9,3 +9,4 @@
#pragma include ("Core/CIM_HostedResourcePool.mof")
#pragma include ("Core/CIM_ElementCapabilities.mof")
#pragma include ("Core/CIM_HostedService.mof")
+#pragma include ("Core/CIM_HostedResourcePool.mof")
diff -r 10e45fca47f0 -r aa8e071730d2 base_schema/cimv2.21.0-interop_mof
--- a/base_schema/cimv2.21.0-interop_mof Mon May 18 16:39:20 2009 -0700
+++ b/base_schema/cimv2.21.0-interop_mof Wed May 20 10:41:46 2009 -0700
@@ -26,3 +26,5 @@
#pragma include ("Core/CIM_ResourcePool.mof")
#pragma include ("Core/CIM_Capabilities.mof")
#pragma include ("Core/CIM_AllocationCapabilities.mof")
+#pragma include ("System/CIM_VirtualSystemMigrationSettingData.mof")
+#pragma include ("System/CIM_VirtualSystemMigrationService.mof")
diff -r 10e45fca47f0 -r aa8e071730d2 schema/VirtualSystemSnapshotService.mof
--- a/schema/VirtualSystemSnapshotService.mof Mon May 18 16:39:20 2009 -0700
+++ b/schema/VirtualSystemSnapshotService.mof Wed May 20 10:41:46 2009 -0700
@@ -1,5 +1,5 @@
// Copyright IBM Corp. 2008
-class Xen_VirtualSystemSnapshotService : Virt_VirtualSystemSnapshotService { };
-class KVM_VirtualSystemSnapshotService : Virt_VirtualSystemSnapshotService { };
-class LXC_VirtualSystemSnapshotService : Virt_VirtualSystemSnapshotService { };
+class Xen_VirtualSystemSnapshotService : CIM_VirtualSystemSnapshotService { };
+class KVM_VirtualSystemSnapshotService : CIM_VirtualSystemSnapshotService { };
+class LXC_VirtualSystemSnapshotService : CIM_VirtualSystemSnapshotService { };
15 years, 5 months
[PATCH] [TEST] Add support for DiskPoolRASD / NetPoolRASD to get_exp_template_rasd_len()
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1243630742 25200
# Node ID a22bbefc05e5b294b254c58236b0f2abda65a23a
# Parent 46664d3f9e880c69ed43a06f36d0d4f33bd29f67
[TEST] Add support for DiskPoolRASD / NetPoolRASD to get_exp_template_rasd_len()
Also update HostSystem 03 to support DiskPoolRASD / NetPoolRASD
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 46664d3f9e88 -r a22bbefc05e5 suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py
--- a/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Fri May 29 14:39:36 2009 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Fri May 29 13:59:02 2009 -0700
@@ -204,8 +204,10 @@
else:
rtype = {
"%s_DiskResourceAllocationSettingData" % virt : 17, \
+ "%s_DiskPoolResourceAllocationSettingData" % virt : 17, \
"%s_MemResourceAllocationSettingData" % virt : 4, \
"%s_NetResourceAllocationSettingData" % virt : 10, \
+ "%s_NetPoolResourceAllocationSettingData" % virt : 10, \
"%s_ProcResourceAllocationSettingData" % virt : 3
}
try:
diff -r 46664d3f9e88 -r a22bbefc05e5 suites/libvirt-cim/lib/XenKvmLib/rasd.py
--- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Fri May 29 14:39:36 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Fri May 29 13:59:02 2009 -0700
@@ -304,45 +304,76 @@
return rasd_insts, PASS
-def get_exp_template_rasd_len(virt, ip, id):
+def get_exp_disk_rasd_len(virt, ip, rev, id):
libvirt_rasd_template_changes = 707
libvirt_rasd_new_changes = 805
libvirt_rasd_dpool_changes = 839
- curr_cim_rev, changeset = get_provider_version(virt, ip)
-
# For Diskpool, we have info 1 for each of Min, Max, Default, and Incr
exp_base_num = 4
exp_cdrom = 4
- exp_len = exp_base_num
+ exp_len = exp_base_num
- if 'DiskPool' in id:
- if virt == 'Xen' or virt == 'XenFV':
- # For Xen and XenFV, there is a template for PV and FV, so you
- # end up with double the number of templates
- xen_multi = 2
+ if id == "DiskPool/0":
+ pool_types = 3
+ return exp_base_num * pool_types
+
+ if virt == 'Xen' or virt == 'XenFV':
+ # For Xen and XenFV, there is a template for PV and FV, so you
+ # end up with double the number of templates
+ xen_multi = 2
- if curr_cim_rev >= libvirt_rasd_template_changes and \
- curr_cim_rev < libvirt_rasd_new_changes:
- exp_len = exp_base_num + exp_cdrom
+ if rev >= libvirt_rasd_template_changes and \
+ rev < libvirt_rasd_new_changes:
+ exp_len = exp_base_num + exp_cdrom
- elif curr_cim_rev >= libvirt_rasd_new_changes and \
- curr_cim_rev < libvirt_rasd_dpool_changes:
- exp_len = (exp_base_num + exp_cdrom) * xen_multi
+ elif rev >= libvirt_rasd_new_changes and \
+ rev < libvirt_rasd_dpool_changes:
+ exp_len = (exp_base_num + exp_cdrom) * xen_multi
- elif curr_cim_rev >= libvirt_rasd_dpool_changes:
- volumes = enum_volumes(virt, ip)
- exp_len = ((volumes * exp_base_num) + exp_cdrom) * xen_multi
+ elif rev >= libvirt_rasd_dpool_changes:
+ volumes = enum_volumes(virt, ip)
+ exp_len = ((volumes * exp_base_num) + exp_cdrom) * xen_multi
- elif virt == 'KVM':
- if curr_cim_rev >= libvirt_rasd_new_changes and \
- curr_cim_rev < libvirt_rasd_dpool_changes:
- exp_len = exp_base_num + exp_cdrom
+ elif virt == 'KVM':
+ if rev >= libvirt_rasd_new_changes and \
+ rev < libvirt_rasd_dpool_changes:
+ exp_len = exp_base_num + exp_cdrom
- elif curr_cim_rev >= libvirt_rasd_dpool_changes:
- volumes = enum_volumes(virt, ip)
- exp_len = (volumes * exp_base_num) + exp_cdrom
+ elif rev >= libvirt_rasd_dpool_changes:
+ volumes = enum_volumes(virt, ip)
+ exp_len = (volumes * exp_base_num) + exp_cdrom
return exp_len
+def get_exp_net_rasd_len(virt, rev, id):
+ net_rasd_template_changes = 861
+
+ exp_base_num = 4
+
+ if id == "NetworkPool/0":
+ pool_types = 3
+ forward_modes = 2
+
+ return (exp_base_num * pool_types) + (exp_base_num * forward_modes)
+
+ if rev >= net_rasd_template_changes:
+ dev_types = 2
+
+ return exp_base_num * dev_types
+
+def get_exp_template_rasd_len(virt, ip, id):
+ curr_cim_rev, changeset = get_provider_version(virt, ip)
+
+ exp_len = 4
+
+ if 'DiskPool' in id:
+ exp_len = get_exp_disk_rasd_len(virt, ip, curr_cim_rev, id)
+
+ elif 'NetworkPool' in id:
+ exp_len = get_exp_net_rasd_len(virt, curr_cim_rev, id)
+
+ return exp_len
+
+
15 years, 5 months
[PATCH] [TEST] Detect whether the revision is a distro defined value
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1243633176 25200
# Node ID 46664d3f9e880c69ed43a06f36d0d4f33bd29f67
# Parent 1f0e581729dc63c083a510703b47d4bd457bd178
[TEST] Detect whether the revision is a distro defined value
Even if the distro is SLES or RHEL, the providers might be installed from
source. In which case, the revision value will be the hg revision value, and
not the distro defined value.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 1f0e581729dc -r 46664d3f9e88 suites/libvirt-cim/lib/XenKvmLib/const.py
--- a/suites/libvirt-cim/lib/XenKvmLib/const.py Thu May 21 15:50:56 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Fri May 29 14:39:36 2009 -0700
@@ -148,11 +148,6 @@
def get_provider_version(virt, ip):
- cmd = "cat /etc/issue | grep 'SUSE Linux Enterprise Server 11'"
- rc, out = run_remote(ip, cmd)
- if rc == 0:
- return 0, sles11_changeset
-
conn = WBEMConnection('http://%s' % ip,
(os.getenv('CIM_USER'), os.getenv('CIM_PASS')),
os.getenv('CIM_NS'))
@@ -167,6 +162,18 @@
if revision is None or changeset is None:
return 0, "Unknown"
+ # This is a sloppy mechanism for detecting a distro defined revision value
+ distro = None
+
+ cmd = "cat /etc/issue | grep 'SUSE Linux Enterprise Server 11'"
+ rc, out = run_remote(ip, cmd)
+ if rc == 0:
+ distro = "sles11"
+
+ if revision.find(".") == 0:
+ if distro == "sles11":
+ return 0, sles11_changeset
+
revision = revision.strip("+")
if revision.isdigit():
revision = int(revision)
15 years, 5 months
[PATCH] [CU][RFC](#2) Added lexer/parser support for string array properties
by Richard Maciel
# HG changeset patch
# User Richard Maciel <rmaciel(a)linux.vnet.ibm.com>
# Date 1243702984 10800
# Node ID 0b79dd93e4ede362b4da5bb83dba8c6bca0ab783
# Parent 1cb3975921d590d4dda4de197a4dc687e45d1840
Fixes bug #53409
To accomplish this, the lexer and the parser were changed to accept array of strings values for properties
Signed-off-by: Richard Maciel <rmaciel(a)linux.vnet.ibm.com>
diff -r 1cb3975921d5 -r 0b79dd93e4ed eo_util_lexer.l
--- a/eo_util_lexer.l Mon Apr 27 16:11:32 2009 -0700
+++ b/eo_util_lexer.l Sat May 30 14:03:04 2009 -0300
@@ -4,6 +4,7 @@
* Authors:
* Gareth Bestor <bestorga(a)us.ibm.com>
* Dan Smith <danms(a)us.ibm.com>
+ * Richard Maciel <richardm(a)br.ibm.com>
*
*/
/*** WARNING - COMMENTS IN LEX MUST BE TAB INDENTED ***/
@@ -91,7 +92,18 @@
return(STRING);
}
- /* Classname */
+\{ {
+ return(OPENBRACKET);
+ }
+
+\} {
+ return(CLOSEBRACKET);
+ }
+
+\, {
+ return(COMMA);
+ }
+
/* NOTE - this rule only applies after a 'INSTANCE OF' has been read in */
<READCLASSNAME>[A-Za-z][A-Za-z0-9_]* {
BEGIN INITIAL; /* Go back to normal parsing rules now */
diff -r 1cb3975921d5 -r 0b79dd93e4ed eo_util_parser.y
--- a/eo_util_parser.y Mon Apr 27 16:11:32 2009 -0700
+++ b/eo_util_parser.y Sat May 30 14:03:04 2009 -0300
@@ -4,6 +4,7 @@
* Authors:
* Gareth Bestor <bestorga(a)us.ibm.com>
* Dan Smith <danms(a)us.ibm.com>
+ * Richard Maciel <richardm(a)br.ibm.com>
*/
/* DEFINITIONS SECTION */
@@ -20,15 +21,24 @@
/* specify prototypes to get rid of warnings */
int eo_parse_lex (void);
void eo_parse_error(char *);
+inline void ins_chars_into_cmstr_arr(const CMPIBroker *broker,
+ CMPIArray *arr,
+ CMPICount index,
+ char *str);
#define RC_OK 0
#define RC_EOF EOF
#define RC_INVALID_CLASS -1000
+#define EODEBUG 1
/* DEFINE ANY GLOBAL VARS HERE */
static const CMPIBroker * _BROKER;
static CMPIInstance ** _INSTANCE;
static const char * _NAMESPACE;
+static CMPICount stringarraysize;
+static char **stringarray;
+static char *stringarraypropname;
+
#ifdef EODEBUG
#define EOTRACE(fmt, arg...) fprintf(stderr, fmt, ##arg)
@@ -36,6 +46,7 @@
#define EOTRACE(fmt, arg...)
#endif
+
int eo_parse_parseinstance(const CMPIBroker *broker,
CMPIInstance **instance,
const char *ns);
@@ -52,7 +63,7 @@
}
/* Define simple (untyped) lexical tokens */
-%token INSTANCE OF ENDOFFILE
+%token INSTANCE OF ENDOFFILE OPENBRACKET CLOSEBRACKET COMMA
/* Define lexical tokens that return a value and their return type */
%token <string> CLASS
@@ -67,7 +78,7 @@
/* Rules section */
instance: /* empty */
- | INSTANCE OF CLASS '{'
+ | INSTANCE OF CLASS OPENBRACKET
{
EOTRACE("classname = %s\n",$3);
CMPIObjectPath *op;
@@ -82,7 +93,7 @@
return RC_INVALID_CLASS;
free($3);
}
- properties '}' ';'
+ properties CLOSEBRACKET ';'
{
/* Return after reading in each instance */
return RC_OK;
@@ -127,7 +138,17 @@
CMSetProperty(*_INSTANCE, $1, &($3), CMPI_boolean);
free($1);
}
+ | PROPERTYNAME '=' OPENBRACKET
+ {
+ EOTRACE("propertyname = %s\n"
+ "\ttype = CMPI_charsA\n",
+ $1);
+ stringarraysize = 0;
+ stringarraypropname = $1;
+ }
+ arrayofstrings CLOSEBRACKET ';'
+
| PROPERTYNAME '=' CIMNULL ';'
{
EOTRACE("propertyname = %s\n"
@@ -136,11 +157,86 @@
}
;
+arrayofstrings: STRING
+ {
+ EOTRACE("BootDevices[%u]=%s\n",stringarraysize, $1);
+
+ stringarraysize++;
+ stringarray = (char **)realloc(stringarray,
+ sizeof(char *) *
+ stringarraysize);
+ stringarray[stringarraysize-1] = $1;
+ }
+ COMMA arrayofstrings
+
+
+ | STRING
+ {
+ CMPIArray *arr;
+ CMPICount i;
+ CMPIStatus s;
+
+ EOTRACE("\tBootDevices[%u]=%s\n",stringarraysize, $1);
+
+ stringarraysize++;
+
+ arr = CMNewArray(_BROKER,
+ stringarraysize,
+ CMPI_string,
+ &s);
+ if (s.rc != CMPI_RC_OK || CMIsNullObject(arr))
+ EOTRACE("Error creating array\n");
+
+ // Values to stringarraysize - 2 are in the
+ // temporary array
+ for (i = 0; i < stringarraysize - 1; i++) {
+ ins_chars_into_cmstr_arr(_BROKER,
+ arr,
+ i,
+ stringarray[i]);
+
+ free(stringarray[i]);
+ }
+
+ ins_chars_into_cmstr_arr(_BROKER,
+ arr,
+ stringarraysize - 1,
+ $1);
+
+ free($1);
+
+ CMSetProperty(*_INSTANCE,
+ stringarraypropname,
+ &arr,
+ CMPI_stringA);
+
+ free(stringarraypropname);
+ }
+ ;
+
/* END OF RULES SECTION */
%%
/* USER SUBROUTINE SECTION */
+inline void ins_chars_into_cmstr_arr(const CMPIBroker *broker,
+ CMPIArray *arr,
+ CMPICount index,
+ char *str)
+{
+ CMPIString *cm_str;
+ CMPIStatus s;
+
+ cm_str = CMNewString(_BROKER, str, &s);
+ if (s.rc != CMPI_RC_OK || CMIsNullObject(cm_str))
+ EOTRACE("Error creating CMPIString");
+
+ s = CMSetArrayElementAt(arr, index, &cm_str, CMPI_string);
+ if (s.rc != CMPI_RC_OK)
+ EOTRACE("Error setting array element %u\n"
+ "Error code: %d\n", index, s.rc);
+}
+
int eo_parse_parseinstance(const CMPIBroker *broker,
CMPIInstance **instance,
const char *ns)
15 years, 5 months
[PATCH] [TEST] Modifying ResourcePool/01_enum.py to accomodate verifying Parent DiskPool and NetworkPool
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1243430368 25200
# Node ID 30ce5799fb9abed46b528e70ad81b4242a801f05
# Parent e5fd77170913c3819d667e240c9873efa3bf0d07
[TEST] Modifying ResourcePool/01_enum.py to accomodate verifying Parent DiskPool and NetworkPool.
Tested with KVM on F10 with current sources.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r e5fd77170913 -r 30ce5799fb9a suites/libvirt-cim/cimtest/ResourcePool/01_enum.py
--- a/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Thu May 21 04:21:15 2009 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Wed May 27 06:19:28 2009 -0700
@@ -30,8 +30,7 @@
from XenKvmLib.enumclass import EnumInstances
from XenKvmLib.classes import get_typed_class
from XenKvmLib import vxml
-from CimTest import Globals
-from CimTest.Globals import logger
+from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
from XenKvmLib.const import do_main, default_pool_name
from CimTest.ReturnCodes import PASS, FAIL, SKIP
from XenKvmLib.xm_virt_util import net_list
@@ -56,8 +55,8 @@
netxml = vxml.NetXML(server, bridgename, test_network, virt)
ret = netxml.create_vnet()
if not ret:
- logger.error("Failed to create the Virtual Network '%s'", \
- test_network)
+ logger.error("Failed to create the Virtual Network '%s'",
+ test_network)
return SKIP, None
disk_instid = '%s/%s' % (dp_cn, default_pool_name)
@@ -77,25 +76,30 @@
logger.error("Returned %s instead of %s", ret_value, exp_value)
def verify_fields(pool_list, poolname, cn):
- status = PASS
if len(poolname) < 1:
logger.error("%s return %i instances, expected atleast 1 instance",
cn, len(poolname))
return FAIL
- exp_value = pool_list[cn][0]
+
for i in range(0, len(poolname)):
- ret_value = poolname[i].InstanceID
- if ret_value == exp_value:
- break
- elif ret_value != exp_value and i == len(poolname)-1:
- print_error('InstanceID', ret_value, exp_value)
- status = FAIL
- ret_value = poolname[0].ResourceType
- exp_value = pool_list[cn][1]
- if ret_value != exp_value:
- print_error('ResourceType', ret_value, exp_value)
- status = FAIL
- return status
+
+ rtype_ret_value = poolname[i].ResourceType
+ rtype_exp_value = pool_list[cn][1]
+ if rtype_ret_value != rtype_exp_value:
+ print_error('ResourceType', rtype_ret_value, rtype_exp_value)
+ return FAIL
+
+ inst_ret_value = poolname[i].InstanceID
+ inst_exp_value = pool_list[cn][0]
+ if "DiskPool/0" == inst_ret_value or "NetworkPool/0" == inst_ret_value:
+ if poolname[i].Primordial != True:
+ print_error('Primordial', poolname[i].Primordial, "True")
+ return FAIL
+ elif inst_ret_value != inst_exp_value and i == len(poolname)-1:
+ print_error('InstanceID', inst_ret_value, inst_exp_value)
+ return FAIL
+
+ return PASS
@do_main(sup_types)
@@ -113,38 +117,23 @@
mp = get_typed_class(virt, mp_cn)
pp = get_typed_class(virt, pp_cn)
- dp = get_typed_class(virt, dp_cn)
- np = get_typed_class(virt, np_cn)
+ cn_list = [ mp, pp ]
+ if virt != 'LXC':
+ dp = get_typed_class(virt, dp_cn)
+ np = get_typed_class(virt, np_cn)
+ cn_list.append(dp)
+ cn_list.append(np)
- try:
- mempool = EnumInstances(ip, mp)
- except Exception:
- logger.error(Globals.CIM_ERROR_ENUMERATE, mp)
- return FAIL
- status = verify_fields(pool_list, mempool, mp)
-
- try:
- propool = EnumInstances(ip, pp)
- except Exception:
- logger.error(Globals.CIM_ERROR_ENUMERATE, pp)
- return FAIL
- status = verify_fields(pool_list, propool, pp)
-
- if virt != 'LXC':
+ for cn in cn_list:
try:
- diskpool = EnumInstances(ip, dp)
- except Exception:
- logger.error(Globals.CIM_ERROR_ENUMERATE, dp)
+ pool = EnumInstances(ip, cn)
+ except Exception, details:
+ logger.error(CIM_ERROR_ENUMERATE, cn)
+ logger.error("Exception details: %s", details)
return FAIL
- status = verify_fields(pool_list, diskpool, dp)
-
- try:
- netpool = EnumInstances(ip, np)
- except Exception:
- logger.error(Globals.CIM_ERROR_ENUMERATE, np)
- return FAIL
- status = verify_fields(pool_list, netpool, np)
-
+ status = verify_fields(pool_list, pool, cn)
+ if status != PASS:
+ return status
return status
if __name__ == "__main__":
15 years, 5 months
[PATCH 0 of 4] Adding tc to verify creation/deletion of DiskPool.
by Deepti B. Kalakeri
The patchset includes new tc to cover the creation and deletion of DiskPool.
It also includes the changes to RPCS/04_CreateChildResourcePool.py and RPCS/07_DeleteChildResourcePool.py to align
with the create_pool() and verify_pool() changes.
This test case should be applied on top of
"(#2) Return SKIP if the provider version doesn't support template pool RASDs"
Tested with KVM on F10 with current sources.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
15 years, 5 months