Fixed Bug 2429 Verification CI
[integration/test.git] / test / csit / suites / openflowplugin / Bug_Validation / 2429.robot
index 38cef9e899d2ba0633dd57ac90218269d4607231..ee888d1ad3dafd7dd3120ae1e4e91f74d5fac846 100644 (file)
@@ -6,12 +6,13 @@ Documentation     OF Handshake threads should be closed if the connection has a
 Metadata:         https://bugs.opendaylight.org/show_bug.cgi?id=2429
 Library           OperatingSystem
 Library           SSHLibrary
+Library           Process
 Resource          ../../../libraries/Utils.txt
 Variables         ../../../variables/Variables.py
 
 *** Variables ***
 ${openflow_port}                   6633
-${number_ofconnections_to_fail}    1000
+${number_ofconnections_to_fail}    600
 ${margin_of_error}                 0.05   # percentage
 
 *** Test Cases ***
@@ -22,11 +23,23 @@ Bug_2429
     ...    it's reasonable for other valid threads to be started (or stopped) during the test
     ...    a larger number of failed connections will be used and a small margin of error will
     ...    determine if the test is a PASS or FAIL
+    Log Environment Details
     ${controller_pid}=    Get Process ID Based On Regex On Remote System    ${CONTROLLER}    java.*distribution.*karaf
     Should Match Regexp    ${controller_pid}    [0-9]+    PID was not discovered
     ${starting_thread_count}=    Get Process Thread Count On Remote System    ${CONTROLLER}    ${controller_pid}
-    Repeat Keyword    ${number_ofconnections_to_fail}    Run    nc -w 1 ${CONTROLLER} ${openflow_port} &
+    Repeat Keyword    ${number_ofconnections_to_fail}    Start Process    nc    -w    1    ${CONTROLLER}    ${openflow_port}
+    Log Environment Details
     ${ending_thread_count}=    Get Process Thread Count On Remote System    ${CONTROLLER}    ${controller_pid}
+    Log Environment Details
     Log    starting count: ${starting_thread_count}\nending count: ${ending_thread_count}
     ${acceptable_thread_count}=    Evaluate    ${starting_thread_count} + (${number_of_connections_to_fail} * ${margin_of_error})
-    Should Be True    ${ending_thread_count} <= ${acceptable_thread_count}    Final thread count of ${ending_thread_count} exceeds acceptable count: ${acceptable_thread_count}
\ No newline at end of file
+    Should Be True    ${ending_thread_count} <= ${acceptable_thread_count}    Final thread count of ${ending_thread_count} exceeds acceptable count: ${acceptable_thread_count}
+
+*** Keywords ****
+Log Environment Details
+    [Documentation]    Will display relevant details of the test environement to help aid debugging efforts if
+    ...    needed in the future.
+    ${output}=    Get Process ID Based On Regex On Remote System    ${CONTROLLER}    java.*distribution.*karaf
+    Log    ${output}
+    ${output}=    Run Command On Remote System    ${CONTROLLER}    netstat -na | grep 6633
+    Log    ${output}
\ No newline at end of file