aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/agl_test_base.py2
-rw-r--r--plugins/agl_test_ptest_base.py18
2 files changed, 19 insertions, 1 deletions
diff --git a/plugins/agl_test_base.py b/plugins/agl_test_base.py
index 1a2c602..0e3a153 100644
--- a/plugins/agl_test_base.py
+++ b/plugins/agl_test_base.py
@@ -107,3 +107,5 @@ class AGLBaseTest:
#Write json data to html
report.change_json_to_html(self.name)
+ def precheck(self):
+ return True;
diff --git a/plugins/agl_test_ptest_base.py b/plugins/agl_test_ptest_base.py
index f7b5829..2bbe6e0 100644
--- a/plugins/agl_test_ptest_base.py
+++ b/plugins/agl_test_ptest_base.py
@@ -1,7 +1,9 @@
import subprocess
-
+import pathlib
from plugins.agl_test_base import AGLBaseTest
+PTEST_CMD = "/usr/bin/ptest-runner"
+
class PTESTBase(AGLBaseTest):
def __init__(self, test_name: str):
@@ -28,3 +30,17 @@ class PTESTBase(AGLBaseTest):
self.update_caseinfo_by_name(case_id, case_info)
assert case_info[2] == "passed" or case_info[2] == "skipped"
+
+ def precheck(self):
+ # check for common
+ check_common = super().precheck()
+
+ # check for ptest-runner
+ path = pathlib.Path(PTEST_CMD)
+ check_ptest_cmd = path.is_file()
+
+ # check self test scripts
+ test_script = pathlib.Path("/usr/lib/" + super().get_name() + "/ptest/run-ptest")
+ check_test_script = test_script.is_file()
+
+ return check_common and check_ptest_cmd and check_test_script