
@@ -130,6 +129,18 @@ def get_pool_details(virt, server): def get_pool_details(virt, server): dpool = npool = mpool = ppool = None try : + libvirt_version = virsh_version(server, virt) + if virt == 'KVM' and libvirt_version >= '0.4.1' and \ + CIM_REV > diskpoolconf_rev: + diskid = "%s/%s" % ("DiskPool", dpoolname) + status = create_diskpool(server, virt=virt) + else: + diskid = "%s/%s" % ("DiskPool", test_dpath) + status = create_diskpool_file()
This block will be basically be identical for each test that needs to create a diskpool. Instead, create common function that determines which diskpool function to call. That way, the test cases only need to make one call. If this changes in the future, it's easier to change it in one function than it is to change it in multiple test cases. On my system, I have an existing pool called mypool. This test case fails with the following error: SettingsDefineCapabilities - 01_forward.py: FAIL ERROR - AttributeError : 'list' object has no attribute 'InstanceID' CIM_ERR_NOT_FOUND: No such instance (testpool) If I delete mypool, the test passes. -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com