cleaning up system variables
[integration/test.git] / csit / suites / openflowplugin / Bug_Validation / 2429.robot
index 361798a7de76582e64f57909eb0d94c504b415db..390f9550a1a264fba8ac9c21b6b69c1d0d334752 100644 (file)
@@ -24,23 +24,25 @@ Bug_2429
     ...    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    ${CONTROLLER_USER}
+    ${controller_pid}=    Get Process ID Based On Regex On Remote System    ${ODL_SYSTEM_IP}    java.*distribution.*karaf    ${ODL_SYSTEM_USER}
     Should Match Regexp    ${controller_pid}    [0-9]+    PID was not discovered
-    ${starting_thread_count}=    Get Process Thread Count On Remote System    ${CONTROLLER}    ${controller_pid}    ${CONTROLLER_USER}
-    Repeat Keyword    ${number_ofconnections_to_fail}    Start Process    nc    -w    1    ${CONTROLLER}
+    ${starting_thread_count}=    Get Process Thread Count On Remote System    ${ODL_SYSTEM_IP}    ${controller_pid}    ${ODL_SYSTEM_USER}
+    Repeat Keyword    ${number_ofconnections_to_fail}    Start Process    nc    -w    1    ${ODL_SYSTEM_IP}
     ...    ${openflow_port}
+    Run    pkill -f 'nc -w'
     Log Environment Details
-    ${ending_thread_count}=    Get Process Thread Count On Remote System    ${CONTROLLER}    ${controller_pid}    ${CONTROLLER_USER}
+    ${ending_thread_count}=    Get Process Thread Count On Remote System    ${ODL_SYSTEM_IP}    ${controller_pid}    ${ODL_SYSTEM_USER}
     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}
+    [Teardown]    Report_Failure_Due_To_Bug    2429
 
 *** 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    ${CONTROLLER_USER}
+    ${output}=    Get Process ID Based On Regex On Remote System    ${ODL_SYSTEM_IP}    java.*distribution.*karaf    ${ODL_SYSTEM_USER}
     Log    ${output}
-    ${output}=    Run Command On Remote System    ${CONTROLLER}    netstat -na | grep 6633    ${CONTROLLER_USER}
+    ${output}=    Run Command On Remote System    ${ODL_SYSTEM_IP}    netstat -na | grep 6633    ${ODL_SYSTEM_USER}
     Log    ${output}