summaryrefslogtreecommitdiffstats
path: root/tests/zlib/run_tests.py
diff options
context:
space:
mode:
authoryanxk <yanxk.fnst@fujitsu.com>2022-08-12 14:50:24 +0800
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2022-11-10 12:04:16 +0000
commit66985604887e5185b01085847882a725ef719e7a (patch)
treeaa524a6ac4e083edb360721491a6c0dc8754d903 /tests/zlib/run_tests.py
parentde1da3ebece49cdcc4accc27ea0b82d042c86db1 (diff)
agl-test-framework: deploy parametric implementation for old ‘zlib’ test
Single definitions are no longer used in this test framework, they are now replaced by another parametric implementation. The benefit of this is that it minimizes the likelihood of requiring manual maintenance due to the small but frequent updates from the upstream. Bug-AGL: SPEC-4345 Signed-off-by: yanxk <yanxk.fnst@fujitsu.com> Change-Id: I18ee28b6ebce12c61a55e87fef9f1b96f6db958c
Diffstat (limited to 'tests/zlib/run_tests.py')
-rw-r--r--tests/zlib/run_tests.py30
1 files changed, 6 insertions, 24 deletions
diff --git a/tests/zlib/run_tests.py b/tests/zlib/run_tests.py
index bf62390..e9094c2 100644
--- a/tests/zlib/run_tests.py
+++ b/tests/zlib/run_tests.py
@@ -1,9 +1,5 @@
import pytest
-
-import os
-
import tests.zlib.parser as parser
-
from plugins.agl_test_ptest_base import PTESTBase
class ZLIBBase(PTESTBase):
@@ -15,32 +11,18 @@ class ZLIBBase(PTESTBase):
self.case_info_list = parser.log_parse(log_file)
self.init_case_status()
+instance = ZLIBBase()
+instance.run_ptest()
+
@pytest.fixture(scope='module')
def testbase():
- #init instance for test
- instance = ZLIBBase()
- #run test scripts
- #the "test_name" should be the name of test set in ptest
- instance.run_test_fun()
- #parser log
- instance.log_process()
yield instance
#package log files and make report file
instance.log_report()
-def precheck():
- instance = ZLIBBase()
- return instance.precheck()
-skip_msg = "The current environment does not match the test requirements."
-pytestmark = pytest.mark.skipif(precheck() == False, reason = skip_msg)
-
-def setup_module(testbase: ZLIBBase):
- print("setup function start")
-
-
-def test_zlib(testbase: ZLIBBase):
- name = "zlib"
- testbase.run_case(name)
+@pytest.mark.parametrize('case_name', instance.case_info_list.keys())
+def test_zlib(testbase: ZLIBBase, case_name):
+ testbase.run_case(case_name)
if __name__ == '__main__':
pytest.main("-s run_tests")