Merge "Initial keyword to check if controller is Dead"
authorLuis Gomez <ecelgp@gmail.com>
Fri, 17 Apr 2015 16:55:30 +0000 (16:55 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 17 Apr 2015 16:55:30 +0000 (16:55 +0000)
test/csit/libraries/KarafKeywords.txt
test/csit/libraries/Utils.txt
test/csit/suites/openflowplugin/Switch_Qualification/020_OpenFlow_Actions.txt

index 178f0d9a4dd66b6baf325374977a34b34f2215a0..c991d2772861323f27a4468dfcff4f4055f5fc63 100644 (file)
@@ -9,6 +9,11 @@ ${karaf_user}           karaf
 ${karaf_password}       karaf
 
 *** Keywords ***
+Check Karaf Log File Does Not Have Messages
+    [Arguments]     ${ip}   ${message}  ${log_file}=${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log
+    ${output}=  Run Command On Remote System    ${ip}   grep ${message} ${log_file}
+    Should Not Contain  ${output}   ${message}
+
 Verify Feature Is Installed
     [Documentation]     Will Succeed if the given ${feature_name} is found in the output of "feature:list -i"
     [Arguments]     ${feature_name}     ${controller}=${CONTROLLER}     ${karaf_port}=${karaf_shell_port}
index 7f23eded7287b83615d8c7e84ceab70d4b0ced25..963c7ce66ed64efd8d8d59a236606f067e68038b 100644 (file)
@@ -1,6 +1,7 @@
 *** Settings ***
 Library           SSHLibrary
 Library           ./UtilLibrary.py
+Resource          KarafKeywords.txt
 
 *** Variables ***
 ${start}          sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,1 --switch ovsk,protocols=OpenFlow13
@@ -108,7 +109,7 @@ Strip Quotes
 Run Command On Remote System
     [Arguments]     ${remote_system}    ${cmd}  ${user}=${MININET_USER}    ${prompt}=${LINUX_PROMPT}   ${prompt_timeout}=30s
     [Documentation]     Reduces the common work of running a command on a remote system to a single higher level robot keyword,
-    ...     taking care to log in with a public key and.  The command given is written and the output returned.  No test conditions
+    ...     taking care to log in with a public key and. The command given is written and the output returned.  No test conditions
     ...     are checked.
     Log    Attempting to execute ${cmd} on ${remote_system}
     ${conn_id}=     Open Connection    ${remote_system}    prompt=${prompt}    timeout=${prompt_timeout}
@@ -126,3 +127,8 @@ Verify File Exists On Remote System
     SSHLibrary.File Should Exist   ${file}
     Close Connection
 
+Verify Controller Is Not Dead
+    [Arguments]     ${controller_ip}=${CONTROLLER}
+    [Documentation]     Will execute any tests to verify the controller is not dead. Some checks are
+    ...     Out Of Memory Execptions.
+    Check Karaf Log File Does Not Have Messages     ${controller_ip}  java.lang.OutOfMemoryError
\ No newline at end of file
index f8396b7a478b38d11377897dc310b32ae7412926..b89ff2747038c4b71418c143f83b3b902de60c1b 100644 (file)
@@ -17,6 +17,7 @@ Library           Collections
 Library           OperatingSystem
 Library           String
 Library           XML
+Resource          ../../../libraries/Utils.txt
 Resource          ../../../libraries/FlowLib.txt
 Resource          ../../../libraries/SwitchUtils.txt
 Library           ../../../libraries/RequestsLibrary.py
@@ -106,6 +107,7 @@ OpenFlow Actions Suite Setup
     Set Suite Variable    ${test_switch}
     Call Method    ${test_switch}    set_mgmt_ip    ${SWITCH_IP}
     Call Method    ${test_switch}    set_controller_ip    ${CONTROLLER}
+    Run Command On Remote System    ${CONTROLLER}   ps -elf | grep java
     Log    MAKE: ${test_switch.make}\n MODEL: ${test_switch.model}\n IP: ${test_switch.mgmt_ip}\n PROMPT: ${test_switch.mgmt_prompt}\n CONTROLLER_IP: ${test_switch.of_controller_ip}\n MGMT_PROTOCOL: ${test_switch.mgmt_protocol}
     Ping    ${test_switch.mgmt_ip}
     Initialize Switch    ${test_switch}