aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/agl_test_ptest_base.py30
-rw-r--r--plugins/agl_test_report.py2
2 files changed, 30 insertions, 2 deletions
diff --git a/plugins/agl_test_ptest_base.py b/plugins/agl_test_ptest_base.py
new file mode 100644
index 0000000..f7b5829
--- /dev/null
+++ b/plugins/agl_test_ptest_base.py
@@ -0,0 +1,30 @@
+import subprocess
+
+from plugins.agl_test_base import AGLBaseTest
+
+class PTESTBase(AGLBaseTest):
+
+ def __init__(self, test_name: str):
+ super().__init__(name=test_name)
+
+ #Run test by ptest-runner
+ def run_test_fun(self):
+ log_file = self.get_logfile()
+ with open(log_file,'w') as log_f:
+ subprocess.run(['ptest-runner', super().get_name()],
+ stdout=log_f, stderr=log_f)
+ log_f.close()
+
+ def run_case(self, case_id):
+ case_info = self.get_caseinfo_by_name(case_id)
+ if (case_info[1] == "PASS"):
+ case_info[2] = "passed"
+ elif (case_info[1] == "FAIL"):
+ case_info[2] = "failed"
+ elif (case_info[1] == "SKIP"):
+ case_info[2] = "skipped"
+ else:
+ case_info[2] = "failed"
+
+ self.update_caseinfo_by_name(case_id, case_info)
+ assert case_info[2] == "passed" or case_info[2] == "skipped"
diff --git a/plugins/agl_test_report.py b/plugins/agl_test_report.py
index 8c7a514..f9d9fc3 100644
--- a/plugins/agl_test_report.py
+++ b/plugins/agl_test_report.py
@@ -177,7 +177,6 @@ def create_gen_web_page(filename, tlpname, html_data):
f.close()
def write_data_to_file(data, file_type = "json"):
- print(data)
testname = data["test_name"]
if (file_type == "json"):
filename = conf.get_json_filename(testname)
@@ -229,6 +228,5 @@ def format_case_status_table(case_status):
html_data += "\t\t<th>" + key + "</th>\n"
html_data += "\t\t<th>" + case_status[key] + "</th>\n"
html_data += "\t</tr>\n"
- print(html_data)
return html_data