diff --git a/client/common_lib/test.py b/client/common_lib/test.py
index 02f5dfb..e9ab456 100644--- a/client/common_lib/test.py
+++ b/client/common_lib/test.py
@@ -629,6 +629,7 @@ def runtest(job, url, tag, args, dargs,
local_namespace={}, global_namespace={},
before_test_hook=None, after_test_hook=None,
before_iteration_hook=None, after_iteration_hook=None):
+ print "common.test.runtest"
local_namespace = local_namespace.copy()
global_namespace = global_namespace.copy()
@@ -681,6 +682,7 @@ def runtest(job, url, tag, args, dargs,
local_namespace['outputdir'] = outputdir
sys.path.insert(0, importdir)
+ print "mytest = %s(job, bindir, outputdir)" % classname
try:
exec ('import %s' % modulename, local_namespace, global_namespace)
exec ("mytest = %s(job, bindir, outputdir)" % classname,
@@ -693,6 +695,7 @@ def runtest(job, url, tag, args, dargs,
try:
mytest = global_namespace['mytest']
+ print mytest
if before_test_hook:
before_test_hook(mytest)
@@ -702,7 +705,9 @@ def runtest(job, url, tag, args, dargs,
mytest.register_before_iteration_hook(before_iteration_hook)
if after_iteration_hook:
mytest.register_after_iteration_hook(after_iteration_hook)
+ print "before exec, %s, %s" %(args, dargs)
mytest._exec(args, dargs)
+ print "after exec"
finally:
os.chdir(pwd)
if after_test_hook:
kvm autotest中调用到测试用例的地方
richard@richard:~/git/autotest/client$ git diff tests/kvm/kvm.py
diff --git a/client/tests/kvm/kvm.py b/client/tests/kvm/kvm.py
index 5f9632f..292b48f 100644
--- a/client/tests/kvm/kvm.py
+++ b/client/tests/kvm/kvm.py
@@ -86,10 +86,12 @@ class kvm(test.test):
# Preprocess
try:
- virt_env_process.preprocess(self, params, env)
+ print "Preprocess"
+ virt_env_process.preprocess(self, params, env) # here create a vm if necessary
finally:
env.save()
- # Run the test function
+ # Run the test function, this is the function in test python script
+ # such as run_boot in the boot test case
run_func = getattr(test_module, "run_%s" % t_type)
try:
run_func(self, params, env)