aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorQiu Tingting <qiutt@fujitsu.com>2022-05-22 10:14:19 +0800
committerQiu Tingting <qiutt@fujitsu.com>2022-05-22 10:14:19 +0800
commit400b68ab68fb62a9ae6c7a6e70a2db22a6898e6b (patch)
tree5ee7284d83a566afc6b676032dde084e8cf9e239 /plugins
parent83d72abc853e9af39334b4fc12df98be9375e4f2 (diff)
agl-test-framework: Add get method for agl-test-conf.py
Add get method for agl-test-conf.py get_tmp_log_dir get_tpl_dir get_default_html_tpl get_json_filename get_html_filename get_log_dir Bug-AGL: SPEC-4345 Signed-off-by: Qiu Tingting <qiutt@fujitsu.com> Change-Id: I6f63447a32df752033945ff77ad577dd46f0733a
Diffstat (limited to 'plugins')
-rw-r--r--plugins/agl_test_conf.py52
1 files changed, 47 insertions, 5 deletions
diff --git a/plugins/agl_test_conf.py b/plugins/agl_test_conf.py
index 83f19f5..767d971 100644
--- a/plugins/agl_test_conf.py
+++ b/plugins/agl_test_conf.py
@@ -1,8 +1,14 @@
+#The base dir of agl-test
+BASE_DIR = "/usr/AGL/agl-test/"
+
+#The base dir of tmp files
+BASE_TMP = "/var/run/agl-test/"
+
#The dir of test_suits
-WORK_DIR = "/usr/AGL/agl-test/tests/"
+WORK_DIR = BASE_DIR + "tests/"
#The dir for saving log
-BASE_LOGS_DIR = "/var/run/agl-test/logs/"
+BASE_LOGS_DIR = BASE_TMP + "logs/"
#The dir for tmp log
TMP_LOGS_DIR = BASE_LOGS_DIR + "tmp-log/"
@@ -13,7 +19,43 @@ REPORT_LOGS_DIR = BASE_LOGS_DIR + "log-to-report/"
#The dir for tmp test report
TMP_TEST_REPORT = TMP_LOGS_DIR + "test-report/"
-#Get the log file
-def get_log_file(THIS_TEST):
- log_file = TMP_LOGS_DIR + THIS_TEST + "/log/" + THIS_TEST + ".log"
+# The dir for template files
+TPL_DIR = BASE_DIR + "template/"
+
+#Defalut template file name for html result
+HTML_TPL = "summary_result_tpl.html"
+
+#Get the log file for a test set :
+# /var/run/agl-test/logs/tmp-log/${test_set_name}/log/${test_set_name}.log
+def get_log_file(test_set_name):
+ log_file = get_tmp_log_dir(test_set_name) + test_set_name + ".log"
return log_file
+
+#Get the log dir for a test set :
+# /var/run/agl-test/logs/tmp-log/${test_set_name}/log/
+def get_tmp_log_dir(test_set_name):
+ log_dir = TMP_LOGS_DIR + test_set_name + "/log/"
+ return log_dir
+
+#Get template dir : /usr/AGL/agl-test/template
+def get_tpl_dir():
+ return TPL_DIR
+
+#Get template file name for html result
+def get_default_html_tpl():
+ return HTML_TPL
+
+#Get json file name :
+# /var/run/agl-test/logs/tmp-log/${test_set_name}/report.json
+def get_json_filename(test_set_name: str):
+ return TMP_LOGS_DIR + test_set_name + "/report.json"
+
+#Get html file name for a test set :
+# /var/run/agl-test/logs/tmp-log/test-report/${test_set_name}/report.html
+def get_html_filename(test_set_name: str):
+ return TMP_TEST_REPORT + "/" + testname + "/report.html"
+
+#Get test-report log dir for a test set :
+# /var/run/agl-test/logs/tmp-log/test-report/${test_set_name}/log
+def get_log_dir(test_set_name: str):
+ return TMP_TEST_REPORT + "/" + test_set_name + "/log"