diff options
author | grabinsk <maciej.grabinski@nokia.com> | 2019-06-10 11:35:48 +0200 |
---|---|---|
committer | grabinsk <maciej.grabinski@nokia.com> | 2019-06-10 16:03:35 +0200 |
commit | 2d51f2b775dc4800d41faaf3faff36b9ace11894 (patch) | |
tree | 0e5ce6cfe421ce31eddfb63483dc7154282811d6 /tests/dcaegen2/prh-testcases/resources | |
parent | e94b274e3060cd3e2b46901a168738b8cfd3972f (diff) |
Update expected log entries in PRH in case AAI has missing entry or is not reponding
Change-Id: I43bbd055002e0c399a2c837bb0df738e01c06b63
Issue-ID: DCAEGEN2-1601
Signed-off-by: grabinsk <maciej.grabinski@nokia.com>
Diffstat (limited to 'tests/dcaegen2/prh-testcases/resources')
-rw-r--r-- | tests/dcaegen2/prh-testcases/resources/PrhLibrary.py | 11 | ||||
-rw-r--r-- | tests/dcaegen2/prh-testcases/resources/prh_library.robot | 11 |
2 files changed, 11 insertions, 11 deletions
diff --git a/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py b/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py index 7453eb0f..b9942611 100644 --- a/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py +++ b/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py @@ -10,15 +10,16 @@ class PrhLibrary(object): pass @staticmethod - def find_log_entry(search_for): - print(type(search_for)) + def find_one_of_log_entryies(searched_entries): + print(type(searched_entries)) client = docker.from_env() container = client.containers.get('prh') - print("Check for log searches for pattern: ", search_for ) + print("Check for log searches for pattern: ", searched_entries) for line in container.logs(stream=True): print("Check for log analysis line: ", line ) - if search_for in line.strip(): - return True + for searched_entry in searched_entries: + if searched_entry in line.strip(): + return True else: return False diff --git a/tests/dcaegen2/prh-testcases/resources/prh_library.robot b/tests/dcaegen2/prh-testcases/resources/prh_library.robot index 6302ef76..482a6ee5 100644 --- a/tests/dcaegen2/prh-testcases/resources/prh_library.robot +++ b/tests/dcaegen2/prh-testcases/resources/prh_library.robot @@ -34,7 +34,7 @@ Verify incorrect JSON event is logged [Arguments] ${test_case_directory} ${invalid_ves_event}= Get Data From File ${test_case_directory}/invalid-ves-event.json Set VES event in DMaaP ${invalid_ves_event} - Wait Until Keyword Succeeds 10x 3000ms Check PRH log |com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonArray + Check PRH log |com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonArray Verify missing AAI record is logged [Timeout] 100s @@ -43,8 +43,7 @@ Verify missing AAI record is logged ${ves_event}= Get Data From File ${test_case_directory}/ves-event.json Add PNF entry in AAI ${incorrect_aai_entry} Set VES event in DMaaP ${ves_event} - Wait Until Keyword Succeeds 10x 3000ms Check PRH log |AAIProducerTask exception has been registered - Wait Until Keyword Succeeds 10x 3000ms Check PRH log |Chain of tasks have been aborted due to errors in PRH workflow + Check PRH log Request failed for URL 'https://aai:3334/aai/v12/network/pnfs/pnf/NOK6061ZW8'. Response code: 404 Not Found Verify AAI not responding is logged [Timeout] 100s @@ -52,7 +51,7 @@ Verify AAI not responding is logged ${ves_event}= Get Data From File ${test_case_directory}/ves-event.json Ensure Container Is Exited aai_simulator Set VES event in DMaaP ${ves_event} - Wait Until Keyword Succeeds 10x 3000ms Check PRH log java.net.UnknownHostException: aai + Check PRH log connection timed out: aai Host is unreachable: aai Ensure Container Is Running aai_simulator Check CBS ready @@ -74,8 +73,8 @@ Check recorded Logical Link Should Be Equal As JSON ${resp.content} ${expected_logical_link_in_aai} Check PRH log - [Arguments] ${log_entry} - ${found}= Find log entry ${log_entry} + [Arguments] @{log_entries} + ${found}= Find one of log entryies ${log_entries} Should Be True ${found} Check PRH json log |