[PATCH] Add virNetworkFree() to _netpool_for_network()
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1208393449 25200
# Node ID e5f5f60842199395981f163b127bd587ade960d6
# Parent 7c49e519c188c83b2c53866101eb64900fb41fd2
Add virNetworkFree() to _netpool_for_network().
Also, fix up the spots where an error is returned. The style here doesn't match the rest of the file.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 7c49e519c188 -r e5f5f6084219 src/Virt_DevicePool.c
--- a/src/Virt_DevicePool.c Wed Apr 16 16:55:52 2008 -0700
+++ b/src/Virt_DevicePool.c Wed Apr 16 17:50:49 2008 -0700
@@ -652,6 +652,7 @@
const char *refcn,
const CMPIBroker *broker)
{
+ CMPIStatus s = {CMPI_RC_OK, NULL};
char *str = NULL;
char *bridge = NULL;
uint16_t type = CIM_RES_TYPE_NET;
@@ -661,12 +662,10 @@
CU_DEBUG("Looking up network `%s'", netname);
network = virNetworkLookupByName(conn, netname);
if (network == NULL) {
- CMPIStatus s;
-
cu_statusf(broker, &s,
CMPI_RC_ERR_FAILED,
"No such NetworkPool: %s", netname);
- return s;
+ goto out;
}
inst = get_typed_instance(broker,
@@ -674,26 +673,32 @@
"NetworkPool",
ns);
if (inst == NULL) {
- CMPIStatus s;
-
CU_DEBUG("Unable to get instance: %s:%s_NetworkPool",
ns, refcn);
cu_statusf(broker, &s,
CMPI_RC_ERR_FAILED,
"Error getting pool instance");
- return s;
+ goto out;
}
- if (asprintf(&str, "NetworkPool/%s", netname) == -1)
- return (CMPIStatus){CMPI_RC_ERR_FAILED, NULL};
+ if (asprintf(&str, "NetworkPool/%s", netname) == -1) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "");
+ goto out;
+ }
CMSetProperty(inst, "InstanceID",
(CMPIValue *)str, CMPI_chars);
free(str);
bridge = virNetworkGetBridgeName(network);
- if (asprintf(&str, "Bridge: %s", bridge) == -1)
- return (CMPIStatus){CMPI_RC_ERR_FAILED, NULL};
+ if (asprintf(&str, "Bridge: %s", bridge) == -1) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "");
+ goto out;
+ }
CMSetProperty(inst, "Caption",
(CMPIValue *)str, CMPI_chars);
@@ -706,7 +711,10 @@
inst_list_add(list, inst);
- return (CMPIStatus){CMPI_RC_OK, NULL};
+ out:
+ virNetworkFree(network);
+
+ return s;
}
static CMPIStatus netpool_instance(virConnectPtr conn,
16 years, 6 months
[PATCH] Add const to variable in _net_rand_mac()
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1208390152 25200
# Node ID 7c49e519c188c83b2c53866101eb64900fb41fd2
# Parent 609d9eb2ab4dec6611d856746a12d1e8f25e1963
Add const to variable in _net_rand_mac()
Saw compile issues with gcc-4.3.0-6. Unfortunately, this makes less succinct.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 609d9eb2ab4d -r 7c49e519c188 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Wed Apr 16 15:24:36 2008 -0700
+++ b/src/Virt_SettingsDefineCapabilities.c Wed Apr 16 16:55:52 2008 -0700
@@ -438,14 +438,15 @@
int r;
int ret;
unsigned int s;
- char *mac = NULL;
+ char *tmp_mac = NULL;
+ const char *mac = NULL;
CMPIString *str = NULL;
CMPIStatus status;
srand(time(NULL));
r = rand_r(&s);
- ret = asprintf(&mac,
+ ret = asprintf(&tmp_mac,
"%s:%02x:%02x:%02x",
DEFAULT_MAC_PREFIX,
r & 0xFF,
@@ -455,14 +456,14 @@
if (ret == -1)
goto out;
- str = CMNewString(_BROKER, mac, &status);
+ str = CMNewString(_BROKER, tmp_mac, &status);
if ((str == NULL) || (status.rc != CMPI_RC_OK)) {
str = NULL;
CU_DEBUG("Failed to create string");
goto out;
}
out:
- free(mac);
+ free(tmp_mac);
if (str != NULL)
mac = CMGetCharPtr(str);
16 years, 6 months
[PATCH] Add a user-friendly Caption field to DiskPool for display purposes
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1208369293 25200
# Node ID f7e2c322ac0ab1d109192a362d508ca4a2a87310
# Parent 5c4ec6bc6f409e9a892f786cc7b7d32152fdc5a6
Add a user-friendly Caption field to DiskPool for display purposes
for now, just make the Caption the tag field, which is the pool name
if using libvirt's storage API, otherwise the tag in the pool config file.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 5c4ec6bc6f40 -r f7e2c322ac0a src/Virt_DevicePool.c
--- a/src/Virt_DevicePool.c Wed Apr 16 08:28:12 2008 -0700
+++ b/src/Virt_DevicePool.c Wed Apr 16 11:08:13 2008 -0700
@@ -786,6 +786,9 @@ static CMPIInstance *diskpool_from_path(
CMSetProperty(inst, "AllocationUnits",
(CMPIValue *)"Megabytes", CMPI_chars);
+ CMSetProperty(inst, "Caption",
+ (CMPIValue *)pool->tag, CMPI_chars);
+
if (!diskpool_set_capacity(conn, inst, pool))
CU_DEBUG("Failed to set capacity for disk pool: %s",
pool->tag);
16 years, 6 months
[PATCH] Make sure to create a default emulator device for XenFV domains
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1208293325 25200
# Node ID f01fe8c3d7b72fb89ebfa8981f2d1fafe8066df7
# Parent 40f221d14476a2817a1e80a34b5c56189500db6c
Make sure to create a default emulator device for XenFV domains
This adds the emulator device in once we go to create the actual domain
object (and thus determine if the type necessitates an <emulator>.
This should fix definesystem on XenFV, although some other things
surrounding the NetRASD stuff in progress now may prevent regular testing
of it.
Changes:
- Use bool values instead of ints
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 40f221d14476 -r f01fe8c3d7b7 configure.ac
--- a/configure.ac Tue Apr 15 14:33:50 2008 -0400
+++ b/configure.ac Tue Apr 15 14:02:05 2008 -0700
@@ -87,6 +87,13 @@ AC_SUBST(MIG_CHECKS_DIR)
AC_SUBST(MIG_CHECKS_DIR)
AC_DEFINE_UNQUOTED(MIG_CHECKS_DIR, "$MIG_CHECKS_DIR", [External migration check timeout])
+AC_ARG_WITH([xen_emulator],
+ [ --with-xen_emulator=emu Location of Xen FullVirt emulator],
+ [test "x$withval" != "x" && XEN_EMULATOR="$withval"],
+ [XEN_EMULATOR=/usr/lib/xen/bin/qemu-dm])
+AC_SUBST(XEN_EMULATOR)
+AC_DEFINE_UNQUOTED(XEN_EMULATOR, "$XEN_EMULATOR", [Location of Xen FullVirt emulator])
+
# Autogenerate the autoconf header file to store build settings
AC_CONFIG_HEADER([config.h])
diff -r 40f221d14476 -r f01fe8c3d7b7 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Tue Apr 15 14:33:50 2008 -0400
+++ b/src/Virt_VirtualSystemManagementService.c Tue Apr 15 14:02:05 2008 -0700
@@ -50,6 +50,8 @@
#include "Virt_DevicePool.h"
#include "svpc_types.h"
+#include "config.h"
+
const static CMPIBroker *_BROKER;
enum ResourceAction {
@@ -122,6 +124,25 @@ static int xenpv_vssd_to_domain(CMPIInst
return 1;
}
+static bool fv_default_emulator(struct domain *domain)
+{
+ const char *emul = XEN_EMULATOR;
+
+ cleanup_virt_device(domain->dev_emu);
+
+ domain->dev_emu = calloc(1, sizeof(*domain->dev_emu));
+ if (domain->dev_emu == NULL) {
+ CU_DEBUG("Failed to allocate default emulator device");
+ return false;
+ }
+
+ domain->dev_emu->type = CIM_RES_TYPE_EMU;
+ domain->dev_emu->dev.emu.path = strdup(emul);
+ domain->dev_emu->id = strdup("emulator");
+
+ return true;
+}
+
static int fv_vssd_to_domain(CMPIInstance *inst,
struct domain *domain,
const char *pfx)
@@ -129,11 +150,13 @@ static int fv_vssd_to_domain(CMPIInstanc
int ret;
const char *val;
- if (STREQC(pfx, "KVM"))
+ if (STREQC(pfx, "KVM")) {
domain->type = DOMAIN_KVM;
- else if (STREQC(pfx, "Xen"))
+ } else if (STREQC(pfx, "Xen")) {
domain->type = DOMAIN_XENFV;
- else {
+ if (!fv_default_emulator(domain))
+ return 0;
+ } else {
CU_DEBUG("Unknown fullvirt domain type: %s", pfx);
return 0;
}
16 years, 6 months
CimTest Report on XenFV 16-04-2008
by Deepti B Kalakeri
======================================
CIM Test Report for XenFV
======================================
Distro : RHEL 5.2 Beta
Kernel : 2.6.18-88.el5xen
Xen version : 3.1.2-88.el5
Libvirt : libvirt-0.3.3-7.el5
CIMOM : pegasus
PyWBEM : pywbem-3.14
CIM Schema : cimv216Experimental
LibCMPIutil : 72
LibVirtCIM : 545
CIMTEST : 85
======================================
PASS : 54
FAIL : 45 (Test cases FAIL because of finally issue: 19 )
XFAIL : 2
SKIP : 30
-----------------
Total : 129
======================================
Detailed Report
================
Cleaned log files.
Testing XenFV hypervisor
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: FAIL
ComputerSystem - 04_defineStartVS.py: FAIL
ComputerSystem - 05_activate_defined_start.py: XFAIL Bug: 85769
ComputerSystem - 06_paused_active_suspend.py: FAIL
InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain not running
ComputerSystem - 22_define_suspend.py: PASS
ComputerSystem - 23_suspend_suspend.py: FAIL
File "23_suspend_suspend.py", line 118
finally:
^
SyntaxError: invalid syntax
ComputerSystem - 27_define_suspend_errs.py: FAIL
InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Required field `Address' missing from NetRASD
ComputerSystem - 32_start_reboot.py: FAIL
File "32_start_reboot.py", line 117
finally:
^
SyntaxError: invalid syntax
ComputerSystem - 33_suspend_reboot.py: FAIL
File "33_suspend_reboot.py", line 121
finally:
^
SyntaxError: invalid syntax
ComputerSystem - 35_start_reset.py: FAIL
File "35_start_reset.py", line 118
finally:
^
SyntaxError: invalid syntax
ComputerSystem - 40_RSC_start.py: FAIL
File "40_RSC_start.py", line 98
finally:
^
SyntaxError: invalid syntax
ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP
ComputerSystem - 42_cs_gi_errs.py: FAIL
ComputerSystemIndication - 01_created_indication.py: FAIL
File "01_created_indication.py", line 83
finally:
^
SyntaxError: invalid syntax
ElementAllocatedFromPool - 01_forward.py: SKIP
ElementAllocatedFromPool - 02_reverse.py: SKIP
ElementAllocatedFromPool - 03_reverse_errs.py: PASS
ElementAllocatedFromPool - 04_forward_errs.py: FAIL
ElementCapabilities - 01_forward.py: PASS
ElementCapabilities - 02_reverse.py: PASS
ElementCapabilities - 03_forward_errs.py: FAIL
File "03_forward_errs.py", line 58
finally:
^
SyntaxError: invalid syntax
ElementCapabilities - 04_reverse_errs.py: FAIL
File "04_reverse_errs.py", line 57
finally:
^
SyntaxError: invalid syntax
ElementCapabilities - 05_hostsystem_cap.py: PASS
ElementConforms - 01_forward.py: PASS
ElementConforms - 02_reverse.py: FAIL
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: FAIL
EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS
HostSystem - 01_enum.py: PASS
HostSystem - 02_hostsystem_to_rasd.py: FAIL
HostSystem - 03_hs_to_settdefcap.py: FAIL
CIM_ERR_FAILED: For provider Virt_SettingsDefineCapabilities the library name was empty. Check provider registered location.
HostSystem - 04_hs_to_EAPF.py: SKIP
HostSystem - 05_hs_gi_errs.py: PASS
HostSystem - 06_hs_to_vsms.py: FAIL
CIM_ERR_FAILED: For provider Virt_SettingsDefineCapabilities the library name was empty. Check provider registered location.
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: FAIL
File "03_forward_errs.py", line 71
finally:
^
SyntaxError: invalid syntax
HostedService - 04_reverse_errs.py: FAIL
File "04_reverse_errs.py", line 79
finally:
^
SyntaxError: invalid syntax
LogicalDisk - 01_disk.py: FAIL
LogicalDisk - 02_nodevs.py: PASS
LogicalDisk - 03_ld_gi_errs.py: FAIL
Memory - 01_memory.py: FAIL
Memory - 02_defgetmem.py: FAIL
File "02_defgetmem.py", line 86
finally:
^
SyntaxError: invalid syntax
Memory - 03_mem_gi_errs.py: PASS
NetworkPort - 01_netport.py: PASS
NetworkPort - 02_np_gi_errors.py: PASS
NetworkPort - 03_user_netport.py: SKIP
Processor - 01_processor.py: PASS
Processor - 02_definesys_get_procs.py: FAIL
File "02_definesys_get_procs.py", line 99
finally:
^
SyntaxError: invalid syntax
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: FAIL
File "03_forward_errs.py", line 69
finally:
^
SyntaxError: invalid syntax
ResourceAllocationFromPool - 04_reverse_errs.py: FAIL
File "04_reverse_errs.py", line 68
finally:
^
SyntaxError: invalid syntax
ResourceAllocationFromPool - 05_RAPF_err.py: FAIL
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: FAIL
InvokeMethod(CreateResourcePool): CIM_ERR_NOT_SUPPORTED
ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: FAIL
InvokeMethod(CreateChildResourcePool): CIM_ERR_NOT_SUPPORTED
ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: XFAIL Bug: 92173
InvokeMethod(AddResourcesToResourcePool): CIM_ERR_FAILED: Unknown Method
Bug:<92173>
ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: FAIL
InvokeMethod(RemoveResourcesFromResourcePool): CIM_ERR_NOT_SUPPORTED
ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL
InvokeMethod(DeleteResourcePool): CIM_ERR_NOT_SUPPORTED
SettingsDefine - 01_forward.py: PASS
SettingsDefine - 02_reverse.py: FAIL
CIM_ERR_NOT_FOUND: No such instance (virtgst/proc)
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: FAIL
File "03_fwderrs.py", line 158
finally:
^
SyntaxError: invalid syntax
VSSD - 01_enum.py: SKIP
VSSD - 02_bootldr.py: SKIP
VSSD - 03_vssd_gi_errs.py: SKIP
VSSD - 04_vssd_to_rasd.py: FAIL
VirtualSystemManagementCapabilities - 01_enum.py: PASS
VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS
VirtualSystemManagementService - 01_definesystem_name.py: FAIL
InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Required field `Address' missing from NetRASD
VirtualSystemManagementService - 02_destroysystem.py: FAIL
InvokeMethod(DestroySystem): CIM_ERR_FAILED: Unable to retrieve domain name.
VirtualSystemManagementService - 03_definesystem_ess.py: PASS
VirtualSystemManagementService - 04_definesystem_ers.py: PASS
VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL
InvokeMethod(DestroySystem): CIM_ERR_FAILED: Unable to retrieve domain name.
InvokeMethod(DestroySystem): CIM_ERR_FAILED: Failed to find domain
VirtualSystemManagementService - 06_addresource.py: FAIL
File "06_addresource.py", line 96
finally:
^
SyntaxError: invalid syntax
VirtualSystemManagementService - 07_addresource_neg.py: FAIL
File "07_addresource_neg.py", line 77
finally:
^
SyntaxError: invalid syntax
VirtualSystemManagementService - 08_modifyresource.py: FAIL
File "08_modifyresource.py", line 99
finally:
^
SyntaxError: invalid syntax
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: FAIL
File "05_migratable_host_errs.py", line 87
finally:
^
SyntaxError: invalid syntax
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: 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.
Cleaned log files.
Testing XenFV hypervisor
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: FAIL
ComputerSystem - 04_defineStartVS.py: FAIL
ComputerSystem - 05_activate_defined_start.py: XFAIL Bug: 85769
ComputerSystem - 06_paused_active_suspend.py: FAIL
InvokeMethod(RequestStateChange): CIM_ERR_FAILED: Domain not running
ComputerSystem - 22_define_suspend.py: PASS
ComputerSystem - 23_suspend_suspend.py: FAIL
File "23_suspend_suspend.py", line 118
finally:
^
SyntaxError: invalid syntax
ComputerSystem - 27_define_suspend_errs.py: FAIL
InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Required field `Address' missing from NetRASD
ComputerSystem - 32_start_reboot.py: FAIL
File "32_start_reboot.py", line 117
finally:
^
SyntaxError: invalid syntax
ComputerSystem - 33_suspend_reboot.py: FAIL
File "33_suspend_reboot.py", line 121
finally:
^
SyntaxError: invalid syntax
ComputerSystem - 35_start_reset.py: FAIL
File "35_start_reset.py", line 118
finally:
^
SyntaxError: invalid syntax
ComputerSystem - 40_RSC_start.py: FAIL
File "40_RSC_start.py", line 98
finally:
^
SyntaxError: invalid syntax
ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP
ComputerSystem - 42_cs_gi_errs.py: FAIL
ComputerSystemIndication - 01_created_indication.py: FAIL
File "01_created_indication.py", line 83
finally:
^
SyntaxError: invalid syntax
ElementAllocatedFromPool - 01_forward.py: SKIP
ElementAllocatedFromPool - 02_reverse.py: SKIP
ElementAllocatedFromPool - 03_reverse_errs.py: PASS
ElementAllocatedFromPool - 04_forward_errs.py: FAIL
ElementCapabilities - 01_forward.py: PASS
ElementCapabilities - 02_reverse.py: PASS
ElementCapabilities - 03_forward_errs.py: FAIL
File "03_forward_errs.py", line 58
finally:
^
SyntaxError: invalid syntax
ElementCapabilities - 04_reverse_errs.py: FAIL
File "04_reverse_errs.py", line 57
finally:
^
SyntaxError: invalid syntax
ElementCapabilities - 05_hostsystem_cap.py: PASS
ElementConforms - 01_forward.py: PASS
ElementConforms - 02_reverse.py: FAIL
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: FAIL
EnabledLogicalElementCapabilities - 02_elecap_gi_errs.py: PASS
HostSystem - 01_enum.py: PASS
HostSystem - 02_hostsystem_to_rasd.py: FAIL
HostSystem - 03_hs_to_settdefcap.py: FAIL
CIM_ERR_FAILED: For provider Virt_SettingsDefineCapabilities the library name was empty. Check provider registered location.
HostSystem - 04_hs_to_EAPF.py: SKIP
HostSystem - 05_hs_gi_errs.py: PASS
HostSystem - 06_hs_to_vsms.py: FAIL
CIM_ERR_FAILED: For provider Virt_SettingsDefineCapabilities the library name was empty. Check provider registered location.
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: FAIL
File "03_forward_errs.py", line 71
finally:
^
SyntaxError: invalid syntax
HostedService - 04_reverse_errs.py: FAIL
File "04_reverse_errs.py", line 79
finally:
^
SyntaxError: invalid syntax
LogicalDisk - 01_disk.py: FAIL
LogicalDisk - 02_nodevs.py: PASS
LogicalDisk - 03_ld_gi_errs.py: FAIL
Memory - 01_memory.py: FAIL
Memory - 02_defgetmem.py: FAIL
File "02_defgetmem.py", line 86
finally:
^
SyntaxError: invalid syntax
Memory - 03_mem_gi_errs.py: PASS
NetworkPort - 01_netport.py: PASS
NetworkPort - 02_np_gi_errors.py: PASS
NetworkPort - 03_user_netport.py: SKIP
Processor - 01_processor.py: PASS
Processor - 02_definesys_get_procs.py: FAIL
File "02_definesys_get_procs.py", line 99
finally:
^
SyntaxError: invalid syntax
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: FAIL
File "03_forward_errs.py", line 69
finally:
^
SyntaxError: invalid syntax
ResourceAllocationFromPool - 04_reverse_errs.py: FAIL
File "04_reverse_errs.py", line 68
finally:
^
SyntaxError: invalid syntax
ResourceAllocationFromPool - 05_RAPF_err.py: FAIL
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: FAIL
InvokeMethod(CreateResourcePool): CIM_ERR_NOT_SUPPORTED
ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: FAIL
InvokeMethod(CreateChildResourcePool): CIM_ERR_NOT_SUPPORTED
ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py: XFAIL Bug: 92173
InvokeMethod(AddResourcesToResourcePool): CIM_ERR_FAILED: Unknown Method
Bug:<92173>
ResourcePoolConfigurationService - 06_RemoveResourcesFromResourcePool.py: FAIL
InvokeMethod(RemoveResourcesFromResourcePool): CIM_ERR_NOT_SUPPORTED
ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL
InvokeMethod(DeleteResourcePool): CIM_ERR_NOT_SUPPORTED
SettingsDefine - 01_forward.py: PASS
SettingsDefine - 02_reverse.py: FAIL
CIM_ERR_NOT_FOUND: No such instance (virtgst/proc)
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: FAIL
File "03_fwderrs.py", line 158
finally:
^
SyntaxError: invalid syntax
VSSD - 01_enum.py: SKIP
VSSD - 02_bootldr.py: SKIP
VSSD - 03_vssd_gi_errs.py: SKIP
VSSD - 04_vssd_to_rasd.py: FAIL
VirtualSystemManagementCapabilities - 01_enum.py: PASS
VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS
VirtualSystemManagementService - 01_definesystem_name.py: FAIL
InvokeMethod(DefineSystem): CIM_ERR_FAILED: ResourceSettings Error: Required field `Address' missing from NetRASD
VirtualSystemManagementService - 02_destroysystem.py: FAIL
InvokeMethod(DestroySystem): CIM_ERR_FAILED: Unable to retrieve domain name.
VirtualSystemManagementService - 03_definesystem_ess.py: PASS
VirtualSystemManagementService - 04_definesystem_ers.py: PASS
VirtualSystemManagementService - 05_destroysystem_neg.py: FAIL
InvokeMethod(DestroySystem): CIM_ERR_FAILED: Unable to retrieve domain name.
InvokeMethod(DestroySystem): CIM_ERR_FAILED: Failed to find domain
VirtualSystemManagementService - 06_addresource.py: FAIL
File "06_addresource.py", line 96
finally:
^
SyntaxError: invalid syntax
VirtualSystemManagementService - 07_addresource_neg.py: FAIL
File "07_addresource_neg.py", line 77
finally:
^
SyntaxError: invalid syntax
VirtualSystemManagementService - 08_modifyresource.py: FAIL
File "08_modifyresource.py", line 99
finally:
^
SyntaxError: invalid syntax
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: FAIL
File "05_migratable_host_errs.py", line 87
finally:
^
SyntaxError: invalid syntax
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: PASS
VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS
VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS
VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py: PASS
16 years, 6 months
[PATCH] Expose console information informally in ComputerSystem instance
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1208284176 25200
# Node ID a31e00ad17b63dcfcfab60295bd88f405a75e9ff
# Parent 93836f7ec3d282cb6186f6f0c0e4afdcdf4fbfab
Expose console information informally in ComputerSystem instance
By putting the vnc:// url in the caption field, users and clients can
at least get access to the information through the CIM providers until we
have a more formal console model established.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 93836f7ec3d2 -r a31e00ad17b6 src/Virt_ComputerSystem.c
--- a/src/Virt_ComputerSystem.c Tue Apr 15 10:46:04 2008 -0700
+++ b/src/Virt_ComputerSystem.c Tue Apr 15 11:29:36 2008 -0700
@@ -23,6 +23,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
+#include <limits.h>
#include <cmpidt.h>
#include <cmpift.h>
@@ -33,10 +35,12 @@
#include "cs_util.h"
#include <libcmpiutil/libcmpiutil.h>
#include "misc_util.h"
+#include "device_parsing.h"
#include <libcmpiutil/std_invokemethod.h>
#include <libcmpiutil/std_instance.h>
#include "Virt_ComputerSystem.h"
+#include "Virt_HostSystem.h"
const static CMPIBroker *_BROKER;
@@ -90,13 +94,42 @@ static int set_uuid_from_dom(virDomainPt
return 1;
}
-static int set_capdesc_from_dom(virDomainPtr dom, CMPIInstance *instance)
-{
+static int set_capdesc_from_dominfo(const CMPIBroker *broker,
+ struct domain *domain,
+ const CMPIObjectPath *ref,
+ CMPIInstance *instance)
+{
+ char *cap = NULL;
+ int ret;
+ char host[HOST_NAME_MAX];
+
+ if (gethostname(host, sizeof(host)) != 0) {
+ CU_DEBUG("Unable to get hostname: %m");
+ strcpy(host, "localhost");
+ }
+
+ if (domain->dev_graphics != NULL)
+ ret = asprintf(&cap,
+ "Virtual System (Console on %s://%s:%s)",
+ domain->dev_graphics->dev.graphics.type,
+ host,
+ domain->dev_graphics->dev.graphics.port);
+ else
+ ret = asprintf(&cap,
+ "Virtual System (No console)");
+
+ if (ret == -1) {
+ CU_DEBUG("Failed to create caption string");
+ goto out;
+ }
+
CMSetProperty(instance, "Caption",
- (CMPIValue *)"Virtual System", CMPI_chars);
+ (CMPIValue *)cap, CMPI_chars);
CMSetProperty(instance, "Description",
(CMPIValue *)"Virtual System", CMPI_chars);
+ out:
+ free(cap);
return 1;
}
@@ -309,6 +342,20 @@ static CMPIStatus set_properties(const C
{
CMPIStatus s = {CMPI_RC_ERR_FAILED, NULL};
char *uuid = NULL;
+ struct domain *domain = NULL;
+ CMPIObjectPath *ref = NULL;
+
+ ref = CMGetObjectPath(instance, &s);
+ if ((ref == NULL) || (s.rc != CMPI_RC_OK))
+ return s;
+
+ if (get_dominfo(dom, &domain) == 0) {
+ CU_DEBUG("Unable to get domain information");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unable to get domain information");
+ goto out;
+ }
if (!set_name_from_dom(dom, instance)) {
/* Print trace error */
@@ -320,7 +367,7 @@ static CMPIStatus set_properties(const C
goto out;
}
- if (!set_capdesc_from_dom(dom, instance)) {
+ if (!set_capdesc_from_dominfo(broker, domain, ref, instance)) {
/* Print trace error */
goto out;
}
@@ -348,6 +395,7 @@ static CMPIStatus set_properties(const C
out:
free(uuid);
+ cleanup_dominfo(&domain);
return s;
}
16 years, 6 months
KVM test report on Fedora 9
by Zhengang Li
Distro: Fedora 9 Beta
Kernel: 2.6.25-0.121.rc5.git4.fc9
Libvirt: 0.4.1-7.fc9
CIMOM: 2.7.0-6.fc9
PyWBEM: 0.6-1
libcmpiutil: 0.3-1.fc9
libvirt-cim: 0.3-4.fc9
cimtest: changeset-76
=========FAIL=============
AllocationCapabilities - 02_alloccap_gi_errs.py: FAIL
"Requested Object could not be found." vs. "Instance not found." error
string issue. The return code is correct.
[Known Issue]
ComputerSystemIndication - 01_created_indication.py: FAIL
Exception : Authentication (or request) Failed!
Previous tests were always on sfcb. Anyone has a successful experience
on pegasus for indication?
ElementAllocatedFromPool - 03_reverse_errs.py: FAIL
exp: ERR_NOT_FOUND(6) - No such instance
ret: ERR_FAILED(1) - Invalid InstanceID or unsupported pool type
ElementConforms - 02_reverse.py: FAIL
Binary rpm provider returns CIM_ERR_INVALID_PARAMETER:
KVM_ElementConformsToProfile on the following query:
wbemain -ac KVM_ElementConformsToProfile
'http://u:p@host:5988/root/virt:KVM_ComputerSystem.CreationClassName="KVM_ComputerSystem",Name="domgst"'
Same wbemcli command gets the correct results on another system using
latest libvirt-cim tree (changeset 533).
HostSystem - 02_hostsystem_to_rasd.py: FAIL
MegaBytes vs. KiloBytes issue on RASD
[Known Issue]
NetworkPort - 03_user_netport.py: FAIL
'user' network type.
[Known Issue]
RASD - 01_verify_rasd_fields.py: FAIL
RASD - 02_enum.py: FAIL
Same as HostSystem.02
ReferencedProfile - 01_verify_refprof.py: FAIL
Binary rpm provider gives 2 results on the following query:
wbemein http://u:p@host:5988/root/interop:KVM_RegisteredProfile
"CIM:DSP1042-SystemVirtualization-1.0.0"
"CIM:DSP1057-VirtualSystem-1.0.0a"
Same wbemcli command gets 5 results on changeset-533 tree on another system.
"CIM:DSP1042-SystemVirtualization-1.0.0"
"CIM:DSP1057-VirtualSystem-1.0.0a"
"CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0"
"CIM:DSP1045-MemoryResourceVirtualization-1.0.0"
"CIM:DSP1081-VirtualSystemMigration-1.0"
This leads to ReferencedProfile's 'ain' query gets only 2 results.
ReferencedProfile - 02_refprofile_errs.py: FAIL
Same as ReferencedProfile.01
ResourceAllocationFromPool - 03_forward_errs.py: FAIL
exp: ERR_NOT_FOUND(6) - No such instance (wrong) - resource pool type
mismatch
ret: ERR_FAILED(1) - Invalid InstanceID or unsupported pool type
ResourcePoolConfigurationService - 03_CreateResourcePool.py: FAIL
ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: FAIL
ResourcePoolConfigurationService -
06_RemoveResourcesFromResourcePool.py: FAIL
ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL
====FULL CIMTEST REPORT=PASS(70)=FAIL(18)=SKIP(34)=XFAIL(7)=======
AllocationCapabilities - 01_enum.py: PASS
AllocationCapabilities - 02_alloccap_gi_errs.py: FAIL
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: XFAIL Bug: 91410
ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP
ComputerSystem - 42_cs_gi_errs.py: PASS
ComputerSystemIndication - 01_created_indication.py: FAIL
ElementAllocatedFromPool - 01_forward.py: SKIP
ElementAllocatedFromPool - 02_reverse.py: SKIP
ElementAllocatedFromPool - 03_reverse_errs.py: FAIL
ElementAllocatedFromPool - 04_forward_errs.py: XFAIL Bug: 88651
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: FAIL
ElementConforms - 03_ectp_fwd_errs.py: XFAIL Bug: 92642
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: FAIL
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: FAIL
RASD - 02_enum.py: FAIL
RASD - 03_rasd_errs.py: PASS
ReferencedProfile - 01_verify_refprof.py: FAIL
ReferencedProfile - 02_refprofile_errs.py: FAIL
ResourceAllocationFromPool - 01_forward.py: PASS
ResourceAllocationFromPool - 02_reverse.py: PASS
ResourceAllocationFromPool - 03_forward_errs.py: FAIL
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: FAIL
ResourcePoolConfigurationService - 04_CreateChildResourcePool.py: FAIL
ResourcePoolConfigurationService - 05_AddResourcesToResourcePool.py:
XFAIL Bug: 92173
ResourcePoolConfigurationService -
06_RemoveResourcesFromResourcePool.py: FAIL
ResourcePoolConfigurationService - 07_DeleteResourcePool.py: FAIL
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: FAIL
VirtualSystemManagementCapabilities - 01_enum.py: PASS
VirtualSystemManagementCapabilities - 02_vsmcap_gi_errs.py: PASS
VirtualSystemManagementService - 01_definesystem_name.py: PASS
VirtualSystemManagementService - 02_destroysystem.py: FAIL
VirtualSystemManagementService - 03_definesystem_ess.py: PASS
VirtualSystemManagementService - 04_definesystem_ers.py: PASS
VirtualSystemManagementService - 05_destroysystem_neg.py: PASS
VirtualSystemManagementService - 06_addresource.py: FAIL
VirtualSystemManagementService - 07_addresource_neg.py: PASS
VirtualSystemManagementService - 08_modifyresource.py: XFAIL 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: PASS
VirtualSystemSnapshotService - 02_vs_sservice_gi_errs.py: PASS
VirtualSystemSnapshotServiceCapabilities - 01_enum.py: PASS
VirtualSystemSnapshotServiceCapabilities - 02_vs_sservicecap_gi_errs.py:
PASS
--
- Zhengang
16 years, 6 months
[PATCH] [TEST] Retrieve revision and changeset string
by zli@linux.vnet.ibm.com
# HG changeset patch
# User Zhengang Li <lizg(a)cn.ibm.com>
# Date 1208344854 -28800
# Node ID 5d2e26fe8b594894946b95598aac5c43a6d3f0d0
# Parent e54b31ce89af19ca0d4c40ce4b097685e34aa2c7
[TEST] Retrieve revision and changeset string
The two properties can be accessed in test cases as
'main.revision', 'main.changeset'
Signed-off-by: Zhengang Li <lizg(a)cn.ibm.com>
diff -r e54b31ce89af -r 5d2e26fe8b59 lib/CimTest/Globals.py
--- a/lib/CimTest/Globals.py Wed Apr 16 16:10:52 2008 +0800
+++ b/lib/CimTest/Globals.py Wed Apr 16 19:20:54 2008 +0800
@@ -135,6 +135,7 @@ def do_main(types=['Xen'], p=parser):
def do_try():
try:
log_param(options.debug==True)
+ revision, changeset = get_version(options.virt, options.ip)
from VirtLib.utils import setup_ssh_key
from XenKvmLib.test_doms import destroy_and_undefine_all
setup_ssh_key()
@@ -148,3 +149,16 @@ def do_main(types=['Xen'], p=parser):
return do_try
return do_type
+def get_version(virt, ip):
+ from pywbem import WBEMConnection
+ from XenKvmLib.classes import get_typed_class
+ conn = WBEMConnection('http://%s' % ip, (CIM_USER, CIM_PASS), CIM_NS)
+ vsms_cn = get_typed_class(virt, 'VirtualSystemManagementService')
+ try:
+ inst = conn.EnumerateInstances(vsms_cn)
+ revision = inst[0]['Revision']
+ changeset = inst[0]['Changeset']
+ except Exception:
+ return None, None
+ return revision, changeset
+
16 years, 6 months
[PATCH] [TSST] add ElementConforms.04 for XenFV & KVM support
by Guo Lian Yun
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1208333259 -28800
# Node ID fd6c8eb84730b223387979a4255ec2c98b6d1de3
# Parent dfa2a9c819bd026cc467fb3bced05211ee4f2ba9
[TSST] add ElementConforms.04 for XenFV & KVM support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r dfa2a9c819bd -r fd6c8eb84730 suites/libvirt-cim/cimtest/ElementConforms/04_ectp_rev_errs.py
--- a/suites/libvirt-cim/cimtest/ElementConforms/04_ectp_rev_errs.py Tue Apr 15 15:00:01 2008 +0800
+++ b/suites/libvirt-cim/cimtest/ElementConforms/04_ectp_rev_errs.py Wed Apr 16 16:07:39 2008 +0800
@@ -4,6 +4,7 @@
#
# Authors:
# Anoop V Chakkalakkal<anoop.vijayan(a)in.ibm.com>
+# Guolian Yun <yunguol(a)cn.ibm.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
@@ -82,14 +83,17 @@
import pywbem
from VirtLib import utils, live
from XenKvmLib import assoc
+from XenKvmLib import vxml
+from XenKvmLib.classes import get_typed_class
from XenKvmLib.common_util import try_assoc
+from XenKvmLib.test_doms import destroy_and_undefine_all
from CimTest.ReturnCodes import PASS, FAIL
from CimTest.Globals import log_param, logger, CIM_USER, CIM_PASS, CIM_NS, do_main
-sup_types = ['Xen']
+sup_types = ['Xen', 'XenFV', 'KVM']
-ac_classname = 'Xen_ElementConformsToProfile'
bug = '92642'
+test_dom = "domU"
cs_values = {
"INVALID_CCName_Keyname" : { 'rc' : 6 , 'desc' : 'No such instance' }, \
@@ -105,7 +109,8 @@
"INVALID_Name_Keyvalue" : { 'rc' : 6 , 'desc' : 'No such instance' }
}
-def try_invalid_assoc(classname, name_val, i, field):
+def try_invalid_assoc(classname, name_val, i, field, virt="Xen"):
+ ac_classname = get_typed_class(virt, "ElementConformsToProfile")
j = 0
keys = {}
temp = name_val[i]
@@ -113,7 +118,7 @@
for j in range(len(name_val)/2):
k = j * 2
keys[name_val[k]] = name_val[k+1]
- if classname == "Xen_HostSystem":
+ if classname == get_typed_class(virt, "HostSystem"):
expr_values = hs_values
else:
expr_values = cs_values
@@ -134,16 +139,25 @@
global conn
conn = assoc.myWBEMConnection('http://%s' % options.ip, (CIM_USER, CIM_PASS), CIM_NS)
+ destroy_and_undefine_all(options.ip)
+ virt_xml = vxml.get_class(options.virt)
+ cxml = virt_xml(test_dom)
+ ret = cxml.define(options.ip)
+ if not ret:
+ logger.error('Unable to define domain %s' % test_dom)
+ return FAIL
+ hs = get_typed_class(options.virt, "HostSystem")
+ cs = get_typed_class(options.virt, "ComputerSystem")
host_name = live.hostname(options.ip)
host_name_val = [
- 'CreationClassName', 'Xen_HostSystem', \
+ 'CreationClassName', hs, \
'Name', host_name
]
comp_name_val = [
- 'CreationClassName', 'Xen_ComputerSystem', \
- 'Name', 'Domain-0'
+ 'CreationClassName', cs, \
+ 'Name', test_dom
]
tc_scen = [
@@ -154,12 +168,12 @@
]
for i in range(len(tc_scen)):
- retval = try_invalid_assoc('Xen_HostSystem', host_name_val, i, tc_scen[i])
+ retval = try_invalid_assoc(hs, host_name_val, i, tc_scen[i], options.virt)
if retval != PASS:
status = retval
for i in range(len(tc_scen)):
- retval = try_invalid_assoc('Xen_ComputerSystem', comp_name_val, i, tc_scen[i])
+ retval = try_invalid_assoc(cs, comp_name_val, i, tc_scen[i], options.virt)
if retval != PASS:
status = retval
16 years, 6 months