diff options
author | Lasse Kaihlavirta <l.kaihlavirt@partner.samsung.com> | 2021-05-21 12:59:08 +0300 |
---|---|---|
committer | Lasse Kaihlavirta <l.kaihlavirt@partner.samsung.com> | 2021-05-26 10:44:59 +0300 |
commit | a3f68d14609fc94ec89e3eb724664a62bc2b0210 (patch) | |
tree | bf87b82d01deb38c8fa7185e6a7e3ce6c61e0970 /csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py | |
parent | afc8cd1428714915ac67c07a3c7b23a9cefc5074 (diff) |
Move PM-Mapper CSIT to project repo
Issue-ID: DCAEGEN2-2746
Signed-off-by: Lasse Kaihlavirta <l.kaihlavirt@partner.samsung.com>
Change-Id: Ib96f8453fd7fecbaddaada1b11d3b8551bb7f8fa
Diffstat (limited to 'csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py')
-rw-r--r-- | csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py b/csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py new file mode 100644 index 0000000..01718e3 --- /dev/null +++ b/csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py @@ -0,0 +1,22 @@ +import re + +class LogReader: + + def filter_unique(self, merged_logs_output, testname): + logs = merged_logs_output.splitlines() + del_logs = list(filter(lambda line: "|DEL|" in line, logs)) + nrs_set = set() + ret_logs = set() + for log in del_logs: + filename = re.findall(testname + "\d", log) + if len(filename) > 0 and filename[0] not in nrs_set: + ret_logs.add(log) + nrs_set.add(filename[0]) + return ret_logs + + def get_number_of_dropped_messages(self, logs_output): + return len(list(filter(lambda line: "|429|" in line, logs_output))) + + def get_log_files_list(self, fileNames): + files = fileNames.split() + return files |