# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1219957645 25200
# Node ID ebbc54d7a01db890ce35054bab15d7ee4de9df5b
# Parent 187c2bd619db911505c1e5460050e6dc47dab180
[TEST] Update AC and CS tests to use do_main from const.py
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 187c2bd619db -r ebbc54d7a01d
suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py
--- a/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Mon Aug 25 19:41:23
2008 -0700
+++ b/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Thu Aug 28 14:07:25
2008 -0700
@@ -28,8 +28,8 @@
import sys
from VirtLib.live import virsh_version
from XenKvmLib import enumclass
-from CimTest.Globals import do_main
-from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, platform_sup
+from XenKvmLib.const import do_main, platform_sup
+from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf
diff -r 187c2bd619db -r ebbc54d7a01d
suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py
--- a/suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py Mon Aug 25
19:41:23 2008 -0700
+++ b/suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py Thu Aug 28
14:07:25 2008 -0700
@@ -60,7 +60,7 @@
from VirtLib.live import net_list
from XenKvmLib.test_xml import netxml
from XenKvmLib.test_doms import create_vnet
-from CimTest.Globals import do_main, platform_sup
+from XenKvmLib.const import do_main, platform_sup
from XenKvmLib.classes import get_typed_class
from XenKvmLib.common_util import cleanup_restore, test_dpath, \
create_diskpool_file
diff -r 187c2bd619db -r ebbc54d7a01d suites/libvirt-cim/cimtest/ComputerSystem/01_enum.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/01_enum.py Mon Aug 25 19:41:23 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/01_enum.py Thu Aug 28 14:07:25 2008 -0700
@@ -23,7 +23,7 @@
#
import sys
-from CimTest.Globals import do_main
+from XenKvmLib.const import do_main
from XenKvmLib import computersystem
from VirtLib import live
from VirtLib import utils
diff -r 187c2bd619db -r ebbc54d7a01d
suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py Mon Aug 25 19:41:23 2008
-0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py Thu Aug 28 14:07:25 2008
-0700
@@ -28,7 +28,7 @@
from VirtLib import live
from VirtLib import utils
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
-from CimTest.Globals import do_main
+from XenKvmLib.const import do_main
from CimTest.ReturnCodes import PASS, FAIL, SKIP
sup_types = ['KVM', 'LXC']
diff -r 187c2bd619db -r ebbc54d7a01d
suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py Mon Aug 25 19:41:23 2008
-0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py Thu Aug 28 14:07:25 2008
-0700
@@ -32,7 +32,7 @@
from XenKvmLib.classes import get_typed_class
from VirtLib import utils
from CimTest import Globals
-from CimTest.Globals import do_main
+from XenKvmLib.const import do_main, VIRSH_ERROR_DEFINE
from CimTest.ReturnCodes import PASS, FAIL
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
@@ -46,7 +46,7 @@
cxml = vxml.get_class(options.virt)(test_dom)
rc = cxml.define(options.ip)
if not rc:
- Globals.logger.error(Globals.VIRSH_ERROR_DEFINE % test_dom)
+ Globals.logger.error(VIRSH_ERROR_DEFINE % test_dom)
return status
try:
diff -r 187c2bd619db -r ebbc54d7a01d
suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Mon Aug 25 19:41:23
2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Thu Aug 28 14:07:25
2008 -0700
@@ -35,7 +35,7 @@
from XenKvmLib import computersystem
from CimTest import Globals
from XenKvmLib.classes import get_typed_class
-from CimTest.Globals import do_main
+from XenKvmLib.const import do_main
from CimTest.ReturnCodes import PASS, FAIL
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
diff -r 187c2bd619db -r ebbc54d7a01d
suites/libvirt-cim/cimtest/ComputerSystem/05_activate_defined_start.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/05_activate_defined_start.py Mon Aug 25
19:41:23 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/05_activate_defined_start.py Thu Aug 28
14:07:25 2008 -0700
@@ -46,7 +46,7 @@
from XenKvmLib import vxml
from VirtLib import utils
from CimTest.Globals import logger
-from CimTest.Globals import do_main
+from XenKvmLib.const import do_main
from XenKvmLib.common_util import call_request_state_change
from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
diff -r 187c2bd619db -r ebbc54d7a01d
suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py Mon Aug 25
19:41:23 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py Thu Aug 28
14:07:25 2008 -0700
@@ -46,7 +46,7 @@
from VirtLib import utils
from XenKvmLib.test_doms import destroy_and_undefine_all
from CimTest.Globals import logger
-from CimTest.Globals import do_main
+from XenKvmLib.const import do_main
from XenKvmLib.common_util import call_request_state_change, \
poll_for_state_change
from CimTest.ReturnCodes import PASS, FAIL
diff -r 187c2bd619db -r ebbc54d7a01d
suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Mon Aug 25 19:41:23
2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Thu Aug 28 14:07:25
2008 -0700
@@ -33,7 +33,8 @@
from VirtLib import utils
from XenKvmLib import vxml
from XenKvmLib.test_doms import destroy_and_undefine_domain
-from CimTest.Globals import do_main, logger
+from CimTest.Globals import logger
+from XenKvmLib.const import do_main
from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib.common_util import create_using_definesystem, \
call_request_state_change, get_cs_instance
diff -r 187c2bd619db -r ebbc54d7a01d
suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py Mon Aug 25 19:41:23
2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py Thu Aug 28 14:07:25
2008 -0700
@@ -41,7 +41,8 @@
import sys
import pywbem
from VirtLib import utils
-from CimTest.Globals import do_main, logger
+from CimTest.Globals import logger
+from XenKvmLib.const import do_main
from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib.test_doms import destroy_and_undefine_domain
from XenKvmLib.common_util import create_using_definesystem, \
diff -r 187c2bd619db -r ebbc54d7a01d
suites/libvirt-cim/cimtest/ComputerSystem/27_define_suspend_errs.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/27_define_suspend_errs.py Mon Aug 25
19:41:23 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/27_define_suspend_errs.py Thu Aug 28
14:07:25 2008 -0700
@@ -39,7 +39,8 @@
import sys
import pywbem
from VirtLib import utils
-from CimTest.Globals import do_main, logger
+from CimTest.Globals import logger
+from XenKvmLib.const import do_main
from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib.test_doms import destroy_and_undefine_domain
from XenKvmLib.common_util import try_request_state_change, \
diff -r 187c2bd619db -r ebbc54d7a01d
suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py Mon Aug 25 19:41:23
2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py Thu Aug 28 14:07:25
2008 -0700
@@ -40,7 +40,8 @@
import sys
from VirtLib import utils
-from CimTest.Globals import do_main, logger
+from CimTest.Globals import logger
+from XenKvmLib.const import do_main
from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
from XenKvmLib.test_doms import destroy_and_undefine_domain
from XenKvmLib.common_util import create_using_definesystem, \
diff -r 187c2bd619db -r ebbc54d7a01d
suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py Mon Aug 25 19:41:23
2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py Thu Aug 28 14:07:25
2008 -0700
@@ -43,7 +43,8 @@
import sys
import pywbem
from VirtLib import utils
-from CimTest.Globals import do_main, logger
+from CimTest.Globals import logger
+from XenKvmLib.const import do_main
from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
from XenKvmLib.test_doms import destroy_and_undefine_domain
from XenKvmLib.common_util import create_using_definesystem, \
diff -r 187c2bd619db -r ebbc54d7a01d
suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py Mon Aug 25 19:41:23 2008
-0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py Thu Aug 28 14:07:25 2008
-0700
@@ -41,7 +41,8 @@
import sys
from VirtLib import utils
-from CimTest.Globals import do_main, logger
+from CimTest.Globals import logger
+from XenKvmLib.const import do_main
from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib.test_doms import destroy_and_undefine_domain
from XenKvmLib.common_util import get_cs_instance, create_using_definesystem, \
diff -r 187c2bd619db -r ebbc54d7a01d
suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Mon Aug 25 19:41:23 2008
-0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Thu Aug 28 14:07:25 2008
-0700
@@ -39,7 +39,7 @@
from XenKvmLib.test_doms import destroy_and_undefine_domain
from XenKvmLib.common_util import *
from CimTest.Globals import logger
-from CimTest.Globals import do_main
+from XenKvmLib.const import do_main
from CimTest.ReturnCodes import PASS, FAIL
sup_types = ['Xen', 'KVM', 'XenFV']
diff -r 187c2bd619db -r ebbc54d7a01d
suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Mon Aug 25
19:41:23 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Thu Aug 28
14:07:25 2008 -0700
@@ -65,7 +65,7 @@
from XenKvmLib.assoc import Associators, AssociatorNames
from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORNAMES, \
CIM_ERROR_ASSOCIATORS
-from CimTest.Globals import do_main
+from XenKvmLib.const import do_main
from CimTest.ReturnCodes import PASS, FAIL
from XenKvmLib import rasd
from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \
diff -r 187c2bd619db -r ebbc54d7a01d
suites/libvirt-cim/cimtest/ComputerSystem/42_cs_gi_errs.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/42_cs_gi_errs.py Mon Aug 25 19:41:23 2008
-0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/42_cs_gi_errs.py Thu Aug 28 14:07:25 2008
-0700
@@ -79,8 +79,8 @@
from XenKvmLib.classes import get_typed_class
from XenKvmLib.common_util import try_getinstance
from CimTest.ReturnCodes import PASS, FAIL
-from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS, VIRSH_ERROR_DEFINE
-from CimTest.Globals import do_main
+from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS
+from XenKvmLib.const import do_main, VIRSH_ERROR_DEFINE
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
diff -r 187c2bd619db -r ebbc54d7a01d suites/libvirt-cim/lib/XenKvmLib/const.py
--- a/suites/libvirt-cim/lib/XenKvmLib/const.py Mon Aug 25 19:41:23 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Thu Aug 28 14:07:25 2008 -0700
@@ -99,13 +99,14 @@
def do_main(types=['Xen'], p=parser):
def do_type(f):
import sys
- from ReturnCodes import SKIP, FAIL
+ from CimTest.ReturnCodes import SKIP, FAIL
(options, args) = p.parse_args()
if options.virt not in types:
return lambda:SKIP
else:
def do_try():
try:
+ from CimTest.Globals import logger, log_param
log_param()
from VirtLib.utils import setup_ssh_key
from XenKvmLib.test_doms import destroy_and_undefine_all
diff -r 187c2bd619db -r ebbc54d7a01d suites/libvirt-cim/main.py
--- a/suites/libvirt-cim/main.py Mon Aug 25 19:41:23 2008 -0700
+++ b/suites/libvirt-cim/main.py Thu Aug 28 14:07:25 2008 -0700
@@ -29,13 +29,12 @@
import TestSuite
import commands
from VirtLib import groups
-from CimTest.Globals import platform_sup
import ConfigParser
sys.path.append('./lib')
+from XenKvmLib.const import platform_sup, default_network_name
from XenKvmLib.reporting import gen_report, send_report
from VirtLib import utils
from CimTest.ReturnCodes import PASS, FAIL
-from XenKvmLib import const
from XenKvmLib.common_util import create_netpool_conf, destroy_netpool
parser = OptionParser()
@@ -127,17 +126,17 @@
def setup_env(ip, virt):
status, netpool = create_netpool_conf(ip, virt,
- net_name=const.default_network_name)
+ net_name=default_network_name)
if status != PASS:
- print "\nUnable to create network pool %s" %
const.default_network_name
+ print "\nUnable to create network pool %s" % default_network_name
return status
return PASS
def cleanup_env(ip, virt):
- status = destroy_netpool(ip, virt, const.default_network_name)
+ status = destroy_netpool(ip, virt, default_network_name)
if status != PASS:
- print "Unable to destroy network pool %s." %
const.default_network_name
+ print "Unable to destroy network pool %s." % default_network_name
return status
return PASS