[PATCH] [TEST] Fix VSMS 15 - need to pass cxml to power_down_guest()
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1258679326 28800
# Node ID 8c635edef727257682ec9f3e5a21d52bf0c39887
# Parent ed5aa34e2a1fdd5b020015b22ee633d5b61a7a0f
[TEST] Fix VSMS 15 - need to pass cxml to power_down_guest()
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r ed5aa34e2a1f -r 8c635edef727 suites/libvirt-cim/cimtest/VirtualSystemManagementService/15_mod_system_settings.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/15_mod_system_settings.py Wed Nov 18 13:39:37 2009 -0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/15_mod_system_settings.py Thu Nov 19 17:08:46 2009 -0800
@@ -65,7 +65,7 @@
return PASS, inst
-def power_down_guest(ip, virt, dom):
+def power_down_guest(ip, virt, dom, cxml):
rev, changeset = get_provider_version(virt, ip)
if rev < disable_change_rev and virt == "KVM":
@@ -125,7 +125,8 @@
raise Exception("Failed to modify dom: %s" % default_dom)
if case == "start":
- status = power_down_guest(options.ip, options.virt, default_dom)
+ status = power_down_guest(options.ip, options.virt, default_dom,
+ cxml)
if status != PASS:
raise Exception("Unable to disable %s" % default_dom)
14 years, 10 months
[PATCH] [TEST] Fix CSIndication and CSMigrationIndication test to prevent test hang
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1259190534 28800
# Node ID e369bd94cf37d5243d3e20b3b9920873b73c2fb3
# Parent 6beff15b1ec783d6d09e1ece57d1ba0be0a8e490
[TEST] Fix CSIndication and CSMigrationIndication test to prevent test hang
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 6beff15b1ec7 -r e369bd94cf37 suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py
--- a/suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py Wed Nov 25 10:12:19 2009 -0800
+++ b/suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py Wed Nov 25 15:08:54 2009 -0800
@@ -169,6 +169,9 @@
raise Exception("Unable to generate indication")
status = poll_for_ind(pid, ind)
+ if status != PASS:
+ raise Exception("Poll for indication Failed")
+
except Exception, details:
kill(pid, SIGKILL)
raise Exception(details)
diff -r 6beff15b1ec7 -r e369bd94cf37 suites/libvirt-cim/cimtest/ComputerSystemMigrationJobIndication/01_csmig_ind_for_offline_mig.py
--- a/suites/libvirt-cim/cimtest/ComputerSystemMigrationJobIndication/01_csmig_ind_for_offline_mig.py Wed Nov 25 10:12:19 2009 -0800
+++ b/suites/libvirt-cim/cimtest/ComputerSystemMigrationJobIndication/01_csmig_ind_for_offline_mig.py Wed Nov 25 15:08:54 2009 -0800
@@ -166,6 +166,9 @@
raise Exception("Unable to generate indication")
status = poll_for_ind(pid, ind_name)
+ if status != PASS:
+ raise Exception("Poll for indication Failed")
+
except Exception, details:
kill(pid, SIGKILL)
raise Exception(details)
14 years, 10 months
[PATCH] [TEST] Change create_diskpool() to use virsh pool-info
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1258750445 28800
# Node ID 269167924d0e969ff190fde80596033c28f414a7
# Parent ed3a9593a2acb7fc7ac124666d873d51e3c315fd
[TEST] Change create_diskpool() to use virsh pool-info
Instead of checking the output of pool-list. pool-info will return a error if
the guest isn't found. You can run into a problem checking the output of
virsh pool-list is libvirt returns extra debug messages (etc).
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r ed3a9593a2ac -r 269167924d0e suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Thu Nov 19 03:51:03 2009 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Fri Nov 20 12:54:05 2009 -0800
@@ -341,10 +341,9 @@
dpoolname=dpool_list[0]
if dpoolname == None:
- cmd = "virsh -c %s pool-list --all | grep %s" % \
- (virt2uri(virt), dpool)
+ cmd = "virsh -c %s pool-info %s" % (virt2uri(virt), dpool)
ret, out = utils.run_remote(server, cmd)
- if out != "":
+ if ret == 0:
logger.error("Disk pool with name '%s' already exists", dpool)
return FAIL, "Unknown"
14 years, 10 months
[PATCH] [TEST] (#2) LXC currently doesn't support VNC, so skip appropriated tests
by Richard Maciel
# HG changeset patch
# User Richard Maciel <rmaciel(a)linux.vnet.ibm.com>
# Date 1259357082 7200
# Node ID 9e0d6ff3f5f6ec6653059ef1422ed6b70f8728f5
# Parent 5467bdbfdaf8a3716cbbf489410b15025b23c7ce
[TEST] (#2) LXC currently doesn't support VNC, so skip appropriated tests
#2:
- Added missing testcase fix
Signed-off-by: Richard Maciel <rmaciel(a)linux.vnet.ibm.com>
diff -r 5467bdbfdaf8 -r 9e0d6ff3f5f6 suites/libvirt-cim/cimtest/HostedAccessPoint/01_forward.py
--- a/suites/libvirt-cim/cimtest/HostedAccessPoint/01_forward.py Wed Nov 25 18:45:49 2009 -0200
+++ b/suites/libvirt-cim/cimtest/HostedAccessPoint/01_forward.py Fri Nov 27 19:24:42 2009 -0200
@@ -110,6 +110,10 @@
"skipping the tc ....")
return SKIP
+ if options.virt == 'LXC':
+ logger.info("VNC is not supported by LXC, hence skipping the "
+ "tc ....")
+ return SKIP
status, cxml = setup_env(options.ip, options.virt)
if status != PASS:
diff -r 5467bdbfdaf8 -r 9e0d6ff3f5f6 suites/libvirt-cim/cimtest/HostedAccessPoint/02_reverse.py
--- a/suites/libvirt-cim/cimtest/HostedAccessPoint/02_reverse.py Wed Nov 25 18:45:49 2009 -0200
+++ b/suites/libvirt-cim/cimtest/HostedAccessPoint/02_reverse.py Fri Nov 27 19:24:42 2009 -0200
@@ -116,6 +116,11 @@
logger.info("'HostedAccessPoint' provider not supported, hence " +
"skipping the tc ....")
return SKIP
+
+ if options.virt == 'LXC':
+ logger.info("VNC is not supported by LXC, hence skipping the "
+ "tc ....")
+ return SKIP
status, cxml = setup_env(options.ip, options.virt)
if status != PASS:
diff -r 5467bdbfdaf8 -r 9e0d6ff3f5f6 suites/libvirt-cim/cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py
--- a/suites/libvirt-cim/cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py Wed Nov 25 18:45:49 2009 -0200
+++ b/suites/libvirt-cim/cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py Fri Nov 27 19:24:42 2009 -0200
@@ -100,6 +100,11 @@
classname)
return SKIP
+ if virt == 'LXC':
+ logger.info("VNC is not supported by LXC, hence skipping the "
+ "tc ....")
+ return SKIP
+
vsxml = None
action_start = False
diff -r 5467bdbfdaf8 -r 9e0d6ff3f5f6 suites/libvirt-cim/cimtest/RedirectionService/03_RedirectionSAP_errs.py
--- a/suites/libvirt-cim/cimtest/RedirectionService/03_RedirectionSAP_errs.py Wed Nov 25 18:45:49 2009 -0200
+++ b/suites/libvirt-cim/cimtest/RedirectionService/03_RedirectionSAP_errs.py Fri Nov 27 19:24:42 2009 -0200
@@ -76,6 +76,11 @@
"hence skipping the test ....")
return SKIP
+ if options.virt == 'LXC':
+ logger.info("VNC is not supported by LXC, hence skipping the "
+ "tc ....")
+ return SKIP
+
# Getting the VS list and deleting the test_dom if it already exists.
cxml = vxml.get_class(options.virt)(test_dom, vcpus=test_vcpus)
ret = cxml.cim_define(options.ip)
diff -r 5467bdbfdaf8 -r 9e0d6ff3f5f6 suites/libvirt-cim/cimtest/VirtualSystemManagementService/20_verify_vnc_password.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/20_verify_vnc_password.py Wed Nov 25 18:45:49 2009 -0200
+++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/20_verify_vnc_password.py Fri Nov 27 19:24:42 2009 -0200
@@ -76,6 +76,11 @@
logger.info("VNC Password support not available, feature available in"\
" '%s' revision..", libvirtcim_vnc_passwd_changes)
return SKIP
+
+ if virt == 'LXC':
+ logger.info("VNC is not supported by LXC, hence skipping the "
+ "tc ....")
+ return SKIP
cxml = vxml.get_class(virt)(default_dom, vnc_passwd=passwd)
14 years, 10 months
[PATCH] Fix AddResourceSettings() so it returns ResultingResourceSettings[ ] result
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1259107270 28800
# Node ID 58b4cf70770e931f7517c5555e8c1bbc72df4bd2
# Parent e736e9f7808ee568704572c3e3f6c62ae26f3baf
Fix AddResourceSettings() so it returns ResultingResourceSettings[ ] result
AddResourceSettings() should be returning ResultingResourceSettings[ ] as an
output parameter.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r e736e9f7808e -r 58b4cf70770e src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Wed Nov 11 17:20:17 2009 -0800
+++ b/src/Virt_VirtualSystemManagementService.c Tue Nov 24 16:01:10 2009 -0800
@@ -2388,7 +2388,8 @@
const char *domain,
CMPIArray *resources,
const CMPIResult *results,
- resmod_fn func)
+ resmod_fn func,
+ struct inst_list *list)
{
int i;
virConnectPtr conn = NULL;
@@ -2454,6 +2455,7 @@
if (s.rc != CMPI_RC_OK)
break;
+ inst_list_add(list, inst);
}
out:
if (s.rc == CMPI_RC_OK)
@@ -2527,6 +2529,48 @@
return s;
}
+static CMPIArray *set_result_res(struct inst_list *list,
+ const char *ns)
+{
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+ CMPIObjectPath *op = NULL;
+ CMPIArray *res = NULL;
+ int i = 0;
+
+ if (list->cur == 0) {
+ CU_DEBUG("No resources were added or modified");
+ return res;
+ }
+
+ res = CMNewArray(_BROKER, list->cur, CMPI_ref, &s);
+ if ((s.rc != CMPI_RC_OK) || (res == NULL)) {
+ CU_DEBUG("Unable to create results array");
+ goto out;
+ }
+
+ for (i = 0; list->list[i] != NULL; i++) {
+ op = CMGetObjectPath(list->list[i], NULL);
+ if (op == NULL) {
+ CU_DEBUG("Unable to RASD reference");
+ goto out;
+ }
+
+ CMSetNameSpace(op, ns);
+
+ s = CMSetArrayElementAt(res, i, (CMPIValue *)&op, CMPI_ref);
+ if (s.rc != CMPI_RC_OK) {
+ CU_DEBUG("Error setting results array element");
+ goto out;
+ }
+ }
+
+ out:
+ if (s.rc != CMPI_RC_OK)
+ res = NULL;
+
+ return res;
+}
+
static CMPIStatus add_resource_settings(CMPIMethodMI *self,
const CMPIContext *context,
const CMPIResult *results,
@@ -2538,6 +2582,10 @@
CMPIStatus s;
CMPIObjectPath *sys;
char *domain = NULL;
+ CMPIArray *res = NULL;
+ struct inst_list list;
+
+ inst_list_init(&list);
if (cu_get_array_arg(argsin, "ResourceSettings", &arr) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
@@ -2567,10 +2615,17 @@
domain,
arr,
results,
- resource_add);
-
+ resource_add,
+ &list);
+
free(domain);
+ res = set_result_res(&list, NAMESPACE(reference));
+
+ inst_list_free(&list);
+
+ CMAddArg(argsout, "ResultingResourceSettings", &res, CMPI_refA);
+
return s;
}
@@ -2583,6 +2638,10 @@
{
CMPIArray *arr;
CMPIStatus s;
+ CMPIArray *res = NULL;
+ struct inst_list list;
+
+ inst_list_init(&list);
if (cu_get_array_arg(argsin, "ResourceSettings", &arr) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
@@ -2591,12 +2650,21 @@
return s;
}
- return _update_resource_settings(context,
- reference,
- NULL,
- arr,
- results,
- resource_mod);
+ s = _update_resource_settings(context,
+ reference,
+ NULL,
+ arr,
+ results,
+ resource_mod,
+ &list);
+
+ res = set_result_res(&list, NAMESPACE(reference));
+
+ inst_list_free(&list);
+
+ CMAddArg(argsout, "ResultingResourceSettings", &res, CMPI_refA);
+
+ return s;
}
static CMPIStatus rm_resource_settings(CMPIMethodMI *self,
@@ -2613,6 +2681,9 @@
CMPIArray *arr;
CMPIArray *resource_arr;
CMPIStatus s;
+ struct inst_list list;
+
+ inst_list_init(&list);
if (cu_get_array_arg(argsin, "ResourceSettings", &arr) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
@@ -2630,8 +2701,11 @@
NULL,
resource_arr,
results,
- resource_del);
+ resource_del,
+ &list);
out:
+ inst_list_free(&list);
+
return s;
}
14 years, 10 months
[PATCH] [TEST] LXC currently doesn't support VNC, so skip appropriated tests
by Richard Maciel
# HG changeset patch
# User Richard Maciel <rmaciel(a)linux.vnet.ibm.com>
# Date 1259350970 7200
# Node ID 9ca46beaa8430120fc30b33bca21be4d5ed1a961
# Parent 5467bdbfdaf8a3716cbbf489410b15025b23c7ce
[TEST] LXC currently doesn't support VNC, so skip appropriated tests
Signed-off-by: Richard Maciel <rmaciel(a)linux.vnet.ibm.com>
diff -r 5467bdbfdaf8 -r 9ca46beaa843 suites/libvirt-cim/cimtest/HostedAccessPoint/01_forward.py
--- a/suites/libvirt-cim/cimtest/HostedAccessPoint/01_forward.py Wed Nov 25 18:45:49 2009 -0200
+++ b/suites/libvirt-cim/cimtest/HostedAccessPoint/01_forward.py Fri Nov 27 17:42:50 2009 -0200
@@ -110,6 +110,10 @@
"skipping the tc ....")
return SKIP
+ if options.virt == 'LXC':
+ logger.info("VNC is not supported by LXC, hence skipping the "
+ "tc ....")
+ return SKIP
status, cxml = setup_env(options.ip, options.virt)
if status != PASS:
diff -r 5467bdbfdaf8 -r 9ca46beaa843 suites/libvirt-cim/cimtest/HostedAccessPoint/02_reverse.py
--- a/suites/libvirt-cim/cimtest/HostedAccessPoint/02_reverse.py Wed Nov 25 18:45:49 2009 -0200
+++ b/suites/libvirt-cim/cimtest/HostedAccessPoint/02_reverse.py Fri Nov 27 17:42:50 2009 -0200
@@ -116,6 +116,11 @@
logger.info("'HostedAccessPoint' provider not supported, hence " +
"skipping the tc ....")
return SKIP
+
+ if options.virt == 'LXC':
+ logger.info("VNC is not supported by LXC, hence skipping the "
+ "tc ....")
+ return SKIP
status, cxml = setup_env(options.ip, options.virt)
if status != PASS:
diff -r 5467bdbfdaf8 -r 9ca46beaa843 suites/libvirt-cim/cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py
--- a/suites/libvirt-cim/cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py Wed Nov 25 18:45:49 2009 -0200
+++ b/suites/libvirt-cim/cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py Fri Nov 27 17:42:50 2009 -0200
@@ -100,6 +100,11 @@
classname)
return SKIP
+ if virt == 'LXC':
+ logger.info("VNC is not supported by LXC, hence skipping the "
+ "tc ....")
+ return SKIP
+
vsxml = None
action_start = False
diff -r 5467bdbfdaf8 -r 9ca46beaa843 suites/libvirt-cim/cimtest/RedirectionService/03_RedirectionSAP_errs.py
--- a/suites/libvirt-cim/cimtest/RedirectionService/03_RedirectionSAP_errs.py Wed Nov 25 18:45:49 2009 -0200
+++ b/suites/libvirt-cim/cimtest/RedirectionService/03_RedirectionSAP_errs.py Fri Nov 27 17:42:50 2009 -0200
@@ -76,6 +76,11 @@
"hence skipping the test ....")
return SKIP
+ if options.virt == 'LXC':
+ logger.info("VNC is not supported by LXC, hence skipping the "
+ "tc ....")
+ return SKIP
+
# Getting the VS list and deleting the test_dom if it already exists.
cxml = vxml.get_class(options.virt)(test_dom, vcpus=test_vcpus)
ret = cxml.cim_define(options.ip)
14 years, 10 months
[PATCH] [TEST] Changed expected image path to match the correct one
by Richard Maciel
# HG changeset patch
# User Richard Maciel <rmaciel(a)linux.vnet.ibm.com>
# Date 1259181949 7200
# Node ID 5467bdbfdaf8a3716cbbf489410b15025b23c7ce
# Parent ed3a9593a2acb7fc7ac124666d873d51e3c315fd
[TEST] Changed expected image path to match the correct one
Signed-off-by: Richard Maciel <rmaciel(a)linux.vnet.ibm.com>
diff -r ed3a9593a2ac -r 5467bdbfdaf8 suites/libvirt-cim/lib/XenKvmLib/rasd.py
--- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Thu Nov 19 03:51:03 2009 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Wed Nov 25 18:45:49 2009 -0200
@@ -77,7 +77,7 @@
disk_path = vsxml.xml_get_disk_source()
if virt == 'LXC':
- disk_path = '/tmp/lxc_files'
+ disk_path = '/var/lib/libvirt/images/lxc_files'
libvirt_version = virsh_version(server, virt)
14 years, 10 months
[PATCH] [TEST] #2 Adding new tc to verify Libvirt-CIM profile advertisement via slp
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.ibm.com>
# Date 1259174831 28800
# Node ID ca05ea85f30bd3ca9468ebd892d21e68fe831605
# Parent ed3a9593a2acb7fc7ac124666d873d51e3c315fd
[TEST] #2 Adding new tc to verify Libvirt-CIM profile advertisement via slp.
Patch 2:
--------
1) Used gethostname() and gethostbyname() to get the ip address when localhost value is passed through commandline
2) Changed the suggested return stmts to SKIP
3) Removed the else part to save indentation
4) Improved the verification of slptool exsistence
5) Removed findsrvs and directly used findattrs
Tested with KVM and current sources on rhel5.4.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r ed3a9593a2ac -r ca05ea85f30b suites/libvirt-cim/cimtest/Profile/04_verify_libvirt_cim_slp_profiles.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/cimtest/Profile/04_verify_libvirt_cim_slp_profiles.py Wed Nov 25 10:47:11 2009 -0800
@@ -0,0 +1,167 @@
+#! /usr/bin/python
+#
+# Copyright 2009 IBM Corp.
+#
+# Authors:
+# Deepti B. Kalakeri <dkalaker(a)in.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
+#
+# The following test case is used to verify the profiles registered by
+# Libvirt-CIM are advertised via slp tool.
+#
+# Date : 20-10-2009
+
+import sys
+import os
+import string
+from sets import Set
+from socket import gethostbyaddr, gethostname, gethostbyname
+from VirtLib.utils import run_remote
+from XenKvmLib import enumclass
+from XenKvmLib.classes import get_typed_class
+from CimTest import Globals
+from CimTest.Globals import logger
+from XenKvmLib.const import do_main
+from CimTest.ReturnCodes import PASS, FAIL, SKIP
+
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
+def get_slp_info(server):
+
+ cmd = "slptool help"
+ rc, out = run_remote(server, cmd)
+ if rc != 0:
+ # Check if slptool exist in non-standard path
+ cmd = "whereis slptool"
+ rc, out = run_remote(server, cmd)
+ slp_path = out.split(":")
+ if slp_path[1] == '':
+ logger.error("SLP tool does not exist on the machine ")
+ return SKIP
+
+ logger.info("Slp tool found on the machine ....")
+
+ # The test is written to work with Pegasus for now.
+ # In future we can include sfcb support as well
+ # When sfcb support will be planned then replace the following check
+ # with check_cimom() fn of common_util.py lib
+ cmd = "ps -ef | grep -v grep | grep cimserver"
+ rc, out = run_remote(server, cmd)
+ if rc != 0:
+ logger.info("cimserver not found on '%s'", server)
+ logger.info("Test not supported for sfcb yet ... hence skipping")
+ return SKIP
+
+ cmd = "cimconfig -l -p | grep slp"
+ rc, out = run_remote(server, cmd)
+ if rc != 0:
+ logger.error("SLP is not enabled for the cimserver on '%s'", server)
+ return SKIP
+
+ return PASS
+
+def get_slp_attrs(server):
+ slp_attrs = None
+
+ cmd = "slptool findattrs service:wbem:http://%s:5988" % server
+ rc, slp_attrs = run_remote(server, cmd)
+ if len(slp_attrs) != 0:
+ return PASS, slp_attrs
+
+ return FAIL, slp_attrs
+
+def filter_reg_name_from_slp(slp_attrs):
+ slp_profile_list = []
+
+ for line in slp_attrs.split('\n'):
+ lines = line.split("RegisteredProfilesSupported")
+ dmtf_profiles = lines[1].split("DMTF")
+ for profile in dmtf_profiles:
+ temp_reg_ele = profile.rsplit(":", 1)[1].rstrip(",")
+ reg_prof_name = temp_reg_ele.rstrip(")")
+ slp_profile_list.append(reg_prof_name)
+
+ slp_profile_list = Set(slp_profile_list)
+
+ return slp_profile_list
+
+def get_libvirt_cim_profile_info(server, virt):
+ libvirt_cim_reg_list = None
+ status = FAIL
+ prev_namespace = Globals.CIM_NS
+ Globals.CIM_NS = 'root/interop'
+ cn = get_typed_class(virt, 'RegisteredProfile')
+
+ try:
+ proflist = enumclass.EnumInstances(server, cn)
+ except Exception, detail:
+ logger.error(CIM_ERROR_ENUMERATE, get_typed_class(virt, cn))
+ logger.error("Exception: %s", detail)
+ Globals.CIM_NS = prev_namespace
+ return status, libvirt_cim_reg_list
+
+ Globals.CIM_NS = prev_namespace
+
+ libvirt_cim_reg_list = Set([str(x.RegisteredName) for x in proflist])
+ if len(libvirt_cim_reg_list) != 0:
+ status = PASS
+
+ return status, libvirt_cim_reg_list
+
+
+@do_main(sup_types)
+def main():
+ options = main.options
+ server = options.ip
+ virt = options.virt
+ status = FAIL
+
+ status = get_slp_info(server)
+ if status != PASS:
+ return status
+
+ # Making sure that the server information passed is
+ # hostname or ip address
+ if server == "localhost":
+ host = gethostname()
+ ip_addr = gethostbyname(host)
+ else:
+ ip_addr = gethostbyaddr(server)[2][0]
+
+ status, slp_attrs = get_slp_attrs(ip_addr)
+ if status != PASS:
+ logger.error("Failed to get slp attributes on %s", server)
+ return status
+
+ slp_profile_list = filter_reg_name_from_slp(slp_attrs)
+
+ status, libvirt_cim_reg_list = get_libvirt_cim_profile_info(server, virt)
+ if status != PASS:
+ logger.error("Failed to enumerate profile information on %s", server)
+ return status
+
+ # Make sure all the Libvirt-CIM profiles are advertised via slp
+ if (libvirt_cim_reg_list) <= (slp_profile_list):
+ logger.info("Successfully verified the Libvirt-CIM profiles")
+ return PASS
+
+ logger.error("Mismatch in the profiles registered")
+ logger.error("Slp returned profile --> %s,\n Libvirt-CIM expected "
+ "profiles %s", slp_profile_list, libvirt_cim_reg_list)
+ return FAIL
+
+if __name__=="__main__":
+ sys.exit(main())
+
14 years, 10 months