Check_Karaf_Log_Message_Count API added 14/70714/4
authoreafatha <a.fathima.thasneem@ericsson.com>
Tue, 10 Apr 2018 20:28:50 +0000 (01:58 +0530)
committerJamo Luhrsen <jluhrsen@redhat.com>
Wed, 11 Apr 2018 17:31:04 +0000 (17:31 +0000)
Change-Id: If0d9e685e3363b26bb4ebe3b69d546bd1eae23cf
Signed-off-by: eafatha <a.fathima.thasneem@ericsson.com>
csit/libraries/KarafKeywords.robot

index 2c8df1d6f71fb089020742b3097d9075182058eb..31a60c7df6172291701f8bb5fce7328e597651ac 100644 (file)
@@ -79,6 +79,15 @@ Check_Karaf_Log_Has_Messages
     \    BuiltIn.Should_Contain    ${output}    ${message}
     [Return]    ${output}
 
+Check_Karaf_Log_Message_Count
+    [Arguments]    ${message}    ${count}
+    [Documentation]    Verifies that the ${message} exists in the karaf.log, and checks
+    ...    that it appears ${count} number of times.
+    ${output} =    Issue_Command_On_Karaf_Console    log:display | grep ${message} | wc -l
+    ${line} =    String.Get Line    ${output}    0
+    ${stripped} =    String.Strip String    ${line}
+    Should Be Equal As Strings    ${stripped}    ${count}
+
 Install_A_Feature
     [Arguments]    ${feature_name}    ${controller}=${ODL_SYSTEM_IP}    ${karaf_port}=${KARAF_SHELL_PORT}    ${timeout}=180
     [Documentation]    Will Install the given ${feature_name}