2 Documentation netconf-connector scaling test suite to find max connected devices
4 ... Copyright (c) 2019 Lumina Networks, Inc. and others. All rights reserved.
6 ... This program and the accompanying materials are made available under the
7 ... terms of the Eclipse Public License v1.0 which accompanies this distribution,
8 ... and is available at http://www.eclipse.org/legal/epl-v10.html
11 ... Increasing numbers of netconf devices will be connected and cleaned up
12 ... while validating and profiling between each iteration.
13 Suite Setup Setup_Everything
14 Suite Teardown Teardown_Everything
15 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
18 Library SSHLibrary timeout=10s
19 Resource ../../../libraries/CheckJVMResource.robot
20 Resource ../../../libraries/KarafKeywords.robot
21 Resource ../../../libraries/NetconfKeywords.robot
22 Resource ../../../libraries/SetupUtils.robot
23 Resource ../../../libraries/SSHKeywords.robot
24 Resource ../../../variables/Variables.robot
27 ${INIT_DEVICE_COUNT} 250
28 ${MAX_DEVICE_COUNT} 5000
29 ${DEVICE_INCREMENT} 250
30 ${DEVICE_NAME_BASE} netconf-scaling-device
31 ${DEVICE_TYPE} full-uri-device
35 ${DEVICES_RESULT_FILE} devices.csv
38 Find Max Netconf Devices
39 [Documentation] Find max number of switches starting from ${MIN_SWITCHES} till reaching ${MAX_SWITCHES} in steps of ${STEP_SWITCHES}
40 ${error_message} = BuiltIn.Set Variable Failure initializing suite
41 ${maximum_devices} = BuiltIn.Set Variable ${0}
42 ${discover_time} = BuiltIn.Set Variable 0
43 ${start} = BuiltIn.Convert to Integer ${INIT_DEVICE_COUNT}
44 ${stop} = BuiltIn.Convert to Integer ${MAX_DEVICE_COUNT}
45 ${increment} = BuiltIn.Convert to Integer ${DEVICE_INCREMENT}
46 CheckJVMResource.Get JVM Memory
47 : FOR ${devices} IN RANGE ${start} ${stop+1} ${increment}
48 \ ${timeout} = BuiltIn.Evaluate ${devices}*${TIMEOUT_FACTOR}
49 \ Log To Console Starting Iteration with ${devices} devices
50 \ NetconfKeywords.Install_And_Start_Testtool device-count=${devices}
51 \ ${status} ${result} = Run Keyword And Ignore Error NetconfKeywords.Perform_Operation_On_Each_Device Configure_Device timeout=${timeout}
52 \ Exit For Loop If '${status}' == 'FAIL'
53 \ ${status} ${result} = Run Keyword And Ignore Error NetconfKeywords.Perform_Operation_On_Each_Device Wait_Connected timeout=${timeout}
54 \ Exit For Loop If '${status}' == 'FAIL'
55 \ ${status} ${result} = Run Keyword And Ignore Error Issue_Requests_On_Devices ${TOOLS_SYSTEM_IP} ${devices}
57 \ Exit For Loop If '${status}' == 'FAIL'
58 \ ${status} ${result} = Run Keyword And Ignore Error NetconfKeywords.Perform_Operation_On_Each_Device Wait_Connected timeout=${timeout}
59 \ Exit For Loop If '${status}' == 'FAIL'
60 \ ${status} ${result} = Run Keyword And Ignore Error NetconfKeywords.Perform_Operation_On_Each_Device Deconfigure_Device timeout=${timeout}
61 \ Exit For Loop If '${status}' == 'FAIL'
62 \ ${status} ${result} = Run Keyword And Ignore Error NetconfKeywords.Perform_Operation_On_Each_Device Check_Device_Deconfigured timeout=${timeout}
63 \ Exit For Loop If '${status}' == 'FAIL'
64 \ ${maximum_devices} = Set Variable ${devices}
65 \ CheckJVMResource.Get JVM Memory
66 \ NetconfKeywords.Stop_Testtool
67 [Teardown] Run Keywords NetconfKeywords.Stop_Testtool
68 ... AND Collect_Data_Points ${maximum_devices}
69 ... AND CheckJVMResource.Get JVM Memory
73 [Arguments] ${devices}
74 [Documentation] Parse and Log relevant information when Scale test finishes
75 OperatingSystem.Append To File ${DEVICES_RESULT_FILE} Max Devices\n
76 OperatingSystem.Append To File ${DEVICES_RESULT_FILE} ${devices}\n
78 Issue_Requests_On_Devices
79 [Arguments] ${client_ip} ${expected_count} ${worker_count}
80 [Documentation] Spawn the specified count of worker threads to issue a GET request to each of the devices.
81 ${current_ssh_connection}= SSHLibrary.Get Connection
82 SSHLibrary.Open_Connection ${client_ip}
83 SSHKeywords.Flexible_Mininet_Login
84 SSHLibrary.Write python getter.py --odladdress=${ODL_SYSTEM_IP} --count=${expected_count} --name=${device_name_base} --workers=${worker_count}
85 : FOR ${number} IN RANGE 1 ${expected_count}+1
86 \ Read_Python_Tool_Operation_Result ${number}
87 SSHLibrary.Read_Until_Prompt
88 SSHLibrary.Close_Connection
89 SSHKeywords.Restore Current SSH Connection From Index ${current_ssh_connection.index}
92 [Documentation] Setup everything needed for the test cases.
93 # Setup resources used by the suite.
94 RequestsLibrary.Create_Session operational http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${OPERATIONAL_API} auth=${AUTH}
95 SSHLibrary.Set_Default_Configuration prompt=${TOOLS_SYSTEM_PROMPT}
96 SetupUtils.Setup_Utils_For_Setup_And_Teardown
97 NetconfKeywords.Setup_Netconf_Keywords
98 # Deploy testing tools.
99 SSHLibrary.Put_File ${CURDIR}/../../../../tools/netconf_tools/getter.py
100 SSHLibrary.Put_File ${CURDIR}/../../../libraries/AuthStandalone.py
101 ${device_type}= BuiltIn.Set_Variable_If ${USE_NETCONF_CONNECTOR}==${True} default ${device_type}
102 BuiltIn.Set_Suite_Variable ${device_type}
105 [Documentation] Teardown the test infrastructure, perform cleanup and release all resources.
106 RequestsLibrary.Delete_All_Sessions
107 NetconfKeywords.Stop_Testtool
110 [Arguments] ${current_name}
111 [Documentation] Operation for configuring the device.
112 KarafKeywords.Log_Message_To_Controller_Karaf Configuring device ${current_name} to Netconf
113 NetconfKeywords.Configure_Device_In_Netconf ${current_name} device_type=${device_type} device_port=${current_port}
114 KarafKeywords.Log_Message_To_Controller_Karaf Device ${current_name} configured
117 [Arguments] ${current_name}
118 [Documentation] Operation for waiting until the device is connected.
119 KarafKeywords.Log_Message_To_Controller_Karaf Waiting for device ${current_name} to connect
120 NetconfKeywords.Wait_Device_Connected ${current_name} period=0.5s timeout=120s
121 KarafKeywords.Log_Message_To_Controller_Karaf Device ${current_name} connected
123 Read_Python_Tool_Operation_Result
124 [Arguments] ${number}
125 [Documentation] Read and process a report line emitted from the Python tool that corresponds to the device with the given number.
126 ${test}= SSHLibrary.Read_Until_Regexp \\n
127 ${test}= String.Split_String ${test} |
128 ${response}= Collections.Get_From_List ${test} 0
129 ${message}= Collections.Get_From_List ${test} 1
130 BuiltIn.Run_Keyword_If '${response}' == 'ERROR' Fail Error getting data: ${message}
131 ${start}= Collections.Get_From_List ${test} 1
132 ${stop}= Collections.Get_From_List ${test} 2
133 ${ellapsed}= Collections.Get_From_List ${test} 3
134 BuiltIn.Log DATA REQUEST RESULT: Device=${number} StartTime=${start} StopTime=${stop} EllapsedTime=${ellapsed}
135 ${data}= Collections.Get_From_List ${test} 4
136 ${expected}= BuiltIn.Set_Variable '<data xmlns="${ODL_NETCONF_NAMESPACE}"></data>'
137 BuiltIn.Should_Be_Equal_As_Strings ${data} ${expected}
140 [Arguments] ${current_name}
141 [Documentation] Operation for deconfiguring the device.
142 KarafKeywords.Log_Message_To_Controller_Karaf Deconfiguring device ${current_name}
143 NetconfKeywords.Remove_Device_From_Netconf ${current_name}
144 KarafKeywords.Log_Message_To_Controller_Karaf Device ${current_name} deconfigured
146 Check_Device_Deconfigured
147 [Arguments] ${current_name}
148 [Documentation] Operation for making sure the device is really deconfigured.
149 KarafKeywords.Log_Message_To_Controller_Karaf Waiting for device ${current_name} to disappear
150 NetconfKeywords.Wait_Device_Fully_Removed ${current_name} period=0.5s timeout=120s
151 KarafKeywords.Log_Message_To_Controller_Karaf Device ${current_name} removed