[libvirt] [test-API 00/10] Reorgnize/refactoring round 2

This should be the second round to reorgnize/refactor the codes. What this round does: * New directory "conf"; Move $root/*.cfg into it * New directory "src"; Move $root/*.{py,css,xls} into it (except the main program libvirt-test-api.py) * Rename libvirt-test-api.py to libvirt-test-api * Move install-autotest-server into "scripts" * Rename BUGSKIP to SKIP, and modify the skipping syntax so that it skips whole test case, but not test step(s). See the explaination in the patch to get why to do it. * Destroy the codes to skip test steps. * Other small fixes. TODO in next round: * Support run all cases in a bundle * Support to skip test case with the new skipping syntax * A new config property for the scratch directory, (now it always use $(pwd)/$guest_name to download the files, we should have something like '/var/cache/libvirt-test-API' instead). * Other cleaning up. Osier Yang (10): Create new dir 'conf' and move conf files into it Fix the typo in usage string Remove the suffix .py for libvirt-test-api.py New directory 'src' and move *.{py,css,xls} files into it Fix the typo which mispells 'shutil' as 'shutils' Move install-autotest-server into 'scripts' Update logging stuffs so that it works after source tree reorgnizing Add document to tell the default log output file Rename and modify the syntax of BUGSKIP Destroy the codes to skip case steps. BUGSKIP | 4 - SKIP | 26 ++++++++ env.cfg => conf/env.cfg | 0 kickstart.cfg => conf/kickstart.cfg | 0 dist/redhat/env_inspect.py | 2 +- libvirt-test-api.py => libvirt-test-api | 50 ++++++++-------- repos/domain/attach_disk.py | 2 +- repos/domain/attach_interface.py | 2 +- repos/domain/autostart.py | 2 +- repos/domain/balloon_memory.py | 2 +- repos/domain/blkstats.py | 2 +- repos/domain/console_io.py | 2 +- repos/domain/console_mutex.py | 2 +- repos/domain/cpu_affinity.py | 2 +- repos/domain/cpu_topology.py | 2 +- repos/domain/create.py | 2 +- repos/domain/define.py | 2 +- repos/domain/destroy.py | 2 +- repos/domain/detach_disk.py | 2 +- repos/domain/detach_interface.py | 2 +- repos/domain/domain_blkinfo.py | 2 +- repos/domain/domain_id.py | 2 +- repos/domain/domblkinfo.py | 2 +- repos/domain/dump.py | 2 +- repos/domain/eventhandler.py | 2 +- repos/domain/ifstats.py | 2 +- repos/domain/install_image.py | 4 +- repos/domain/install_linux_cdrom.py | 10 ++-- repos/domain/install_linux_check.py | 4 +- repos/domain/install_linux_net.py | 12 ++-- repos/domain/install_windows_cdrom.py | 12 ++-- repos/domain/migrate.py | 2 +- repos/domain/ownership_test.py | 2 +- repos/domain/reboot.py | 2 +- repos/domain/restore.py | 2 +- repos/domain/resume.py | 2 +- repos/domain/save.py | 2 +- repos/domain/sched_params.py | 2 +- repos/domain/shutdown.py | 2 +- repos/domain/start.py | 2 +- repos/domain/suspend.py | 2 +- repos/domain/undefine.py | 2 +- repos/domain/update_devflag.py | 2 +- repos/interface/create.py | 2 +- repos/interface/define.py | 2 +- repos/interface/destroy.py | 2 +- repos/interface/undefine.py | 2 +- repos/libvirtd/qemu_hang.py | 2 +- repos/libvirtd/restart.py | 2 +- repos/network/autostart.py | 2 +- repos/network/create.py | 2 +- repos/network/define.py | 2 +- repos/network/destroy.py | 2 +- repos/network/network_list.py | 2 +- repos/network/network_name.py | 2 +- repos/network/network_uuid.py | 2 +- repos/network/start.py | 2 +- repos/network/undefine.py | 2 +- repos/nodedevice/detach.py | 2 +- repos/nodedevice/reattach.py | 2 +- repos/nodedevice/reset.py | 2 +- repos/npiv/create_virtual_hba.py | 2 +- .../multiple_thread_block_on_domain_create.py | 4 +- repos/remoteAccess/tcp_setup.py | 2 +- repos/remoteAccess/tls_setup.py | 8 +- repos/sVirt/domain_nfs_start.py | 2 +- repos/snapshot/delete.py | 2 +- repos/snapshot/file_flag.py | 2 +- repos/snapshot/flag_check.py | 2 +- repos/snapshot/internal_create.py | 2 +- repos/snapshot/revert.py | 2 +- repos/storage/activate_pool.py | 2 +- repos/storage/build_dir_pool.py | 2 +- repos/storage/build_disk_pool.py | 2 +- repos/storage/build_logical_pool.py | 2 +- repos/storage/build_netfs_pool.py | 2 +- repos/storage/create_dir_pool.py | 2 +- repos/storage/create_dir_volume.py | 2 +- repos/storage/create_fs_pool.py | 2 +- repos/storage/create_iscsi_pool.py | 2 +- repos/storage/create_logical_volume.py | 2 +- repos/storage/create_netfs_pool.py | 2 +- repos/storage/create_netfs_volume.py | 2 +- repos/storage/create_partition_volume.py | 2 +- repos/storage/define_dir_pool.py | 2 +- repos/storage/define_disk_pool.py | 2 +- repos/storage/define_iscsi_pool.py | 2 +- repos/storage/define_logical_pool.py | 2 +- repos/storage/define_mpath_pool.py | 2 +- repos/storage/define_netfs_pool.py | 2 +- repos/storage/define_scsi_pool.py | 2 +- repos/storage/delete_dir_volume.py | 2 +- repos/storage/delete_logical_pool.py | 2 +- repos/storage/delete_logical_volume.py | 2 +- repos/storage/delete_netfs_volume.py | 2 +- repos/storage/delete_partition_volume.py | 2 +- repos/storage/destroy_pool.py | 2 +- repos/storage/pool_name.py | 2 +- repos/storage/pool_uuid.py | 2 +- repos/storage/undefine_pool.py | 2 +- .../install-autotest-server | 0 activityfilter.py => src/activityfilter.py | 0 casecfgcheck.py => src/casecfgcheck.py | 2 +- env_clear.py => src/env_clear.py | 2 +- exception.py => src/exception.py | 2 +- generator.py => src/generator.py | 61 ++++---------------- log.css => src/log.css | 0 log.xsl => src/log.xsl | 2 +- logxmlparser.py => src/logxmlparser.py | 4 +- mapper.py => src/mapper.py | 0 parser.py => src/parser.py | 6 +- process.py => src/process.py | 0 proxy.py => src/proxy.py | 2 +- sharedmod.py => src/sharedmod.py | 0 utils/env_parser.py | 2 +- 115 files changed, 188 insertions(+), 205 deletions(-) delete mode 100644 BUGSKIP create mode 100644 SKIP rename env.cfg => conf/env.cfg (100%) rename kickstart.cfg => conf/kickstart.cfg (100%) rename libvirt-test-api.py => libvirt-test-api (91%) rename install-autotest-server => scripts/install-autotest-server (100%) create mode 100644 src/__init__.py rename activityfilter.py => src/activityfilter.py (100%) rename casecfgcheck.py => src/casecfgcheck.py (99%) rename env_clear.py => src/env_clear.py (99%) rename exception.py => src/exception.py (97%) rename generator.py => src/generator.py (78%) rename log.css => src/log.css (100%) rename log.xsl => src/log.xsl (98%) rename logxmlparser.py => src/logxmlparser.py (99%) rename mapper.py => src/mapper.py (100%) rename parser.py => src/parser.py (99%) rename process.py => src/process.py (100%) rename proxy.py => src/proxy.py (99%) rename sharedmod.py => src/sharedmod.py (100%) Regards, Osier -- 1.7.7.3

--- env.cfg => conf/env.cfg | 0 kickstart.cfg => conf/kickstart.cfg | 0 exception.py | 2 +- generator.py | 2 +- parser.py | 4 ++-- repos/domain/install_image.py | 2 +- repos/domain/install_linux_cdrom.py | 2 +- repos/domain/install_linux_check.py | 2 +- repos/domain/install_linux_net.py | 4 ++-- repos/domain/install_windows_cdrom.py | 6 +++--- .../multiple_thread_block_on_domain_create.py | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) rename env.cfg => conf/env.cfg (100%) rename kickstart.cfg => conf/kickstart.cfg (100%) diff --git a/env.cfg b/conf/env.cfg similarity index 100% rename from env.cfg rename to conf/env.cfg diff --git a/kickstart.cfg b/conf/kickstart.cfg similarity index 100% rename from kickstart.cfg rename to conf/kickstart.cfg diff --git a/exception.py b/exception.py index 3625dab..190fd9f 100644 --- a/exception.py +++ b/exception.py @@ -76,7 +76,7 @@ class CaseConfigfileError(LibvirtException): class MissingVariable(LibvirtException): code = 210 - message = "Variables missing from env.cfg [variables] section" + message = "Variables missing from conf/env.cfg [variables] section" class TestError(LibvirtException): code = 211 diff --git a/generator.py b/generator.py index 53febde..fc4fc76 100644 --- a/generator.py +++ b/generator.py @@ -59,7 +59,7 @@ class FuncGen(object): # Save case information to a file in a format self.__case_info_save(activity, testrunid) - self.env = env_parser.Envparser("env.cfg") + self.env = env_parser.Envparser("conf/env.cfg") mapper_obj = mapper.Mapper(activity) pkg_casename_func = mapper_obj.module_casename_func_map() diff --git a/parser.py b/parser.py index b0bad3b..07d1498 100644 --- a/parser.py +++ b/parser.py @@ -35,7 +35,7 @@ class CaseFileParser(object): self.missing_variables = [] self.debug = debug self.casefile = casefile - self.env = env_parser.Envparser("env.cfg") + self.env = env_parser.Envparser("conf/env.cfg") self.loop_finish = False self.loop_start = 0 self.loop_end = 0 @@ -210,7 +210,7 @@ class CaseFileParser(object): tripped_valuelist = self.variables_lookup(tripped_valuelist) if len(self.missing_variables) != 0: raise exception.MissingVariable( - "The variables %s referenced in %s could not be found in env.cfg" % + "The variables %s referenced in %s could not be found in conf/env.cfg" % (self.missing_variables, self.casefile)) tripped_valuename = tripped_valuelist[0] diff --git a/repos/domain/install_image.py b/repos/domain/install_image.py index 32cc7af..0d2d7e2 100644 --- a/repos/domain/install_image.py +++ b/repos/domain/install_image.py @@ -60,7 +60,7 @@ def install_image(params): logger.info("the path of directory of disk images located on is %s" % imgfullpath) - envfile = os.path.join(HOME_PATH, 'env.cfg') + envfile = os.path.join(HOME_PATH, 'conf/env.cfg') logger.info("the environment file is %s" % envfile) envparser = env_parser.Envparser(envfile) diff --git a/repos/domain/install_linux_cdrom.py b/repos/domain/install_linux_cdrom.py index 07a8307..1805db2 100644 --- a/repos/domain/install_linux_cdrom.py +++ b/repos/domain/install_linux_cdrom.py @@ -223,7 +223,7 @@ def install_linux_cdrom(params): logger.info("creating disk images file is successful.") logger.info("get system environment information") - envfile = os.path.join(HOME_PATH, 'env.cfg') + envfile = os.path.join(HOME_PATH, 'conf/env.cfg') logger.info("the environment file is %s" % envfile) envparser = env_parser.Envparser(envfile) diff --git a/repos/domain/install_linux_check.py b/repos/domain/install_linux_check.py index 1c27fc1..2a1351d 100644 --- a/repos/domain/install_linux_check.py +++ b/repos/domain/install_linux_check.py @@ -150,7 +150,7 @@ def install_linux_check(params): # Check app works fine in guest, such as: wget logger.info("check point5: check app works fine in guest, such as: wget") logger.info("get system environment information") - envfile = os.path.join(HOME_PATH, 'env.cfg') + envfile = os.path.join(HOME_PATH, 'conf/env.cfg') logger.info("the environment file is %s" % envfile) envparser = env_parser.Envparser(envfile) diff --git a/repos/domain/install_linux_net.py b/repos/domain/install_linux_net.py index a5fca06..ae5a063 100644 --- a/repos/domain/install_linux_net.py +++ b/repos/domain/install_linux_net.py @@ -188,13 +188,13 @@ def install_linux_net(params): logger.info("get system environment information") - envfile = os.path.join(HOME_PATH, 'env.cfg') + envfile = os.path.join(HOME_PATH, 'conf/env.cfg') logger.info("the environment file is %s" % envfile) envparser = env_parser.Envparser(envfile) # Get http, ftp or nfs url based on guest os, arch - # and installation method from env.cfg + # and installation method from conf/env.cfg if installmethod == 'http': ks = envparser.get_value("guest", guestos + "_" + guestarch + diff --git a/repos/domain/install_windows_cdrom.py b/repos/domain/install_windows_cdrom.py index aaff47d..a4c10e2 100644 --- a/repos/domain/install_windows_cdrom.py +++ b/repos/domain/install_windows_cdrom.py @@ -256,10 +256,10 @@ def install_windows_cdrom(params): logger.info("creating disk images file is successful.") logger.info("get system environment information") - envfile = os.path.join(HOME_PATH, 'env.cfg') + envfile = os.path.join(HOME_PATH, 'conf/env.cfg') logger.info("the environment file is %s" % envfile) - # Get iso file based on guest os and arch from env.cfg + # Get iso file based on guest os and arch from conf/env.cfg envparser = env_parser.Envparser(envfile) iso_file = envparser.get_value("guest", guestos + '_' + guestarch) cdkey = envparser.get_value("guest", "%s_%s_key" % (guestos, guestarch)) @@ -427,7 +427,7 @@ def install_windows_cdrom_clean(params): guestos = params.get('guestos') guestarch = params.get('guestarch') - envfile = os.path.join(HOME_PATH, 'env.cfg') + envfile = os.path.join(HOME_PATH, 'conf/env.cfg') envparser = env_parser.Envparser(envfile) iso_file = envparser.get_value("guest", guestos + '_' + guestarch) diff --git a/repos/regression/multiple_thread_block_on_domain_create.py b/repos/regression/multiple_thread_block_on_domain_create.py index 38030c2..53332ab 100644 --- a/repos/regression/multiple_thread_block_on_domain_create.py +++ b/repos/regression/multiple_thread_block_on_domain_create.py @@ -116,7 +116,7 @@ def multiple_thread_block_on_domain_create(params): logger.info("the type of hypervisor is %s" % hypervisor) logger.debug("the uri to connect is %s" % uri) - envfile = os.path.join(homepath, 'env.cfg') + envfile = os.path.join(homepath, 'conf/env.cfg') envparser = env_parser.Envpaser(envfile) ostree = envparser.get_value("guest", guestos + "_" + arch) ks = envparser.get_value("guest", guestos + "_" + arch + -- 1.7.7.3

On 04/18/2012 01:49 PM, Osier Yang wrote:
--- env.cfg => conf/env.cfg | 0 kickstart.cfg => conf/kickstart.cfg | 0 exception.py | 2 +- generator.py | 2 +- parser.py | 4 ++-- repos/domain/install_image.py | 2 +- repos/domain/install_linux_cdrom.py | 2 +- repos/domain/install_linux_check.py | 2 +- repos/domain/install_linux_net.py | 4 ++-- repos/domain/install_windows_cdrom.py | 6 +++--- .../multiple_thread_block_on_domain_create.py | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) rename env.cfg => conf/env.cfg (100%) rename kickstart.cfg => conf/kickstart.cfg (100%)
the conf file should be in the root directory, just like the Makefile.am or Makefile, we don't need to hide it It's the interface to user.

On 2012年04月18日 15:41, Guannan Ren wrote:
On 04/18/2012 01:49 PM, Osier Yang wrote:
--- env.cfg => conf/env.cfg | 0 kickstart.cfg => conf/kickstart.cfg | 0 exception.py | 2 +- generator.py | 2 +- parser.py | 4 ++-- repos/domain/install_image.py | 2 +- repos/domain/install_linux_cdrom.py | 2 +- repos/domain/install_linux_check.py | 2 +- repos/domain/install_linux_net.py | 4 ++-- repos/domain/install_windows_cdrom.py | 6 +++--- .../multiple_thread_block_on_domain_create.py | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) rename env.cfg => conf/env.cfg (100%) rename kickstart.cfg => conf/kickstart.cfg (100%)
the conf file should be in the root directory, just like the Makefile.am or Makefile, we don't need to hide it It's the interface to user.
It's not hidden, doesn't "conf" tells it stores the config files? Let's orgnize things in a good manner, but not throw everything under source root. Makefile is the different story, no comparability. Osier

On 04/18/2012 03:41 PM, Osier Yang wrote:
On 2012年04月18日 15:41, Guannan Ren wrote:
On 04/18/2012 01:49 PM, Osier Yang wrote:
--- env.cfg => conf/env.cfg | 0 kickstart.cfg => conf/kickstart.cfg | 0 exception.py | 2 +- generator.py | 2 +- parser.py | 4 ++-- repos/domain/install_image.py | 2 +- repos/domain/install_linux_cdrom.py | 2 +- repos/domain/install_linux_check.py | 2 +- repos/domain/install_linux_net.py | 4 ++-- repos/domain/install_windows_cdrom.py | 6 +++--- .../multiple_thread_block_on_domain_create.py | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) rename env.cfg => conf/env.cfg (100%) rename kickstart.cfg => conf/kickstart.cfg (100%)
the conf file should be in the root directory, just like the Makefile.am or Makefile, we don't need to hide it It's the interface to user.
It's not hidden, doesn't "conf" tells it stores the config files? Let's orgnize things in a good manner, but not throw everything under source root. Makefile is the different story, no comparability.
Osier
The files in the root directory should be import to user. I really think the conf files should be seen directly when users want to edit it. Just like the global_config.ini and shadow_config.ini files in autotest, they are just in the root level. Guannan Ren

The usage functions really need to be improved, but it will be a follow up patch. --- libvirt-test-api.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/libvirt-test-api.py b/libvirt-test-api.py index b7b2b74..ae53d14 100644 --- a/libvirt-test-api.py +++ b/libvirt-test-api.py @@ -33,7 +33,7 @@ from activityfilter import Filter from casecfgcheck import CaseCfgCheck def usage(): - print "Usage: libvirt_test_api.py <OPTIONS> <ARGUS>" + print "Usage: libvirt-test-api.py <OPTIONS> <ARGUMENTS>" print "\noptions: -h, --help : Display usage information \ \n -c, --casefile: Specify configuration file \ \n -t, --template: Print testcase config file template \ -- 1.7.7.3

As the main excutable program, it's habit to have no suffix. s/libvirt-test-api.py/libvirt-test-api/g --- libvirt-test-api.py => libvirt-test-api | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) rename libvirt-test-api.py => libvirt-test-api (95%) diff --git a/libvirt-test-api.py b/libvirt-test-api similarity index 95% rename from libvirt-test-api.py rename to libvirt-test-api index ae53d14..409f260 100644 --- a/libvirt-test-api.py +++ b/libvirt-test-api @@ -33,7 +33,7 @@ from activityfilter import Filter from casecfgcheck import CaseCfgCheck def usage(): - print "Usage: libvirt-test-api.py <OPTIONS> <ARGUMENTS>" + print "Usage: libvirt-test-api <OPTIONS> <ARGUMENTS>" print "\noptions: -h, --help : Display usage information \ \n -c, --casefile: Specify configuration file \ \n -t, --template: Print testcase config file template \ @@ -45,14 +45,14 @@ def usage(): print "example: \ - \n python libvirt-test-api.py -l 0|1 -c TEST.CONF \ - \n python libvirt-test-api.py -c TEST.CONF -f TEST.XML \ - \n python libvirt-test-api.py -t repos/domain/start.py ... \ - \n python libvirt-test-api.py -m TESTONE.XML TESTTWO.XML \ - \n python libvirt-test-api.py -d TEST.XML TESTRUNID TESTID \ - \n python libvirt-test-api.py -d TEST.XML TESTRUNID \ - \n python libvirt-test-api.py -d TEST.XML all \ - \n python libvirt-test-api.py -f TEST.XML \ + \n python libvirt-test-api -l 0|1 -c TEST.CONF \ + \n python libvirt-test-api -c TEST.CONF -f TEST.XML \ + \n python libvirt-test-api -t repos/domain/start.py ... \ + \n python libvirt-test-api -m TESTONE.XML TESTTWO.XML \ + \n python libvirt-test-api -d TEST.XML TESTRUNID TESTID \ + \n python libvirt-test-api -d TEST.XML TESTRUNID \ + \n python libvirt-test-api -d TEST.XML all \ + \n python libvirt-test-api -f TEST.XML \ -r TESTRUNID TESTID ..." def append_path(): -- 1.7.7.3

On 04/18/2012 01:49 PM, Osier Yang wrote:
As the main excutable program, it's habit to have no suffix.
s/libvirt-test-api.py/libvirt-test-api/g --- libvirt-test-api.py => libvirt-test-api | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) rename libvirt-test-api.py => libvirt-test-api (95%)
diff --git a/libvirt-test-api.py b/libvirt-test-api similarity index 95% rename from libvirt-test-api.py rename to libvirt-test-api index ae53d14..409f260 100644 --- a/libvirt-test-api.py +++ b/libvirt-test-api @@ -33,7 +33,7 @@ from activityfilter import Filter from casecfgcheck import CaseCfgCheck
def usage(): - print "Usage: libvirt-test-api.py<OPTIONS> <ARGUMENTS>" + print "Usage: libvirt-test-api<OPTIONS> <ARGUMENTS>" print "\noptions: -h, --help : Display usage information \ \n -c, --casefile: Specify configuration file \ \n -t, --template: Print testcase config file template \ @@ -45,14 +45,14 @@ def usage():
print "example: \ - \n python libvirt-test-api.py -l 0|1 -c TEST.CONF \ - \n python libvirt-test-api.py -c TEST.CONF -f TEST.XML \ - \n python libvirt-test-api.py -t repos/domain/start.py ... \ - \n python libvirt-test-api.py -m TESTONE.XML TESTTWO.XML \ - \n python libvirt-test-api.py -d TEST.XML TESTRUNID TESTID \ - \n python libvirt-test-api.py -d TEST.XML TESTRUNID \ - \n python libvirt-test-api.py -d TEST.XML all \ - \n python libvirt-test-api.py -f TEST.XML \ + \n python libvirt-test-api -l 0|1 -c TEST.CONF \ + \n python libvirt-test-api -c TEST.CONF -f TEST.XML \ + \n python libvirt-test-api -t repos/domain/start.py ... \ + \n python libvirt-test-api -m TESTONE.XML TESTTWO.XML \ + \n python libvirt-test-api -d TEST.XML TESTRUNID TESTID \ + \n python libvirt-test-api -d TEST.XML TESTRUNID \ + \n python libvirt-test-api -d TEST.XML all \ + \n python libvirt-test-api -f TEST.XML \ -r TESTRUNID TESTID ..."
def append_path():
ACK, isn't it better to give the executable permission. Guannan Ren

On 2012年04月18日 15:44, Guannan Ren wrote:
On 04/18/2012 01:49 PM, Osier Yang wrote:
As the main excutable program, it's habit to have no suffix.
s/libvirt-test-api.py/libvirt-test-api/g --- libvirt-test-api.py => libvirt-test-api | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) rename libvirt-test-api.py => libvirt-test-api (95%)
diff --git a/libvirt-test-api.py b/libvirt-test-api similarity index 95% rename from libvirt-test-api.py rename to libvirt-test-api index ae53d14..409f260 100644 --- a/libvirt-test-api.py +++ b/libvirt-test-api @@ -33,7 +33,7 @@ from activityfilter import Filter from casecfgcheck import CaseCfgCheck
def usage(): - print "Usage: libvirt-test-api.py<OPTIONS> <ARGUMENTS>" + print "Usage: libvirt-test-api<OPTIONS> <ARGUMENTS>" print "\noptions: -h, --help : Display usage information \ \n -c, --casefile: Specify configuration file \ \n -t, --template: Print testcase config file template \ @@ -45,14 +45,14 @@ def usage():
print "example: \ - \n python libvirt-test-api.py -l 0|1 -c TEST.CONF \ - \n python libvirt-test-api.py -c TEST.CONF -f TEST.XML \ - \n python libvirt-test-api.py -t repos/domain/start.py ... \ - \n python libvirt-test-api.py -m TESTONE.XML TESTTWO.XML \ - \n python libvirt-test-api.py -d TEST.XML TESTRUNID TESTID \ - \n python libvirt-test-api.py -d TEST.XML TESTRUNID \ - \n python libvirt-test-api.py -d TEST.XML all \ - \n python libvirt-test-api.py -f TEST.XML \ + \n python libvirt-test-api -l 0|1 -c TEST.CONF \ + \n python libvirt-test-api -c TEST.CONF -f TEST.XML \ + \n python libvirt-test-api -t repos/domain/start.py ... \ + \n python libvirt-test-api -m TESTONE.XML TESTTWO.XML \ + \n python libvirt-test-api -d TEST.XML TESTRUNID TESTID \ + \n python libvirt-test-api -d TEST.XML TESTRUNID \ + \n python libvirt-test-api -d TEST.XML all \ + \n python libvirt-test-api -f TEST.XML \ -r TESTRUNID TESTID ..."
def append_path():
ACK, isn't it better to give the executable permission.
Yeah, I think it's fine to "chmod +x" for it. It will be in a separate patch.
Guannan Ren
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

The "import" statements are updated incidentally. --- dist/redhat/env_inspect.py | 2 +- libvirt-test-api | 16 ++++++++-------- repos/domain/attach_disk.py | 2 +- repos/domain/attach_interface.py | 2 +- repos/domain/autostart.py | 2 +- repos/domain/balloon_memory.py | 2 +- repos/domain/blkstats.py | 2 +- repos/domain/console_io.py | 2 +- repos/domain/console_mutex.py | 2 +- repos/domain/cpu_affinity.py | 2 +- repos/domain/cpu_topology.py | 2 +- repos/domain/create.py | 2 +- repos/domain/define.py | 2 +- repos/domain/destroy.py | 2 +- repos/domain/detach_disk.py | 2 +- repos/domain/detach_interface.py | 2 +- repos/domain/domain_blkinfo.py | 2 +- repos/domain/domain_id.py | 2 +- repos/domain/domblkinfo.py | 2 +- repos/domain/dump.py | 2 +- repos/domain/eventhandler.py | 2 +- repos/domain/ifstats.py | 2 +- repos/domain/install_image.py | 2 +- repos/domain/install_linux_cdrom.py | 2 +- repos/domain/install_linux_check.py | 2 +- repos/domain/install_linux_net.py | 2 +- repos/domain/install_windows_cdrom.py | 2 +- repos/domain/migrate.py | 2 +- repos/domain/ownership_test.py | 2 +- repos/domain/reboot.py | 2 +- repos/domain/restore.py | 2 +- repos/domain/resume.py | 2 +- repos/domain/save.py | 2 +- repos/domain/sched_params.py | 2 +- repos/domain/shutdown.py | 2 +- repos/domain/start.py | 2 +- repos/domain/suspend.py | 2 +- repos/domain/undefine.py | 2 +- repos/domain/update_devflag.py | 2 +- repos/interface/create.py | 2 +- repos/interface/define.py | 2 +- repos/interface/destroy.py | 2 +- repos/interface/undefine.py | 2 +- repos/libvirtd/qemu_hang.py | 2 +- repos/libvirtd/restart.py | 2 +- repos/network/autostart.py | 2 +- repos/network/create.py | 2 +- repos/network/define.py | 2 +- repos/network/destroy.py | 2 +- repos/network/network_list.py | 2 +- repos/network/network_name.py | 2 +- repos/network/network_uuid.py | 2 +- repos/network/start.py | 2 +- repos/network/undefine.py | 2 +- repos/nodedevice/detach.py | 2 +- repos/nodedevice/reattach.py | 2 +- repos/nodedevice/reset.py | 2 +- repos/npiv/create_virtual_hba.py | 2 +- .../multiple_thread_block_on_domain_create.py | 2 +- repos/remoteAccess/tcp_setup.py | 2 +- repos/sVirt/domain_nfs_start.py | 2 +- repos/snapshot/delete.py | 2 +- repos/snapshot/file_flag.py | 2 +- repos/snapshot/flag_check.py | 2 +- repos/snapshot/internal_create.py | 2 +- repos/snapshot/revert.py | 2 +- repos/storage/activate_pool.py | 2 +- repos/storage/build_dir_pool.py | 2 +- repos/storage/build_disk_pool.py | 2 +- repos/storage/build_logical_pool.py | 2 +- repos/storage/build_netfs_pool.py | 2 +- repos/storage/create_dir_pool.py | 2 +- repos/storage/create_dir_volume.py | 2 +- repos/storage/create_fs_pool.py | 2 +- repos/storage/create_iscsi_pool.py | 2 +- repos/storage/create_logical_volume.py | 2 +- repos/storage/create_netfs_pool.py | 2 +- repos/storage/create_netfs_volume.py | 2 +- repos/storage/create_partition_volume.py | 2 +- repos/storage/define_dir_pool.py | 2 +- repos/storage/define_disk_pool.py | 2 +- repos/storage/define_iscsi_pool.py | 2 +- repos/storage/define_logical_pool.py | 2 +- repos/storage/define_mpath_pool.py | 2 +- repos/storage/define_netfs_pool.py | 2 +- repos/storage/define_scsi_pool.py | 2 +- repos/storage/delete_dir_volume.py | 2 +- repos/storage/delete_logical_pool.py | 2 +- repos/storage/delete_logical_volume.py | 2 +- repos/storage/delete_netfs_volume.py | 2 +- repos/storage/delete_partition_volume.py | 2 +- repos/storage/destroy_pool.py | 2 +- repos/storage/pool_name.py | 2 +- repos/storage/pool_uuid.py | 2 +- repos/storage/undefine_pool.py | 2 +- activityfilter.py => src/activityfilter.py | 0 casecfgcheck.py => src/casecfgcheck.py | 2 +- env_clear.py => src/env_clear.py | 2 +- exception.py => src/exception.py | 0 generator.py => src/generator.py | 2 +- log.css => src/log.css | 0 log.xsl => src/log.xsl | 0 logxmlparser.py => src/logxmlparser.py | 2 +- mapper.py => src/mapper.py | 0 parser.py => src/parser.py | 2 +- process.py => src/process.py | 0 proxy.py => src/proxy.py | 2 +- sharedmod.py => src/sharedmod.py | 0 utils/env_parser.py | 2 +- 109 files changed, 109 insertions(+), 109 deletions(-) create mode 100644 src/__init__.py rename activityfilter.py => src/activityfilter.py (100%) rename casecfgcheck.py => src/casecfgcheck.py (99%) rename env_clear.py => src/env_clear.py (99%) rename exception.py => src/exception.py (100%) rename generator.py => src/generator.py (99%) rename log.css => src/log.css (100%) rename log.xsl => src/log.xsl (100%) rename logxmlparser.py => src/logxmlparser.py (99%) rename mapper.py => src/mapper.py (100%) rename parser.py => src/parser.py (99%) rename process.py => src/process.py (100%) rename proxy.py => src/proxy.py (99%) rename sharedmod.py => src/sharedmod.py (100%) diff --git a/dist/redhat/env_inspect.py b/dist/redhat/env_inspect.py index b9b8ed0..06f6408 100644 --- a/dist/redhat/env_inspect.py +++ b/dist/redhat/env_inspect.py @@ -20,7 +20,7 @@ import commands import libvirt -import sharedmod +from src import sharedmod def check_libvirt(logger): virsh = 'virsh -v' diff --git a/libvirt-test-api b/libvirt-test-api index 409f260..651717c 100644 --- a/libvirt-test-api +++ b/libvirt-test-api @@ -22,15 +22,15 @@ import getopt import shutil import tempfile -import parser -import proxy -import generator -import env_clear -import process +from src import parser +from src import proxy +from src import generator +from src import env_clear +from src import process from utils import log -from logxmlparser import LogXMLParser -from activityfilter import Filter -from casecfgcheck import CaseCfgCheck +from src.logxmlparser import LogXMLParser +from src.activityfilter import Filter +from src.casecfgcheck import CaseCfgCheck def usage(): print "Usage: libvirt-test-api <OPTIONS> <ARGUMENTS>" diff --git a/repos/domain/attach_disk.py b/repos/domain/attach_disk.py index 9d8426d..d68d87b 100644 --- a/repos/domain/attach_disk.py +++ b/repos/domain/attach_disk.py @@ -10,7 +10,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import xmlbuilder diff --git a/repos/domain/attach_interface.py b/repos/domain/attach_interface.py index 1d0cb3c..5c9c507 100644 --- a/repos/domain/attach_interface.py +++ b/repos/domain/attach_interface.py @@ -8,7 +8,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import xmlbuilder diff --git a/repos/domain/autostart.py b/repos/domain/autostart.py index 1906706..da428c2 100644 --- a/repos/domain/autostart.py +++ b/repos/domain/autostart.py @@ -8,7 +8,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('guestname', 'autostart',) optional_params = () diff --git a/repos/domain/balloon_memory.py b/repos/domain/balloon_memory.py index 25b8318..6370bd7 100644 --- a/repos/domain/balloon_memory.py +++ b/repos/domain/balloon_memory.py @@ -11,7 +11,7 @@ from xml.dom import minidom import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import check diff --git a/repos/domain/blkstats.py b/repos/domain/blkstats.py index a208887..31bd37f 100644 --- a/repos/domain/blkstats.py +++ b/repos/domain/blkstats.py @@ -9,7 +9,7 @@ import libxml2 import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('guestname',) optional_params = () diff --git a/repos/domain/console_io.py b/repos/domain/console_io.py index c44f5b4..266b020 100644 --- a/repos/domain/console_io.py +++ b/repos/domain/console_io.py @@ -11,7 +11,7 @@ import os from libvirt import libvirtError from exception import TestError -import sharedmod +from src import sharedmod required_params = ('guestname',) optional_params = ('device', 'timeout', 'input', 'output', 'expect',) diff --git a/repos/domain/console_mutex.py b/repos/domain/console_mutex.py index c67aec6..bc8cb68 100644 --- a/repos/domain/console_mutex.py +++ b/repos/domain/console_mutex.py @@ -5,7 +5,7 @@ import libvirt from libvirt import libvirtError from exception import TestError -import sharedmod +from src import sharedmod required_params = ('guestname',) optional_params = ('device',) diff --git a/repos/domain/cpu_affinity.py b/repos/domain/cpu_affinity.py index 1332c7e..afc0f9b 100644 --- a/repos/domain/cpu_affinity.py +++ b/repos/domain/cpu_affinity.py @@ -12,7 +12,7 @@ from xml.dom import minidom import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('guestname', 'vcpu',) diff --git a/repos/domain/cpu_topology.py b/repos/domain/cpu_topology.py index af41f62..5dbe27b 100644 --- a/repos/domain/cpu_topology.py +++ b/repos/domain/cpu_topology.py @@ -10,7 +10,7 @@ from xml.dom import minidom import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('guestname', diff --git a/repos/domain/create.py b/repos/domain/create.py index 7b6a294..703ec3e 100644 --- a/repos/domain/create.py +++ b/repos/domain/create.py @@ -9,7 +9,7 @@ import time import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import xmlbuilder diff --git a/repos/domain/define.py b/repos/domain/define.py index 9d3b2eb..c8fe20e 100644 --- a/repos/domain/define.py +++ b/repos/domain/define.py @@ -10,7 +10,7 @@ import pexpect import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import xmlbuilder diff --git a/repos/domain/destroy.py b/repos/domain/destroy.py index c41f0f8..89de3e2 100644 --- a/repos/domain/destroy.py +++ b/repos/domain/destroy.py @@ -8,7 +8,7 @@ import time import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('guestname',) diff --git a/repos/domain/detach_disk.py b/repos/domain/detach_disk.py index 1b0b7f9..2ebf66e 100644 --- a/repos/domain/detach_disk.py +++ b/repos/domain/detach_disk.py @@ -9,7 +9,7 @@ import time import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import xmlbuilder diff --git a/repos/domain/detach_interface.py b/repos/domain/detach_interface.py index 050c019..c444b68 100644 --- a/repos/domain/detach_interface.py +++ b/repos/domain/detach_interface.py @@ -9,7 +9,7 @@ import time import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import xmlbuilder diff --git a/repos/domain/domain_blkinfo.py b/repos/domain/domain_blkinfo.py index aa52668..9aaecb2 100644 --- a/repos/domain/domain_blkinfo.py +++ b/repos/domain/domain_blkinfo.py @@ -9,7 +9,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod GET_DOMBLKINFO_MAC = "virsh domblkinfo %s %s | awk '{print $2}'" GET_CAPACITY = "du -b %s | awk '{print $1}'" diff --git a/repos/domain/domain_id.py b/repos/domain/domain_id.py index 844ce82..ff246ad 100644 --- a/repos/domain/domain_id.py +++ b/repos/domain/domain_id.py @@ -7,7 +7,7 @@ import re import commands import libvirt -import sharedmod +from src import sharedmod required_params = () optional_params = ('guestname',) diff --git a/repos/domain/domblkinfo.py b/repos/domain/domblkinfo.py index c543e41..b3c3c3e 100644 --- a/repos/domain/domblkinfo.py +++ b/repos/domain/domblkinfo.py @@ -9,7 +9,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('guestname', 'blockdev',) optional_params = () diff --git a/repos/domain/dump.py b/repos/domain/dump.py index 37cfac9..5cf4e68 100644 --- a/repos/domain/dump.py +++ b/repos/domain/dump.py @@ -10,7 +10,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import check diff --git a/repos/domain/eventhandler.py b/repos/domain/eventhandler.py index 4eec6e9..1b0c579 100644 --- a/repos/domain/eventhandler.py +++ b/repos/domain/eventhandler.py @@ -10,7 +10,7 @@ import threading import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod LoopThread = None looping = True diff --git a/repos/domain/ifstats.py b/repos/domain/ifstats.py index dd6c193..ec03203 100644 --- a/repos/domain/ifstats.py +++ b/repos/domain/ifstats.py @@ -10,7 +10,7 @@ import libxml2 import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('guestname',) diff --git a/repos/domain/install_image.py b/repos/domain/install_image.py index 0d2d7e2..b5ddc48 100644 --- a/repos/domain/install_image.py +++ b/repos/domain/install_image.py @@ -10,7 +10,7 @@ import urllib import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import env_parser from utils import xmlbuilder diff --git a/repos/domain/install_linux_cdrom.py b/repos/domain/install_linux_cdrom.py index 1805db2..cda5dce 100644 --- a/repos/domain/install_linux_cdrom.py +++ b/repos/domain/install_linux_cdrom.py @@ -13,7 +13,7 @@ import urllib import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import env_parser from utils import xmlbuilder diff --git a/repos/domain/install_linux_check.py b/repos/domain/install_linux_check.py index 2a1351d..859bb41 100644 --- a/repos/domain/install_linux_check.py +++ b/repos/domain/install_linux_check.py @@ -11,7 +11,7 @@ import math import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import check from utils import env_parser diff --git a/repos/domain/install_linux_net.py b/repos/domain/install_linux_net.py index ae5a063..63c0491 100644 --- a/repos/domain/install_linux_net.py +++ b/repos/domain/install_linux_net.py @@ -13,7 +13,7 @@ import urllib import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import env_parser from utils import xmlbuilder diff --git a/repos/domain/install_windows_cdrom.py b/repos/domain/install_windows_cdrom.py index a4c10e2..83c7357 100644 --- a/repos/domain/install_windows_cdrom.py +++ b/repos/domain/install_windows_cdrom.py @@ -12,7 +12,7 @@ import shutil import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import env_parser from utils import xmlbuilder diff --git a/repos/domain/migrate.py b/repos/domain/migrate.py index 4c319e4..2e6b40d 100644 --- a/repos/domain/migrate.py +++ b/repos/domain/migrate.py @@ -10,7 +10,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('transport', diff --git a/repos/domain/ownership_test.py b/repos/domain/ownership_test.py index ed7c992..7e03526 100644 --- a/repos/domain/ownership_test.py +++ b/repos/domain/ownership_test.py @@ -11,7 +11,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('guestname', 'dynamic_ownership', 'use_nfs',) diff --git a/repos/domain/reboot.py b/repos/domain/reboot.py index a2bd75a..afc1e9f 100644 --- a/repos/domain/reboot.py +++ b/repos/domain/reboot.py @@ -8,7 +8,7 @@ import time import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('guestname',) diff --git a/repos/domain/restore.py b/repos/domain/restore.py index ab0900f..fe1b2b2 100644 --- a/repos/domain/restore.py +++ b/repos/domain/restore.py @@ -8,7 +8,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('guestname', 'filepath',) diff --git a/repos/domain/resume.py b/repos/domain/resume.py index 85237f7..f37c4fc 100644 --- a/repos/domain/resume.py +++ b/repos/domain/resume.py @@ -7,7 +7,7 @@ import re import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('guestname',) diff --git a/repos/domain/save.py b/repos/domain/save.py index 37f1b97..eac39d2 100644 --- a/repos/domain/save.py +++ b/repos/domain/save.py @@ -8,7 +8,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('guestname', 'filepath',) diff --git a/repos/domain/sched_params.py b/repos/domain/sched_params.py index f8b7cef..ee21365 100644 --- a/repos/domain/sched_params.py +++ b/repos/domain/sched_params.py @@ -8,7 +8,7 @@ import commands import libvirt -import sharedmod +from src import sharedmod from utils import utils required_params = ('guestname', 'capshares',) diff --git a/repos/domain/shutdown.py b/repos/domain/shutdown.py index 3b97abc..b8154da 100644 --- a/repos/domain/shutdown.py +++ b/repos/domain/shutdown.py @@ -8,7 +8,7 @@ import time import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('guestname',) diff --git a/repos/domain/start.py b/repos/domain/start.py index f319c2e..325123d 100644 --- a/repos/domain/start.py +++ b/repos/domain/start.py @@ -8,7 +8,7 @@ import time import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('guestname',) diff --git a/repos/domain/suspend.py b/repos/domain/suspend.py index 1941b1c..5fe2b83 100644 --- a/repos/domain/suspend.py +++ b/repos/domain/suspend.py @@ -7,7 +7,7 @@ import time import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('guestname',) diff --git a/repos/domain/undefine.py b/repos/domain/undefine.py index 4b1bc20..9cf8c55 100644 --- a/repos/domain/undefine.py +++ b/repos/domain/undefine.py @@ -7,7 +7,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('guestname',) optional_params = () diff --git a/repos/domain/update_devflag.py b/repos/domain/update_devflag.py index 40961f4..e1b2cee 100644 --- a/repos/domain/update_devflag.py +++ b/repos/domain/update_devflag.py @@ -10,7 +10,7 @@ from xml.dom import minidom import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import xmlbuilder diff --git a/repos/interface/create.py b/repos/interface/create.py index b1cfe5e..9df3464 100644 --- a/repos/interface/create.py +++ b/repos/interface/create.py @@ -8,7 +8,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import xmlbuilder diff --git a/repos/interface/define.py b/repos/interface/define.py index 5d63989..630ae45 100644 --- a/repos/interface/define.py +++ b/repos/interface/define.py @@ -7,7 +7,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('ifacename', 'ifacetype',) diff --git a/repos/interface/destroy.py b/repos/interface/destroy.py index 20ae0f1..7dc0320 100644 --- a/repos/interface/destroy.py +++ b/repos/interface/destroy.py @@ -8,7 +8,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import xmlbuilder diff --git a/repos/interface/undefine.py b/repos/interface/undefine.py index b123472..757d3f9 100644 --- a/repos/interface/undefine.py +++ b/repos/interface/undefine.py @@ -7,7 +7,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('ifacename',) diff --git a/repos/libvirtd/qemu_hang.py b/repos/libvirtd/qemu_hang.py index b2d694b..12fb09f 100644 --- a/repos/libvirtd/qemu_hang.py +++ b/repos/libvirtd/qemu_hang.py @@ -10,7 +10,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('guestname',) diff --git a/repos/libvirtd/restart.py b/repos/libvirtd/restart.py index 04efa8a..3e06d4c 100644 --- a/repos/libvirtd/restart.py +++ b/repos/libvirtd/restart.py @@ -10,7 +10,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('guestname',) diff --git a/repos/network/autostart.py b/repos/network/autostart.py index 3cd13c8..4bf9692 100644 --- a/repos/network/autostart.py +++ b/repos/network/autostart.py @@ -10,7 +10,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('networkname', 'autostart',) optional_params = () diff --git a/repos/network/create.py b/repos/network/create.py index 3eac5b2..d50c84d 100644 --- a/repos/network/create.py +++ b/repos/network/create.py @@ -9,7 +9,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('networkname', diff --git a/repos/network/define.py b/repos/network/define.py index 222caa3..8c02d2a 100644 --- a/repos/network/define.py +++ b/repos/network/define.py @@ -9,7 +9,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('networkname', diff --git a/repos/network/destroy.py b/repos/network/destroy.py index 525f0f6..1361ff7 100644 --- a/repos/network/destroy.py +++ b/repos/network/destroy.py @@ -9,7 +9,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('networkname',) optional_params = () diff --git a/repos/network/network_list.py b/repos/network/network_list.py index 672ad79..fc571cf 100644 --- a/repos/network/network_list.py +++ b/repos/network/network_list.py @@ -9,7 +9,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('netlistopt',) diff --git a/repos/network/network_name.py b/repos/network/network_name.py index 8518de2..a07a957 100644 --- a/repos/network/network_name.py +++ b/repos/network/network_name.py @@ -9,7 +9,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('networkname',) optional_params = () diff --git a/repos/network/network_uuid.py b/repos/network/network_uuid.py index 4983056..29d8020 100644 --- a/repos/network/network_uuid.py +++ b/repos/network/network_uuid.py @@ -9,7 +9,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('networkname',) optional_params = () diff --git a/repos/network/start.py b/repos/network/start.py index 0b8f0c9..baa84c2 100644 --- a/repos/network/start.py +++ b/repos/network/start.py @@ -10,7 +10,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('networkname',) optional_params = () diff --git a/repos/network/undefine.py b/repos/network/undefine.py index 9015609..b088990 100644 --- a/repos/network/undefine.py +++ b/repos/network/undefine.py @@ -9,7 +9,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('networkname',) optional_params = () diff --git a/repos/nodedevice/detach.py b/repos/nodedevice/detach.py index b94db5d..3ae5b39 100644 --- a/repos/nodedevice/detach.py +++ b/repos/nodedevice/detach.py @@ -9,7 +9,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('pciaddress',) diff --git a/repos/nodedevice/reattach.py b/repos/nodedevice/reattach.py index adaf6c4..d8fd6a3 100644 --- a/repos/nodedevice/reattach.py +++ b/repos/nodedevice/reattach.py @@ -9,7 +9,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('pciaddress',) diff --git a/repos/nodedevice/reset.py b/repos/nodedevice/reset.py index 11cfa63..f758bf5 100644 --- a/repos/nodedevice/reset.py +++ b/repos/nodedevice/reset.py @@ -9,7 +9,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('pciaddress',) diff --git a/repos/npiv/create_virtual_hba.py b/repos/npiv/create_virtual_hba.py index b21fcd0..a558fbc 100644 --- a/repos/npiv/create_virtual_hba.py +++ b/repos/npiv/create_virtual_hba.py @@ -11,7 +11,7 @@ from utils import xmlbuilder import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('wwpn',) optional_params = () diff --git a/repos/regression/multiple_thread_block_on_domain_create.py b/repos/regression/multiple_thread_block_on_domain_create.py index 53332ab..9359705 100644 --- a/repos/regression/multiple_thread_block_on_domain_create.py +++ b/repos/regression/multiple_thread_block_on_domain_create.py @@ -13,7 +13,7 @@ from threading import Thread import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import env_parser from utils import xmlbuilder diff --git a/repos/remoteAccess/tcp_setup.py b/repos/remoteAccess/tcp_setup.py index a9d02cb..11c14a2 100644 --- a/repos/remoteAccess/tcp_setup.py +++ b/repos/remoteAccess/tcp_setup.py @@ -8,7 +8,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils required_params = ('target_machine', diff --git a/repos/sVirt/domain_nfs_start.py b/repos/sVirt/domain_nfs_start.py index e124800..650947c 100644 --- a/repos/sVirt/domain_nfs_start.py +++ b/repos/sVirt/domain_nfs_start.py @@ -13,7 +13,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from shutil import copy diff --git a/repos/snapshot/delete.py b/repos/snapshot/delete.py index c018cdb..a0f28a4 100644 --- a/repos/snapshot/delete.py +++ b/repos/snapshot/delete.py @@ -7,7 +7,7 @@ import re import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('guestname', 'snapshotname',) optional_params = () diff --git a/repos/snapshot/file_flag.py b/repos/snapshot/file_flag.py index 4d88416..dea1a02 100644 --- a/repos/snapshot/file_flag.py +++ b/repos/snapshot/file_flag.py @@ -9,7 +9,7 @@ import time import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import check diff --git a/repos/snapshot/flag_check.py b/repos/snapshot/flag_check.py index 7bdc14c..c9c24a6 100644 --- a/repos/snapshot/flag_check.py +++ b/repos/snapshot/flag_check.py @@ -8,7 +8,7 @@ import time import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import check diff --git a/repos/snapshot/internal_create.py b/repos/snapshot/internal_create.py index 20f9bbb..d0f3906 100644 --- a/repos/snapshot/internal_create.py +++ b/repos/snapshot/internal_create.py @@ -9,7 +9,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import xmlbuilder diff --git a/repos/snapshot/revert.py b/repos/snapshot/revert.py index d1820bf..d89d926 100644 --- a/repos/snapshot/revert.py +++ b/repos/snapshot/revert.py @@ -7,7 +7,7 @@ import re import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('guestname', 'snapshotname',) optional_params = () diff --git a/repos/storage/activate_pool.py b/repos/storage/activate_pool.py index 1aa1f0d..3954457 100644 --- a/repos/storage/activate_pool.py +++ b/repos/storage/activate_pool.py @@ -8,7 +8,7 @@ import time import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('poolname',) diff --git a/repos/storage/build_dir_pool.py b/repos/storage/build_dir_pool.py index 79ae026..cb76c59 100644 --- a/repos/storage/build_dir_pool.py +++ b/repos/storage/build_dir_pool.py @@ -10,7 +10,7 @@ from xml.dom import minidom import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('poolname',) optional_params = () diff --git a/repos/storage/build_disk_pool.py b/repos/storage/build_disk_pool.py index 49ee856..d9838d8 100644 --- a/repos/storage/build_disk_pool.py +++ b/repos/storage/build_disk_pool.py @@ -10,7 +10,7 @@ from xml.dom import minidom import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('poolname',) optional_params = () diff --git a/repos/storage/build_logical_pool.py b/repos/storage/build_logical_pool.py index c372db7..1c743e3 100644 --- a/repos/storage/build_logical_pool.py +++ b/repos/storage/build_logical_pool.py @@ -8,7 +8,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('poolname',) optional_params = () diff --git a/repos/storage/build_netfs_pool.py b/repos/storage/build_netfs_pool.py index f0e06ca..168242d 100644 --- a/repos/storage/build_netfs_pool.py +++ b/repos/storage/build_netfs_pool.py @@ -8,7 +8,7 @@ from xml.dom import minidom import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('poolname',) optional_params = () diff --git a/repos/storage/create_dir_pool.py b/repos/storage/create_dir_pool.py index f255a6e..067ae92 100644 --- a/repos/storage/create_dir_pool.py +++ b/repos/storage/create_dir_pool.py @@ -8,7 +8,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('poolname', 'pooltype',) diff --git a/repos/storage/create_dir_volume.py b/repos/storage/create_dir_volume.py index 7084d20..155eb3b 100644 --- a/repos/storage/create_dir_volume.py +++ b/repos/storage/create_dir_volume.py @@ -10,7 +10,7 @@ from xml.dom import minidom import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('poolname', 'volname', 'volformat', 'capacity',) diff --git a/repos/storage/create_fs_pool.py b/repos/storage/create_fs_pool.py index e338428..7daf5f6 100644 --- a/repos/storage/create_fs_pool.py +++ b/repos/storage/create_fs_pool.py @@ -8,7 +8,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder from utils import XMLParser diff --git a/repos/storage/create_iscsi_pool.py b/repos/storage/create_iscsi_pool.py index 889d2de..f108a59 100644 --- a/repos/storage/create_iscsi_pool.py +++ b/repos/storage/create_iscsi_pool.py @@ -7,7 +7,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('poolname', 'sourcename', 'sourcepath', 'pooltype',) diff --git a/repos/storage/create_logical_volume.py b/repos/storage/create_logical_volume.py index 8c20eb8..714480c 100644 --- a/repos/storage/create_logical_volume.py +++ b/repos/storage/create_logical_volume.py @@ -10,7 +10,7 @@ from xml.dom import minidom import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import utils from utils import xmlbuilder diff --git a/repos/storage/create_netfs_pool.py b/repos/storage/create_netfs_pool.py index e37468c..2a0cd23 100644 --- a/repos/storage/create_netfs_pool.py +++ b/repos/storage/create_netfs_pool.py @@ -8,7 +8,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder from utils import XMLParser diff --git a/repos/storage/create_netfs_volume.py b/repos/storage/create_netfs_volume.py index 374eba6..e5f711a 100644 --- a/repos/storage/create_netfs_volume.py +++ b/repos/storage/create_netfs_volume.py @@ -10,7 +10,7 @@ from xml.dom import minidom import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('poolname', 'volname', 'volformat', 'capacity',) diff --git a/repos/storage/create_partition_volume.py b/repos/storage/create_partition_volume.py index 02b91b6..3ba802b 100644 --- a/repos/storage/create_partition_volume.py +++ b/repos/storage/create_partition_volume.py @@ -9,7 +9,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('poolname', 'volname', 'volformat', 'capacity',) diff --git a/repos/storage/define_dir_pool.py b/repos/storage/define_dir_pool.py index c48e8e4..b45767d 100644 --- a/repos/storage/define_dir_pool.py +++ b/repos/storage/define_dir_pool.py @@ -9,7 +9,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder VIRSH_POOLLIST = "virsh --quiet pool-list --all|awk '{print $1}'|grep \"^%s$\"" diff --git a/repos/storage/define_disk_pool.py b/repos/storage/define_disk_pool.py index dcf7219..619292f 100644 --- a/repos/storage/define_disk_pool.py +++ b/repos/storage/define_disk_pool.py @@ -8,7 +8,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('poolname', 'pooltype', 'sourcepath',) diff --git a/repos/storage/define_iscsi_pool.py b/repos/storage/define_iscsi_pool.py index df61a24..fdb09a2 100644 --- a/repos/storage/define_iscsi_pool.py +++ b/repos/storage/define_iscsi_pool.py @@ -8,7 +8,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('poolname', 'pooltype', 'sourcename', 'sourcepath',) diff --git a/repos/storage/define_logical_pool.py b/repos/storage/define_logical_pool.py index 6c06a43..ebbdc76 100644 --- a/repos/storage/define_logical_pool.py +++ b/repos/storage/define_logical_pool.py @@ -8,7 +8,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('poolname', 'pooltype', 'sourcename', 'sourcepath',) diff --git a/repos/storage/define_mpath_pool.py b/repos/storage/define_mpath_pool.py index 5bb972c..930f9b8 100644 --- a/repos/storage/define_mpath_pool.py +++ b/repos/storage/define_mpath_pool.py @@ -7,7 +7,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('poolname', 'pooltype',) diff --git a/repos/storage/define_netfs_pool.py b/repos/storage/define_netfs_pool.py index c522970..e607da2 100644 --- a/repos/storage/define_netfs_pool.py +++ b/repos/storage/define_netfs_pool.py @@ -8,7 +8,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('poolname', 'pooltype', 'sourcename', 'sourcepath',) diff --git a/repos/storage/define_scsi_pool.py b/repos/storage/define_scsi_pool.py index b163df8..8be591a 100644 --- a/repos/storage/define_scsi_pool.py +++ b/repos/storage/define_scsi_pool.py @@ -8,7 +8,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('poolname', 'pooltype', 'sourcename',) diff --git a/repos/storage/delete_dir_volume.py b/repos/storage/delete_dir_volume.py index 3a21d20..92853f4 100644 --- a/repos/storage/delete_dir_volume.py +++ b/repos/storage/delete_dir_volume.py @@ -8,7 +8,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('poolname', 'volname',) optional_params = () diff --git a/repos/storage/delete_logical_pool.py b/repos/storage/delete_logical_pool.py index f2904e6..9bfb555 100644 --- a/repos/storage/delete_logical_pool.py +++ b/repos/storage/delete_logical_pool.py @@ -9,7 +9,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('poolname',) optional_params = () diff --git a/repos/storage/delete_logical_volume.py b/repos/storage/delete_logical_volume.py index 1650a85..cbf3ccc 100644 --- a/repos/storage/delete_logical_volume.py +++ b/repos/storage/delete_logical_volume.py @@ -9,7 +9,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('poolname', 'volname',) optional_params = () diff --git a/repos/storage/delete_netfs_volume.py b/repos/storage/delete_netfs_volume.py index b03889b..73f995f 100644 --- a/repos/storage/delete_netfs_volume.py +++ b/repos/storage/delete_netfs_volume.py @@ -8,7 +8,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('poolname', 'volname',) optional_params = () diff --git a/repos/storage/delete_partition_volume.py b/repos/storage/delete_partition_volume.py index 8a61a1d..b70ff45 100644 --- a/repos/storage/delete_partition_volume.py +++ b/repos/storage/delete_partition_volume.py @@ -8,7 +8,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('poolname', 'volname',) diff --git a/repos/storage/destroy_pool.py b/repos/storage/destroy_pool.py index 01547a4..304f1bb 100644 --- a/repos/storage/destroy_pool.py +++ b/repos/storage/destroy_pool.py @@ -7,7 +7,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod from utils import xmlbuilder required_params = ('poolname',) diff --git a/repos/storage/pool_name.py b/repos/storage/pool_name.py index ce14da5..981e76d 100644 --- a/repos/storage/pool_name.py +++ b/repos/storage/pool_name.py @@ -9,7 +9,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('poolname',) optional_params = () diff --git a/repos/storage/pool_uuid.py b/repos/storage/pool_uuid.py index 7fa03b9..8f77ba7 100644 --- a/repos/storage/pool_uuid.py +++ b/repos/storage/pool_uuid.py @@ -9,7 +9,7 @@ import commands import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('poolname',) optional_params = () diff --git a/repos/storage/undefine_pool.py b/repos/storage/undefine_pool.py index 8fe26c4..8832c36 100644 --- a/repos/storage/undefine_pool.py +++ b/repos/storage/undefine_pool.py @@ -7,7 +7,7 @@ import sys import libvirt from libvirt import libvirtError -import sharedmod +from src import sharedmod required_params = ('poolname',) optional_params = () diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/activityfilter.py b/src/activityfilter.py similarity index 100% rename from activityfilter.py rename to src/activityfilter.py diff --git a/casecfgcheck.py b/src/casecfgcheck.py similarity index 99% rename from casecfgcheck.py rename to src/casecfgcheck.py index 5e513e1..252f4a4 100644 --- a/casecfgcheck.py +++ b/src/casecfgcheck.py @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -import proxy +from src import proxy class CaseCfgCheck(object): """validate the options in testcase config file""" diff --git a/env_clear.py b/src/env_clear.py similarity index 99% rename from env_clear.py rename to src/env_clear.py index ed862db..cf02326 100644 --- a/env_clear.py +++ b/src/env_clear.py @@ -18,7 +18,7 @@ # This module matches the reference of clearing function from each testcase # to the corresponding testcase's argument in the order of testcase running -import mapper +from src import mapper from utils import log class EnvClear(object): diff --git a/exception.py b/src/exception.py similarity index 100% rename from exception.py rename to src/exception.py diff --git a/generator.py b/src/generator.py similarity index 99% rename from generator.py rename to src/generator.py index fc4fc76..4d358d7 100644 --- a/generator.py +++ b/src/generator.py @@ -24,7 +24,7 @@ import sys import os import traceback -import mapper +from src import mapper from utils import log from utils import format from utils import env_parser diff --git a/log.css b/src/log.css similarity index 100% rename from log.css rename to src/log.css diff --git a/log.xsl b/src/log.xsl similarity index 100% rename from log.xsl rename to src/log.xsl diff --git a/logxmlparser.py b/src/logxmlparser.py similarity index 99% rename from logxmlparser.py rename to src/logxmlparser.py index ed45594..d2fe7f5 100644 --- a/logxmlparser.py +++ b/src/logxmlparser.py @@ -25,7 +25,7 @@ import copy from xml.dom import minidom from xml.dom.minidom import Document -import exception +from src import exception class LogXMLParser(object): """ Generate and parser log xml file diff --git a/mapper.py b/src/mapper.py similarity index 100% rename from mapper.py rename to src/mapper.py diff --git a/parser.py b/src/parser.py similarity index 99% rename from parser.py rename to src/parser.py index 07d1498..9ef0eee 100644 --- a/parser.py +++ b/src/parser.py @@ -21,10 +21,10 @@ import re import os import sys import copy -import exception import string from utils import env_parser +from src import exception class CaseFileParser(object): """ Parser the case configuration file to generate a data list. diff --git a/process.py b/src/process.py similarity index 100% rename from process.py rename to src/process.py diff --git a/proxy.py b/src/proxy.py similarity index 99% rename from proxy.py rename to src/proxy.py index 7e81319..5163bd2 100644 --- a/proxy.py +++ b/src/proxy.py @@ -20,7 +20,7 @@ # The proxy examines the list of unique test cases, received from the # generator and import each test case from appropriate module directory. -import exception +from src import exception class Proxy(object): """ The Proxy class is used for getting real function call reference """ diff --git a/sharedmod.py b/src/sharedmod.py similarity index 100% rename from sharedmod.py rename to src/sharedmod.py diff --git a/utils/env_parser.py b/utils/env_parser.py index 6e49e50..58f05fc 100644 --- a/utils/env_parser.py +++ b/utils/env_parser.py @@ -27,7 +27,7 @@ dir = os.path.dirname(sys.modules[__name__].__file__) absdir = os.path.abspath(dir) sys.path.append(os.path.split(absdir)[0]) -import exception +from src import exception class Envparser(object): def __init__(self, configfile): -- 1.7.7.3

On 04/18/2012 01:49 PM, Osier Yang wrote:
The "import" statements are updated incidentally. --- dist/redhat/env_inspect.py | 2 +- libvirt-test-api | 16 ++++++++-------- repos/domain/attach_disk.py | 2 +- repos/domain/attach_interface.py | 2 +- repos/domain/autostart.py | 2 +- repos/domain/balloon_memory.py | 2 +- repos/domain/blkstats.py | 2 +- repos/domain/console_io.py | 2 +- repos/domain/console_mutex.py | 2 +- repos/domain/cpu_affinity.py | 2 +- repos/domain/cpu_topology.py | 2 +- repos/domain/create.py | 2 +- repos/domain/define.py | 2 +- repos/domain/destroy.py | 2 +- repos/domain/detach_disk.py | 2 +- repos/domain/detach_interface.py | 2 +- repos/domain/domain_blkinfo.py | 2 +- repos/domain/domain_id.py | 2 +- repos/domain/domblkinfo.py | 2 +- repos/domain/dump.py | 2 +- repos/domain/eventhandler.py | 2 +- repos/domain/ifstats.py | 2 +- repos/domain/install_image.py | 2 +- repos/domain/install_linux_cdrom.py | 2 +- repos/domain/install_linux_check.py | 2 +- repos/domain/install_linux_net.py | 2 +- repos/domain/install_windows_cdrom.py | 2 +- repos/domain/migrate.py | 2 +- repos/domain/ownership_test.py | 2 +- repos/domain/reboot.py | 2 +- repos/domain/restore.py | 2 +- repos/domain/resume.py | 2 +- repos/domain/save.py | 2 +- repos/domain/sched_params.py | 2 +- repos/domain/shutdown.py | 2 +- repos/domain/start.py | 2 +- repos/domain/suspend.py | 2 +- repos/domain/undefine.py | 2 +- repos/domain/update_devflag.py | 2 +- repos/interface/create.py | 2 +- repos/interface/define.py | 2 +- repos/interface/destroy.py | 2 +- repos/interface/undefine.py | 2 +- repos/libvirtd/qemu_hang.py | 2 +- repos/libvirtd/restart.py | 2 +- repos/network/autostart.py | 2 +- repos/network/create.py | 2 +- repos/network/define.py | 2 +- repos/network/destroy.py | 2 +- repos/network/network_list.py | 2 +- repos/network/network_name.py | 2 +- repos/network/network_uuid.py | 2 +- repos/network/start.py | 2 +- repos/network/undefine.py | 2 +- repos/nodedevice/detach.py | 2 +- repos/nodedevice/reattach.py | 2 +- repos/nodedevice/reset.py | 2 +- repos/npiv/create_virtual_hba.py | 2 +- .../multiple_thread_block_on_domain_create.py | 2 +- repos/remoteAccess/tcp_setup.py | 2 +- repos/sVirt/domain_nfs_start.py | 2 +- repos/snapshot/delete.py | 2 +- repos/snapshot/file_flag.py | 2 +- repos/snapshot/flag_check.py | 2 +- repos/snapshot/internal_create.py | 2 +- repos/snapshot/revert.py | 2 +- repos/storage/activate_pool.py | 2 +- repos/storage/build_dir_pool.py | 2 +- repos/storage/build_disk_pool.py | 2 +- repos/storage/build_logical_pool.py | 2 +- repos/storage/build_netfs_pool.py | 2 +- repos/storage/create_dir_pool.py | 2 +- repos/storage/create_dir_volume.py | 2 +- repos/storage/create_fs_pool.py | 2 +- repos/storage/create_iscsi_pool.py | 2 +- repos/storage/create_logical_volume.py | 2 +- repos/storage/create_netfs_pool.py | 2 +- repos/storage/create_netfs_volume.py | 2 +- repos/storage/create_partition_volume.py | 2 +- repos/storage/define_dir_pool.py | 2 +- repos/storage/define_disk_pool.py | 2 +- repos/storage/define_iscsi_pool.py | 2 +- repos/storage/define_logical_pool.py | 2 +- repos/storage/define_mpath_pool.py | 2 +- repos/storage/define_netfs_pool.py | 2 +- repos/storage/define_scsi_pool.py | 2 +- repos/storage/delete_dir_volume.py | 2 +- repos/storage/delete_logical_pool.py | 2 +- repos/storage/delete_logical_volume.py | 2 +- repos/storage/delete_netfs_volume.py | 2 +- repos/storage/delete_partition_volume.py | 2 +- repos/storage/destroy_pool.py | 2 +- repos/storage/pool_name.py | 2 +- repos/storage/pool_uuid.py | 2 +- repos/storage/undefine_pool.py | 2 +- activityfilter.py => src/activityfilter.py | 0 casecfgcheck.py => src/casecfgcheck.py | 2 +- env_clear.py => src/env_clear.py | 2 +- exception.py => src/exception.py | 0 generator.py => src/generator.py | 2 +- log.css => src/log.css | 0 log.xsl => src/log.xsl | 0 logxmlparser.py => src/logxmlparser.py | 2 +- mapper.py => src/mapper.py | 0 parser.py => src/parser.py | 2 +- process.py => src/process.py | 0 proxy.py => src/proxy.py | 2 +- sharedmod.py => src/sharedmod.py | 0 utils/env_parser.py | 2 +- 109 files changed, 109 insertions(+), 109 deletions(-) create mode 100644 src/__init__.py rename activityfilter.py => src/activityfilter.py (100%) rename casecfgcheck.py => src/casecfgcheck.py (99%) rename env_clear.py => src/env_clear.py (99%) rename exception.py => src/exception.py (100%) rename generator.py => src/generator.py (99%) rename log.css => src/log.css (100%) rename log.xsl => src/log.xsl (100%) rename logxmlparser.py => src/logxmlparser.py (99%) rename mapper.py => src/mapper.py (100%) rename parser.py => src/parser.py (99%) rename process.py => src/process.py (100%) rename proxy.py => src/proxy.py (99%) rename sharedmod.py => src/sharedmod.py (100%)
I am ok about the change, It's sound wired to use the following words in testcase. from src import .... Is there any better name than src :) ACK Guannan Ren

This should be caused by previous 'utils/utils.py' cleaning up --- repos/domain/install_linux_cdrom.py | 6 +++--- repos/domain/install_linux_net.py | 6 +++--- repos/domain/install_windows_cdrom.py | 4 ++-- repos/remoteAccess/tls_setup.py | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/repos/domain/install_linux_cdrom.py b/repos/domain/install_linux_cdrom.py index cda5dce..97ffc47 100644 --- a/repos/domain/install_linux_cdrom.py +++ b/repos/domain/install_linux_cdrom.py @@ -53,7 +53,7 @@ def prepare_cdrom(*args): if os.path.exists(new_dir): logger.info("the folder exists, remove it") - shutils.rmtree(new_dir) + shutil.rmtree(new_dir) os.makedirs(new_dir) logger.info("the directory is %s" % new_dir) @@ -67,7 +67,7 @@ def prepare_cdrom(*args): urllib.urlretrieve(ks, '%s/%s' % (new_dir, ks_name))[0] logger.info("the url of kickstart is %s" % ks) - shutils.copy('utils/ksiso.sh', new_dir) + shutil.copy('utils/ksiso.sh', new_dir) src_path = os.getcwd() logger.info("enter into the workshop folder: %s" % new_dir) @@ -418,4 +418,4 @@ def install_linux_cdrom_clean(params): elif guesttype == 'xenfv' or guesttype == 'kvm': guest_dir = os.path.join(HOME_PATH, guestname) if os.path.exists(guest_dir): - shutils.rmtree(guest_dir) + shutil.rmtree(guest_dir) diff --git a/repos/domain/install_linux_net.py b/repos/domain/install_linux_net.py index 63c0491..29ace99 100644 --- a/repos/domain/install_linux_net.py +++ b/repos/domain/install_linux_net.py @@ -98,7 +98,7 @@ def prepare_cdrom(*args): if os.path.exists(new_dir): logger.info("the folder exists, remove it") - shutils.rmtree(new_dir) + shutil.rmtree(new_dir) os.makedirs(new_dir) logger.info("the directory is %s" % new_dir) @@ -112,7 +112,7 @@ def prepare_cdrom(*args): urllib.urlretrieve(ks, '%s/%s' % (new_dir, ks_name))[0] logger.info("the url of kickstart is %s" % ks) - shutils.copy('utils/ksiso.sh', new_dir) + shutil.copy('utils/ksiso.sh', new_dir) src_path = os.getcwd() logger.info("enter into the workshop folder: %s" % new_dir) @@ -408,4 +408,4 @@ def install_linux_net_clean(params): elif guesttype == 'xenfv': guest_dir = os.path.join(HOME_PATH, guestname) if os.path.exists(guest_dir): - shutils.rmtree(guest_dir) + shutil.rmtree(guest_dir) diff --git a/repos/domain/install_windows_cdrom.py b/repos/domain/install_windows_cdrom.py index 83c7357..6f287d5 100644 --- a/repos/domain/install_windows_cdrom.py +++ b/repos/domain/install_windows_cdrom.py @@ -90,7 +90,7 @@ def prepare_floppy_image(guestname, guestos, guestarch, floppy_mount = "/mnt/libvirt_floppy" if os.path.exists(floppy_mount): logger.info("the floppy mount point folder exists, remove it") - shutils.rmtree(floppy_mount) + shutil.rmtree(floppy_mount) logger.info("create mount point %s" % floppy_mount) os.makedirs(floppy_mount) @@ -113,7 +113,7 @@ def prepare_floppy_image(guestname, guestos, guestarch, setup_file = 'winnt.bat' setup_file_path = os.path.join(windows_unattended_path, setup_file) setup_file_dest = os.path.join(floppy_mount, setup_file) - shutils.copyfile(setup_file_path, setup_file_dest) + shutil.copyfile(setup_file_path, setup_file_dest) source = os.path.join(windows_unattended_path, "%s_%s.sif" % (guestos, guestarch)) diff --git a/repos/remoteAccess/tls_setup.py b/repos/remoteAccess/tls_setup.py index 4661e03..7ce2e84 100644 --- a/repos/remoteAccess/tls_setup.py +++ b/repos/remoteAccess/tls_setup.py @@ -351,7 +351,7 @@ def tls_setup(params): if params.has_key('pkipath'): pkipath = params['pkipath'] if os.path.exists(pkipath): - shutils.rmtree(pkipath) + shutil.rmtree(pkipath) os.mkdir(pkipath) @@ -371,7 +371,7 @@ def tls_setup(params): return 1 if os.path.exists(TEMP_TLS_FOLDER): - shutils.rmtree(TEMP_TLS_FOLDER) + shutil.rmtree(TEMP_TLS_FOLDER) os.mkdir(TEMP_TLS_FOLDER) @@ -413,7 +413,7 @@ def tls_setup(params): def tls_setup_clean(params): """ cleanup testing enviroment """ if os.path.exists(TEMP_TLS_FOLDER): - shutils.rmtree(TEMP_TLS_FOLDER) + shutil.rmtree(TEMP_TLS_FOLDER) logger = params['logger'] target_machine = params['target_machine'] @@ -435,7 +435,7 @@ def tls_setup_clean(params): logger.error("failed to remove libvirt folder") os.remove("%s/cacert.pem" % CA_FOLDER) - shutils.rmtree(CERTIFICATE_FOLDER) + shutil.rmtree(CERTIFICATE_FOLDER) if auth_tls == 'sasl': saslpasswd2_delete = "%s -a libvirt -d %s" % (SASLPASSWD2, username) -- 1.7.7.3

On 04/18/2012 01:49 PM, Osier Yang wrote:
This should be caused by previous 'utils/utils.py' cleaning up --- repos/domain/install_linux_cdrom.py | 6 +++--- repos/domain/install_linux_net.py | 6 +++--- repos/domain/install_windows_cdrom.py | 4 ++-- repos/remoteAccess/tls_setup.py | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/repos/domain/install_linux_cdrom.py b/repos/domain/install_linux_cdrom.py index cda5dce..97ffc47 100644 --- a/repos/domain/install_linux_cdrom.py +++ b/repos/domain/install_linux_cdrom.py @@ -53,7 +53,7 @@ def prepare_cdrom(*args):
if os.path.exists(new_dir): logger.info("the folder exists, remove it") - shutils.rmtree(new_dir) + shutil.rmtree(new_dir)
os.makedirs(new_dir) logger.info("the directory is %s" % new_dir) @@ -67,7 +67,7 @@ def prepare_cdrom(*args): urllib.urlretrieve(ks, '%s/%s' % (new_dir, ks_name))[0] logger.info("the url of kickstart is %s" % ks)
- shutils.copy('utils/ksiso.sh', new_dir) + shutil.copy('utils/ksiso.sh', new_dir) src_path = os.getcwd()
logger.info("enter into the workshop folder: %s" % new_dir) @@ -418,4 +418,4 @@ def install_linux_cdrom_clean(params): elif guesttype == 'xenfv' or guesttype == 'kvm': guest_dir = os.path.join(HOME_PATH, guestname) if os.path.exists(guest_dir): - shutils.rmtree(guest_dir) + shutil.rmtree(guest_dir) diff --git a/repos/domain/install_linux_net.py b/repos/domain/install_linux_net.py index 63c0491..29ace99 100644 --- a/repos/domain/install_linux_net.py +++ b/repos/domain/install_linux_net.py @@ -98,7 +98,7 @@ def prepare_cdrom(*args):
if os.path.exists(new_dir): logger.info("the folder exists, remove it") - shutils.rmtree(new_dir) + shutil.rmtree(new_dir)
os.makedirs(new_dir) logger.info("the directory is %s" % new_dir) @@ -112,7 +112,7 @@ def prepare_cdrom(*args): urllib.urlretrieve(ks, '%s/%s' % (new_dir, ks_name))[0] logger.info("the url of kickstart is %s" % ks)
- shutils.copy('utils/ksiso.sh', new_dir) + shutil.copy('utils/ksiso.sh', new_dir) src_path = os.getcwd()
logger.info("enter into the workshop folder: %s" % new_dir) @@ -408,4 +408,4 @@ def install_linux_net_clean(params): elif guesttype == 'xenfv': guest_dir = os.path.join(HOME_PATH, guestname) if os.path.exists(guest_dir): - shutils.rmtree(guest_dir) + shutil.rmtree(guest_dir) diff --git a/repos/domain/install_windows_cdrom.py b/repos/domain/install_windows_cdrom.py index 83c7357..6f287d5 100644 --- a/repos/domain/install_windows_cdrom.py +++ b/repos/domain/install_windows_cdrom.py @@ -90,7 +90,7 @@ def prepare_floppy_image(guestname, guestos, guestarch, floppy_mount = "/mnt/libvirt_floppy" if os.path.exists(floppy_mount): logger.info("the floppy mount point folder exists, remove it") - shutils.rmtree(floppy_mount) + shutil.rmtree(floppy_mount)
logger.info("create mount point %s" % floppy_mount) os.makedirs(floppy_mount) @@ -113,7 +113,7 @@ def prepare_floppy_image(guestname, guestos, guestarch, setup_file = 'winnt.bat' setup_file_path = os.path.join(windows_unattended_path, setup_file) setup_file_dest = os.path.join(floppy_mount, setup_file) - shutils.copyfile(setup_file_path, setup_file_dest) + shutil.copyfile(setup_file_path, setup_file_dest) source = os.path.join(windows_unattended_path, "%s_%s.sif" % (guestos, guestarch))
diff --git a/repos/remoteAccess/tls_setup.py b/repos/remoteAccess/tls_setup.py index 4661e03..7ce2e84 100644 --- a/repos/remoteAccess/tls_setup.py +++ b/repos/remoteAccess/tls_setup.py @@ -351,7 +351,7 @@ def tls_setup(params): if params.has_key('pkipath'): pkipath = params['pkipath'] if os.path.exists(pkipath): - shutils.rmtree(pkipath) + shutil.rmtree(pkipath)
os.mkdir(pkipath)
@@ -371,7 +371,7 @@ def tls_setup(params): return 1
if os.path.exists(TEMP_TLS_FOLDER): - shutils.rmtree(TEMP_TLS_FOLDER) + shutil.rmtree(TEMP_TLS_FOLDER)
os.mkdir(TEMP_TLS_FOLDER)
@@ -413,7 +413,7 @@ def tls_setup(params): def tls_setup_clean(params): """ cleanup testing enviroment """ if os.path.exists(TEMP_TLS_FOLDER): - shutils.rmtree(TEMP_TLS_FOLDER) + shutil.rmtree(TEMP_TLS_FOLDER)
logger = params['logger'] target_machine = params['target_machine'] @@ -435,7 +435,7 @@ def tls_setup_clean(params): logger.error("failed to remove libvirt folder")
os.remove("%s/cacert.pem" % CA_FOLDER) - shutils.rmtree(CERTIFICATE_FOLDER) + shutil.rmtree(CERTIFICATE_FOLDER)
if auth_tls == 'sasl': saslpasswd2_delete = "%s -a libvirt -d %s" % (SASLPASSWD2, username)
ACK Guannan Ren

--- .../install-autotest-server | 0 1 files changed, 0 insertions(+), 0 deletions(-) rename install-autotest-server => scripts/install-autotest-server (100%) diff --git a/install-autotest-server b/scripts/install-autotest-server similarity index 100% rename from install-autotest-server rename to scripts/install-autotest-server -- 1.7.7.3

On 04/18/2012 01:49 PM, Osier Yang wrote:
--- .../install-autotest-server | 0 1 files changed, 0 insertions(+), 0 deletions(-) rename install-autotest-server => scripts/install-autotest-server (100%)
diff --git a/install-autotest-server b/scripts/install-autotest-server similarity index 100% rename from install-autotest-server rename to scripts/install-autotest-server
The test-API has been in autotest, so it's good for guys who want to use autotest . ACK Guannan Ren

--- src/log.xsl | 2 +- src/logxmlparser.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/log.xsl b/src/log.xsl index 84ad5fa..7b8f47c 100644 --- a/src/log.xsl +++ b/src/log.xsl @@ -5,7 +5,7 @@ <html> <head> <title>Libvirt testing log</title> - <link rel="stylesheet" href="log.css" type="text/css" media="screen" /> + <link rel="stylesheet" href="src/log.css" type="text/css" media="screen" /> <script language="javascript"> <
On 04/18/2012 01:49 PM, Osier Yang wrote:
--- src/log.xsl | 2 +- src/logxmlparser.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/log.xsl b/src/log.xsl index 84ad5fa..7b8f47c 100644 --- a/src/log.xsl +++ b/src/log.xsl @@ -5,7 +5,7 @@ <html> <head> <title>Libvirt testing log</title> -<link rel="stylesheet" href="log.css" type="text/css" media="screen" /> +<link rel="stylesheet" href="src/log.css" type="text/css" media="screen" /> <script language="javascript"> <
--- libvirt-test-api | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/libvirt-test-api b/libvirt-test-api index 651717c..b7c2468 100644 --- a/libvirt-test-api +++ b/libvirt-test-api @@ -37,7 +37,8 @@ def usage(): print "\noptions: -h, --help : Display usage information \ \n -c, --casefile: Specify configuration file \ \n -t, --template: Print testcase config file template \ - \n -f, --logxml: Specify log file with type xml \ + \n -f, --logxml: Specify log file with type xml,\ + \n defaults to log.xml in current directory \ \n -l, --log-level: 0 or 1 currently \ \n -d, --delete-log: Delete log items \ \n -m, --merge: Merge two log xmlfiles \ -- 1.7.7.3

On 04/18/2012 01:49 PM, Osier Yang wrote:
--- libvirt-test-api | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libvirt-test-api b/libvirt-test-api index 651717c..b7c2468 100644 --- a/libvirt-test-api +++ b/libvirt-test-api @@ -37,7 +37,8 @@ def usage(): print "\noptions: -h, --help : Display usage information \ \n -c, --casefile: Specify configuration file \ \n -t, --template: Print testcase config file template \ - \n -f, --logxml: Specify log file with type xml \ + \n -f, --logxml: Specify log file with type xml,\ + \n defaults to log.xml in current directory \ \n -l, --log-level: 0 or 1 currently \ \n -d, --delete-log: Delete log items \ \n -m, --merge: Merge two log xmlfiles \
ACK Guannan Ren

Skipping only step(s) of a test case doesn't make sense, e.g. there is a bug of domain defining, if we only skip the "domain:define" in all test cases, that means all the followup steps (e.g. domain start, checking) of all of the test cases use "domain:define" will run forward blindly. That's really not correct. This patch modify the syntax so that it skip the whole test case due to either a bug or lacking of testing environment. And thus the name is changed into "SKIP". No codes to support the new syntax yet, but it's fine, as we still don't support to execute all test cases in a bundle. And the syntax to skip step(s) in test cases should be just destroyed. There will be follow up patches to destroy the codes to skip test steps in test cases, and patches to support to execute all test cases in a bundle and the new skipping syntax. --- BUGSKIP | 4 ---- SKIP | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) delete mode 100644 BUGSKIP create mode 100644 SKIP diff --git a/BUGSKIP b/BUGSKIP deleted file mode 100644 index 70972d4..0000000 --- a/BUGSKIP +++ /dev/null @@ -1,4 +0,0 @@ -# This is a file for skipping a testcase due to an already bug in bugzilla -# example as follows -# casename:domain:destroy id:12345 bugzilla:http://bugzilla.redhat.com/bugid description:"This is a bug" -# diff --git a/SKIP b/SKIP new file mode 100644 index 0000000..442e8ca --- /dev/null +++ b/SKIP @@ -0,0 +1,26 @@ +# Skip cases due to existed bug, or lacking of testing environment. +# +# The format: +# { +# case: $casename +# bugzilla: $bug_uri +# reason: $why_to_skip +# } +# +# Fields "case" and "reason" is required, "bug" is optional. +# +# Example: +# +# Skip case 'cases/foo.conf' due to a bug +# { +# case: "cases/foo.conf", +# bug: http://bugzilla.redhat.com/show_bug.cgi?id=809783 +# reason: "It's bug!", +# } +# +# Skip case due to lacking of testing environment +# +# { +# case: "cases/bar.conf", +# reason: "Lacks of device" +# } -- 1.7.7.3

On 04/18/2012 01:49 PM, Osier Yang wrote:
Skipping only step(s) of a test case doesn't make sense, e.g. there is a bug of domain defining, if we only skip the "domain:define" in all test cases, that means all the followup steps (e.g. domain start, checking) of all of the test cases use "domain:define" will run forward blindly. That's really not correct.
This patch modify the syntax so that it skip the whole test case due to either a bug or lacking of testing environment. And thus the name is changed into "SKIP".
No codes to support the new syntax yet, but it's fine, as we still don't support to execute all test cases in a bundle. And the syntax to skip step(s) in test cases should be just destroyed. There will be follow up patches to destroy the codes to skip test steps in test cases, and patches to support to execute all test cases in a bundle and the new skipping syntax. --- BUGSKIP | 4 ---- SKIP | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) delete mode 100644 BUGSKIP create mode 100644 SKIP
diff --git a/BUGSKIP b/BUGSKIP deleted file mode 100644 index 70972d4..0000000 --- a/BUGSKIP +++ /dev/null @@ -1,4 +0,0 @@ -# This is a file for skipping a testcase due to an already bug in bugzilla -# example as follows -# casename:domain:destroy id:12345 bugzilla:http://bugzilla.redhat.com/bugid description:"This is a bug" -# diff --git a/SKIP b/SKIP new file mode 100644 index 0000000..442e8ca --- /dev/null +++ b/SKIP @@ -0,0 +1,26 @@ +# Skip cases due to existed bug, or lacking of testing environment. +# +# The format: +# { +# case: $casename +# bugzilla: $bug_uri +# reason: $why_to_skip +# } +# +# Fields "case" and "reason" is required, "bug" is optional. +# +# Example: +# +# Skip case 'cases/foo.conf' due to a bug +# { +# case: "cases/foo.conf", +# bug: http://bugzilla.redhat.com/show_bug.cgi?id=809783 +# reason: "It's bug!", +# } +# +# Skip case due to lacking of testing environment +# +# { +# case: "cases/bar.conf", +# reason: "Lacks of device" +# }
The idea is theoretical, hard to know the full view without code patch. I support remove BUGSKIP file, but the new file, it has a long way to go before commit and push. Guannan Ren

--- libvirt-test-api | 13 ++++------- src/generator.py | 57 +++++++++-------------------------------------------- 2 files changed, 15 insertions(+), 55 deletions(-) diff --git a/libvirt-test-api b/libvirt-test-api index b7c2468..7343b6b 100644 --- a/libvirt-test-api +++ b/libvirt-test-api @@ -68,11 +68,10 @@ class Main(object): """ The class provides methods to run a new test and manage testing log and records """ - def __init__(self, casefile, logxml, loglevel, bugstxt): + def __init__(self, casefile, logxml, loglevel): self.casefile = casefile self.logxml = logxml self.loglevel = loglevel - self.bugstxt = bugstxt def run(self, activities_options_list=None): """ Run a test instance """ @@ -150,7 +149,6 @@ class Main(object): testid, log_xml_parser, lockfile, - self.bugstxt, self.loglevel) ) @@ -307,7 +305,6 @@ if __name__ == "__main__": casefile = "./case.conf" logxml = "./log.xml" - bugstxt = "./BUGSKIP" loglevel = 0 try: @@ -351,7 +348,7 @@ if __name__ == "__main__": usage() sys.exit(1) - main = Main(casefile, logxml, loglevel, bugstxt) + main = Main(casefile, logxml, loglevel) main.remove_log(testrunid, testid) sys.exit(0) if o == "-m" or o == "--merge": @@ -359,7 +356,7 @@ if __name__ == "__main__": logxml_one = args[0] logxml_two = args[1] - main = Main(casefile, logxml_one, loglevel, bugstxt) + main = Main(casefile, logxml_one, loglevel) main.merge_logxmls(logxml_two) sys.exit(0) else: @@ -375,14 +372,14 @@ if __name__ == "__main__": for testid in args[1:]: testid = int(testid) testid_list.append(testid) - main = Main(casefile, logxml, loglevel, bugstxt) + main = Main(casefile, logxml, loglevel) main.rerun(testrunid, testid_list) sys.exit(0) # Add root path of libvirt-test-API into sys.path append_path() - main = Main(casefile, logxml, loglevel, bugstxt) + main = Main(casefile, logxml, loglevel) if main.run(): sys.exit(1) sys.exit(0) diff --git a/src/generator.py b/src/generator.py index 4d358d7..432e774 100644 --- a/src/generator.py +++ b/src/generator.py @@ -43,13 +43,12 @@ class FuncGen(object): activity, logfile, testrunid, testid, log_xml_parser, lockfile, - bugstxt, loglevel): + loglevel): self.cases_func_ref_dict = cases_func_ref_dict self.logfile = logfile self.testrunid = testrunid self.testid = testid self.lockfile = lockfile - self.bugstxt = bugstxt self.loglevel = loglevel self.testcase_number = 0 @@ -84,31 +83,6 @@ class FuncGen(object): retflag = self.generator() return retflag - def bug_check(self, mod_func_name): - """ Check if there was already a bug in bugzilla assocaited with - specific testcase - """ - exsited_bug = [] - bugstxt = open(self.bugstxt, "r") - linelist = bugstxt.readlines() - - if len(linelist) == 0: - bugstxt.close() - return exsited_bug - - for line in linelist: - if line.startswith('#'): - continue - else: - casename = line.split(' ', 1)[0] - if casename == "casename:" + mod_func_name: - exsited_bug.append(line) - else: - pass - - bugstxt.close() - return exsited_bug - def generator(self): """ Run each test case with the corresponding arguments and add log object into the dictionary of arguments @@ -161,27 +135,16 @@ class FuncGen(object): if case_ref_name != 'sleep': case_params['logger'] = case_logger - existed_bug_list = self.bug_check(pkg_casename) - - if len(existed_bug_list) == 0: - if case_ref_name == 'sleep': - sleepsecs = case_params['sleep'] - case_logger.info("sleep %s seconds" % sleepsecs) - time.sleep(int(sleepsecs)) - ret = 0 - else: - ret = self.cases_func_ref_dict[case_ref_name](case_params) - if cleanoper: - clean_ret = ret - ret = 0 + if case_ref_name == 'sleep': + sleepsecs = case_params['sleep'] + case_logger.info("sleep %s seconds" % sleepsecs) + time.sleep(int(sleepsecs)) + ret = 0 else: - case_logger.info("about the testcase , bug existed:") - for existed_bug in existed_bug_list: - case_logger.info("%s" % existed_bug) - - ret = 100 - self.fmt.print_end(pkg_casename, ret, env_logger) - continue + ret = self.cases_func_ref_dict[case_ref_name](case_params) + if cleanoper: + clean_ret = ret + ret = 0 except Exception, e: case_logger.error(traceback.format_exc()) continue -- 1.7.7.3

On 2012年04月18日 13:49, Osier Yang wrote:
This should be the second round to reorgnize/refactor the codes.
What this round does: * New directory "conf"; Move $root/*.cfg into it * New directory "src"; Move $root/*.{py,css,xls} into it (except the main program libvirt-test-api.py) * Rename libvirt-test-api.py to libvirt-test-api * Move install-autotest-server into "scripts" * Rename BUGSKIP to SKIP, and modify the skipping syntax so that it skips whole test case, but not test step(s). See the explaination in the patch to get why to do it. * Destroy the codes to skip test steps. * Other small fixes.
TODO in next round: * Support run all cases in a bundle * Support to skip test case with the new skipping syntax * A new config property for the scratch directory, (now it always use $(pwd)/$guest_name to download the files, we should have something like '/var/cache/libvirt-test-API' instead). * Other cleaning up.
Osier Yang (10): Create new dir 'conf' and move conf files into it Fix the typo in usage string Remove the suffix .py for libvirt-test-api.py New directory 'src' and move *.{py,css,xls} files into it Fix the typo which mispells 'shutil' as 'shutils' Move install-autotest-server into 'scripts' Update logging stuffs so that it works after source tree reorgnizing Add document to tell the default log output file Rename and modify the syntax of BUGSKIP Destroy the codes to skip case steps.
BUGSKIP | 4 - SKIP | 26 ++++++++ env.cfg => conf/env.cfg | 0 kickstart.cfg => conf/kickstart.cfg | 0 dist/redhat/env_inspect.py | 2 +- libvirt-test-api.py => libvirt-test-api | 50 ++++++++-------- repos/domain/attach_disk.py | 2 +- repos/domain/attach_interface.py | 2 +- repos/domain/autostart.py | 2 +- repos/domain/balloon_memory.py | 2 +- repos/domain/blkstats.py | 2 +- repos/domain/console_io.py | 2 +- repos/domain/console_mutex.py | 2 +- repos/domain/cpu_affinity.py | 2 +- repos/domain/cpu_topology.py | 2 +- repos/domain/create.py | 2 +- repos/domain/define.py | 2 +- repos/domain/destroy.py | 2 +- repos/domain/detach_disk.py | 2 +- repos/domain/detach_interface.py | 2 +- repos/domain/domain_blkinfo.py | 2 +- repos/domain/domain_id.py | 2 +- repos/domain/domblkinfo.py | 2 +- repos/domain/dump.py | 2 +- repos/domain/eventhandler.py | 2 +- repos/domain/ifstats.py | 2 +- repos/domain/install_image.py | 4 +- repos/domain/install_linux_cdrom.py | 10 ++-- repos/domain/install_linux_check.py | 4 +- repos/domain/install_linux_net.py | 12 ++-- repos/domain/install_windows_cdrom.py | 12 ++-- repos/domain/migrate.py | 2 +- repos/domain/ownership_test.py | 2 +- repos/domain/reboot.py | 2 +- repos/domain/restore.py | 2 +- repos/domain/resume.py | 2 +- repos/domain/save.py | 2 +- repos/domain/sched_params.py | 2 +- repos/domain/shutdown.py | 2 +- repos/domain/start.py | 2 +- repos/domain/suspend.py | 2 +- repos/domain/undefine.py | 2 +- repos/domain/update_devflag.py | 2 +- repos/interface/create.py | 2 +- repos/interface/define.py | 2 +- repos/interface/destroy.py | 2 +- repos/interface/undefine.py | 2 +- repos/libvirtd/qemu_hang.py | 2 +- repos/libvirtd/restart.py | 2 +- repos/network/autostart.py | 2 +- repos/network/create.py | 2 +- repos/network/define.py | 2 +- repos/network/destroy.py | 2 +- repos/network/network_list.py | 2 +- repos/network/network_name.py | 2 +- repos/network/network_uuid.py | 2 +- repos/network/start.py | 2 +- repos/network/undefine.py | 2 +- repos/nodedevice/detach.py | 2 +- repos/nodedevice/reattach.py | 2 +- repos/nodedevice/reset.py | 2 +- repos/npiv/create_virtual_hba.py | 2 +- .../multiple_thread_block_on_domain_create.py | 4 +- repos/remoteAccess/tcp_setup.py | 2 +- repos/remoteAccess/tls_setup.py | 8 +- repos/sVirt/domain_nfs_start.py | 2 +- repos/snapshot/delete.py | 2 +- repos/snapshot/file_flag.py | 2 +- repos/snapshot/flag_check.py | 2 +- repos/snapshot/internal_create.py | 2 +- repos/snapshot/revert.py | 2 +- repos/storage/activate_pool.py | 2 +- repos/storage/build_dir_pool.py | 2 +- repos/storage/build_disk_pool.py | 2 +- repos/storage/build_logical_pool.py | 2 +- repos/storage/build_netfs_pool.py | 2 +- repos/storage/create_dir_pool.py | 2 +- repos/storage/create_dir_volume.py | 2 +- repos/storage/create_fs_pool.py | 2 +- repos/storage/create_iscsi_pool.py | 2 +- repos/storage/create_logical_volume.py | 2 +- repos/storage/create_netfs_pool.py | 2 +- repos/storage/create_netfs_volume.py | 2 +- repos/storage/create_partition_volume.py | 2 +- repos/storage/define_dir_pool.py | 2 +- repos/storage/define_disk_pool.py | 2 +- repos/storage/define_iscsi_pool.py | 2 +- repos/storage/define_logical_pool.py | 2 +- repos/storage/define_mpath_pool.py | 2 +- repos/storage/define_netfs_pool.py | 2 +- repos/storage/define_scsi_pool.py | 2 +- repos/storage/delete_dir_volume.py | 2 +- repos/storage/delete_logical_pool.py | 2 +- repos/storage/delete_logical_volume.py | 2 +- repos/storage/delete_netfs_volume.py | 2 +- repos/storage/delete_partition_volume.py | 2 +- repos/storage/destroy_pool.py | 2 +- repos/storage/pool_name.py | 2 +- repos/storage/pool_uuid.py | 2 +- repos/storage/undefine_pool.py | 2 +- .../install-autotest-server | 0 activityfilter.py => src/activityfilter.py | 0 casecfgcheck.py => src/casecfgcheck.py | 2 +- env_clear.py => src/env_clear.py | 2 +- exception.py => src/exception.py | 2 +- generator.py => src/generator.py | 61 ++++---------------- log.css => src/log.css | 0 log.xsl => src/log.xsl | 2 +- logxmlparser.py => src/logxmlparser.py | 4 +- mapper.py => src/mapper.py | 0 parser.py => src/parser.py | 6 +- process.py => src/process.py | 0 proxy.py => src/proxy.py | 2 +- sharedmod.py => src/sharedmod.py | 0 utils/env_parser.py | 2 +- 115 files changed, 188 insertions(+), 205 deletions(-) delete mode 100644 BUGSKIP create mode 100644 SKIP rename env.cfg => conf/env.cfg (100%) rename kickstart.cfg => conf/kickstart.cfg (100%) rename libvirt-test-api.py => libvirt-test-api (91%) rename install-autotest-server => scripts/install-autotest-server (100%) create mode 100644 src/__init__.py rename activityfilter.py => src/activityfilter.py (100%) rename casecfgcheck.py => src/casecfgcheck.py (99%) rename env_clear.py => src/env_clear.py (99%) rename exception.py => src/exception.py (97%) rename generator.py => src/generator.py (78%) rename log.css => src/log.css (100%) rename log.xsl => src/log.xsl (98%) rename logxmlparser.py => src/logxmlparser.py (99%) rename mapper.py => src/mapper.py (100%) rename parser.py => src/parser.py (99%) rename process.py => src/process.py (100%) rename proxy.py => src/proxy.py (99%) rename sharedmod.py => src/sharedmod.py (100%)
Regards, Osier
Pushed without 2/10, with SKIP kept, we will need it anyway in future, and it doesn't hurt us now. Also with the nit of 10/10 fixed. Thanks. Osier
participants (2)
-
Guannan Ren
-
Osier Yang