diff options
Diffstat (limited to 'csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py')
-rw-r--r-- | csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py b/csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py index 01718e3..cc4bf22 100644 --- a/csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py +++ b/csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py @@ -1,3 +1,22 @@ +# ============LICENSE_START======================================================= +# org.onap.dcae +# ================================================================================ +# Copyright (c) 2021-2022 Nokia. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# + import re class LogReader: @@ -14,8 +33,8 @@ class LogReader: 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_number_of_element_occurrences_in_logs(self, logs_output, element): + return len(list(filter(lambda line: element in line, logs_output))) def get_log_files_list(self, fileNames): files = fileNames.split() |