[libvirt] [test-API PATCH 4/5] libvirt-test-api: get reference to check function in testcases

Guannan Ren gren at redhat.com
Mon Apr 16 06:30:54 UTC 2012


    *proxy_obj.get_optionalfunc_call_dict('check') to get references
     to 'check' function that defined in testcases, and pass them to
     generator for running later
---
 libvirt-test-api.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/libvirt-test-api.py b/libvirt-test-api.py
index 7b38aaa..c53a3b6 100644
--- a/libvirt-test-api.py
+++ b/libvirt-test-api.py
@@ -125,6 +125,9 @@ class Main(object):
         unique_testcase_keys = filterobj.unique_testcase_cleansuffix()
         cases_func_ref_dict = proxy_obj.get_func_call_dict(unique_testcase_keys)
 
+        # get check function reference if that is defined in testcase file
+        cases_checkfunc_ref_dict = proxy_obj.get_optionalfunc_call_dict('check')
+
         # create a null list, then, initilize generator to
         # get the callable testcase function
         # and put it into procs list for running.
@@ -142,6 +145,7 @@ class Main(object):
             else:
                 logfile = os.path.join('log/%s' % testrunid, logname)
             procs.append(generator.FuncGen(cases_func_ref_dict,
+                                           cases_checkfunc_ref_dict,
                                            activity,
                                            logfile,
                                            testrunid,
@@ -199,7 +203,7 @@ class Main(object):
         if options_list[0]['options'].has_key("cleanup"):
             if options_list[0]['options']["cleanup"] == "enable":
                 print "Clean up Testing Environment..."
-                cases_clearfunc_ref_dict = proxy_obj.get_clearfunc_call_dict()
+                cases_clearfunc_ref_dict = proxy_obj.get_optionalfunc_call_dict('clean')
                 log.Log.counter = 0
                 for activity in activities_list:
                     logname = log.Log.get_log_name()
-- 
1.7.7.5




More information about the libvir-list mailing list