diff options
author | Qiu Tingting <qiutt@fujitsu.com> | 2023-04-17 10:01:07 +0800 |
---|---|---|
committer | Qiu Tingting <qiutt@fujitsu.com> | 2023-04-21 00:39:23 +0000 |
commit | 8f83b67b8ac0a60ff4e3a5a5888474b3033f9b3a (patch) | |
tree | 1081c6f54ce67a1932290ec75968723e72aa8b86 /tests/busybox | |
parent | 9b9fd4724424c9758cdb5f66b66ae61da177a8a6 (diff) |
agl-test-framework: Optimize common function log_process
Add new commone function log_process_gnu for the following tests:
acl
attr
bash
bc
bluez5
busybox
cpio
libpam
libxml2
zlib
SPEC-4758
Signed-off-by: Qiu Tingting <qiutt@fujitsu.com>
Change-Id: I92de3b781badac9cb6d55acd5cc0c601dc4a7c65
Diffstat (limited to 'tests/busybox')
-rw-r--r-- | tests/busybox/parser.py | 20 | ||||
-rw-r--r-- | tests/busybox/run_tests.py | 4 |
2 files changed, 2 insertions, 22 deletions
diff --git a/tests/busybox/parser.py b/tests/busybox/parser.py deleted file mode 100644 index e21814f..0000000 --- a/tests/busybox/parser.py +++ /dev/null @@ -1,20 +0,0 @@ -import re - -def log_parse(log_file): - reObj = re.compile('^(PASS|FAIL|SKIP): (.+)', re.MULTILINE) - case_list = dict() - test_log = open(log_file, 'r') - - line = test_log.readline() - while line: - matchs = reObj.search(line) - - if matchs: - groups = list(matchs.groups()) - case_list[groups[1]] = [groups[1], groups[0], ""] - - line = test_log.readline() - - test_log.close() - - return case_list diff --git a/tests/busybox/run_tests.py b/tests/busybox/run_tests.py index c6f3b8d..31c5c5b 100644 --- a/tests/busybox/run_tests.py +++ b/tests/busybox/run_tests.py @@ -1,7 +1,7 @@ import pytest import pathlib import subprocess -import tests.busybox.parser as parser +import plugins.agl_test_log as log from plugins.agl_test_ptest_base import PTESTBase class BusyboxBase(PTESTBase): @@ -10,7 +10,7 @@ class BusyboxBase(PTESTBase): def log_process(self): log_file = self.get_logfile() - self.case_info_list = parser.log_parse(log_file) + self.case_info_list = log.log_process_gnu(log_file) def precheck(self): path_bash = pathlib.Path("/usr/bin/busybox") |