2 Documentation OF Handshake threads should be closed if the connection has a
3 ... failure. This bug was fixed in the Helium SR3 release but
4 ... persisted in to the Lithium release. Once fixed, this will
5 ... catch any future regressions
6 Metadata https://bugs.opendaylight.org/show_bug.cgi?id=2429 ${EMPTY}
8 Library OperatingSystem
11 Resource ../../../libraries/Utils.robot
12 Resource ../../../variables/Variables.robot
17 ${number_ofconnections_to_fail} 600
18 ${margin_of_error} 0.05 # percentage
23 [Documentation] Using the "nc" tool, a number of connections to the ${openflow_port}
24 ... will be opened and closed to simulate a failed OF handshake. The java threadcount
25 ... will be compared before and after to ensure that there are no thread leaks. Since
26 ... it's reasonable for other valid threads to be started (or stopped) during the test
27 ... a larger number of failed connections will be used and a small margin of error will
28 ... determine if the test is a PASS or FAIL
29 Log Environment Details
30 ${controller_pid}= Get Process ID Based On Regex On Remote System
33 ... ${ODL_SYSTEM_USER}
34 Should Match Regexp ${controller_pid} [0-9]+ PID was not discovered
35 ${starting_thread_count}= Get Process Thread Count On Remote System
38 ... ${ODL_SYSTEM_USER}
39 Repeat Keyword ${number_ofconnections_to_fail} Start Process nc -w 1 ${ODL_SYSTEM_IP}
42 Log Environment Details
43 ${ending_thread_count}= Get Process Thread Count On Remote System
46 ... ${ODL_SYSTEM_USER}
47 Log Environment Details
48 Log starting count: ${starting_thread_count}\nending count: ${ending_thread_count}
49 ${acceptable_thread_count}= Evaluate
50 ... ${starting_thread_count} + (${number_of_connections_to_fail} * ${margin_of_error})
52 ... ${ending_thread_count} <= ${acceptable_thread_count}
53 ... Final thread count of ${ending_thread_count} exceeds acceptable count: ${acceptable_thread_count}
54 [Teardown] Report_Failure_Due_To_Bug 2429
58 Log Environment Details
59 [Documentation] Will display relevant details of the test environement to help aid debugging efforts if
60 ... needed in the future.
61 ${output}= Get Process ID Based On Regex On Remote System
64 ... ${ODL_SYSTEM_USER}
66 ${output}= Run Command On Remote System ${ODL_SYSTEM_IP} netstat -na | grep 6633 ${ODL_SYSTEM_USER}