[Libvirt-cim] [PATCH 4 of 5] [TEST] Remove diskpool creation from HostSys and HRP tests
Deepti B Kalakeri
deeptik at linux.vnet.ibm.com
Mon Sep 8 12:33:09 UTC 2008
+1 for me.
Kaitlin Rupert wrote:
> # HG changeset patch
> # User Kaitlin Rupert <karupert at us.ibm.com>
> # Date 1220654590 25200
> # Node ID 553bf81e676d9cdb9f752614aa6b7b60652b6802
> # Parent 41ee8a3bcd8d950602659a59b6186e71d09c2144
> [TEST] Remove diskpool creation from HostSys and HRP tests.
>
> The diskpool is now being created before the tests are run.
>
> Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>
>
> diff -r 41ee8a3bcd8d -r 553bf81e676d suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py
> --- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Tue Sep 02 20:15:04 2008 -0700
> +++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Fri Sep 05 15:43:10 2008 -0700
> @@ -51,7 +51,7 @@
> from VirtLib import utils
> from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES, \
> CIM_ERROR_ASSOCIATORS
> -from XenKvmLib.const import do_main
> +from XenKvmLib.const import do_main, default_pool_name
> from XenKvmLib.vxml import XenXML, KVMXML, get_class
> from XenKvmLib.assoc import AssociatorNames, Associators
> from XenKvmLib.common_util import get_host_info
> @@ -59,7 +59,6 @@
> from CimTest.ReturnCodes import PASS, FAIL, SKIP
> from XenKvmLib.test_doms import destroy_and_undefine_all
> from XenKvmLib.logicaldevices import verify_device_values
> -from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf
>
> sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
>
> @@ -87,7 +86,7 @@
> npool = get_typed_class(virt, 'NetworkPool')
> dpool = get_typed_class(virt, 'DiskPool')
> ppool = get_typed_class(virt, 'ProcessorPool')
> - exp_pllist[dpool] = dp_InstID
> + exp_pllist[dpool] = 'DiskPool/%s' % dp_InstID
> exp_pllist[npool] = '%s/%s' %('NetworkPool', net_name)
> exp_pllist[ppool] = 'ProcessorPool/0'
> exp_pllist[mpool] = 'MemoryPool/0'
> @@ -199,7 +198,6 @@
> except Exception, detail:
> logger.error(CIM_ERROR_ASSOCIATORS, an)
> logger.error("Exception: %s", detail)
> - cleanup_restore(server, virt)
> status = FAIL
> return status
>
> @@ -234,12 +232,6 @@
> # Get the network pool info which is used by the VS.
> net_name = vsxml.xml_get_net_network()
>
> - status, dpool_name = create_diskpool_conf(server, virt)
> - if status != PASS:
> - logger.error("Failed to create diskpool")
> - vsxml.undefine(server)
> - return FAIL
> -
> # Get the hostedResourcePool info first
> cn = classname
> an = get_typed_class(virt, "HostedResourcePool")
> @@ -247,21 +239,18 @@
> status, pool = get_assocname_info(server, cn, an, qcn, host_name, virt)
> if status != PASS:
> vsxml.undefine(server)
> - cleanup_restore(server, virt=virt)
> return status
>
> - in_pllist = pool_init_list(virt, pool, net_name, dpool_name)
> + in_pllist = pool_init_list(virt, pool, net_name, default_pool_name)
> # One pool for each Device type, hence len should be 4
> exp_len = 4
> status = check_len(an, in_pllist, qcn, exp_len)
> if status != PASS:
> vsxml.undefine(server)
> - cleanup_restore(server, virt=virt)
> return FAIL
>
> status = verify_eafp_values(server, in_pllist, virt, test_disk)
> vsxml.undefine(server)
> - cleanup_restore(server, virt=virt)
> return status
> if __name__ == "__main__":
> sys.exit(main())
> diff -r 41ee8a3bcd8d -r 553bf81e676d suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py
> --- a/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Tue Sep 02 20:15:04 2008 -0700
> +++ b/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Fri Sep 05 15:43:10 2008 -0700
> @@ -30,20 +30,14 @@
> from CimTest import Globals
> from CimTest.Globals import logger
> from CimTest.ReturnCodes import PASS, FAIL
> -from XenKvmLib.const import do_main
> +from XenKvmLib.const import do_main, default_pool_name
> from XenKvmLib.classes import get_typed_class
> -from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf
>
> sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
> @do_main(sup_types)
> def main():
> options = main.options
> status = FAIL
> -
> - status, dpool_name = create_diskpool_conf(options.ip, options.virt)
> - if status != PASS:
> - logger.error("Failed to create diskpool")
> - return FAIL
>
> keys = ['Name', 'CreationClassName']
> try:
> @@ -81,10 +75,10 @@
> if cname.find("NetworkPool") >=0 and \
> items['InstanceID'] == "NetworkPool/%s" %default_network_name:
> status = PASS
> - if cname.find("DiskPool") >=0 and items['InstanceID'] == "DiskPool/%s" %dpool_name:
> + if cname.find("DiskPool") >=0 and \
> + items['InstanceID'] == "DiskPool/%s" % default_pool_name:
> status = PASS
>
> - cleanup_restore(options.ip, options.virt)
>
> return status
> if __name__ == "__main__":
> diff -r 41ee8a3bcd8d -r 553bf81e676d suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py
> --- a/suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py Tue Sep 02 20:15:04 2008 -0700
> +++ b/suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py Fri Sep 05 15:43:10 2008 -0700
> @@ -29,20 +29,14 @@
> from CimTest import Globals
> from CimTest.Globals import logger
> from CimTest.ReturnCodes import PASS, FAIL
> -from XenKvmLib.const import do_main
> +from XenKvmLib.const import do_main, default_pool_name
> from XenKvmLib.classes import get_typed_class
> -from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf
>
> sup_types=['Xen', 'KVM', 'XenFV', 'LXC']
> @do_main(sup_types)
> def main():
> options = main.options
> status = PASS
> -
> - status, dpool_name = create_diskpool_conf(options.ip, options.virt)
> - if status != PASS:
> - logger.error("Failed to create diskpool")
> - return FAIL
>
> keys = ['Name', 'CreationClassName']
> try:
> @@ -59,8 +53,8 @@
> poollist = {
> mem_cn : "MemoryPool/0",
> proc_cn : "ProcessorPool/0",
> - net_cn : "NetworkPool/%s" %default_network_name,
> - disk_cn : "DiskPool/%s" %dpool_name
> + net_cn : "NetworkPool/%s" % default_network_name,
> + disk_cn : "DiskPool/%s" % default_pool_name
> }
>
> for k, v in poollist.items():
> @@ -79,7 +73,6 @@
> status = FAIL
> if status != PASS:
> break
> - cleanup_restore(options.ip, options.virt)
> return status
> if __name__ == "__main__":
> sys.exit(main())
> diff -r 41ee8a3bcd8d -r 553bf81e676d suites/libvirt-cim/cimtest/HostedResourcePool/04_reverse_errs.py
> --- a/suites/libvirt-cim/cimtest/HostedResourcePool/04_reverse_errs.py Tue Sep 02 20:15:04 2008 -0700
> +++ b/suites/libvirt-cim/cimtest/HostedResourcePool/04_reverse_errs.py Fri Sep 05 15:43:10 2008 -0700
> @@ -29,9 +29,8 @@
> from CimTest import Globals
> from CimTest.Globals import logger
> from CimTest.ReturnCodes import PASS
> -from XenKvmLib.const import do_main
> +from XenKvmLib.const import do_main, default_pool_name
> from XenKvmLib.classes import get_typed_class
> -from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf
>
> sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
> expr_values = {
> @@ -50,11 +49,6 @@
> options = main.options
> status = PASS
>
> - status, dpool_name = create_diskpool_conf(options.ip, options.virt)
> - if status != PASS:
> - logger.error("Failed to create diskpool")
> - return FAIL
> -
> assoc_classname = get_typed_class(options.virt, "HostedResourcePool")
> proc_cn = get_typed_class(options.virt, "ProcessorPool")
> mem_cn = get_typed_class(options.virt, "MemoryPool")
> @@ -68,7 +62,7 @@
> mem_cn : "MemoryPool/0",
> proc_cn : "ProcessorPool/0",
> net_cn : "NetworkPool/%s" %default_network_name,
> - disk_cn : "DiskPool/%s" %dpool_name
> + disk_cn : "DiskPool/%s" % default_pool_name
> }
> for k, v in poollist.items():
> keys = { "Wrong" : v}
> @@ -87,7 +81,6 @@
> logger.error("------ FAILED: Invalid Name Key Value.------")
> status = ret
>
> - cleanup_restore(options.ip, options.virt)
> return status
> if __name__ == "__main__":
> sys.exit(main())
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
>
More information about the Libvirt-cim
mailing list