Kailash | 9276492 | 2019-07-25 08:21:39 -0700 | [diff] [blame] | 1 | # Copyright 2017-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
Kailash | 9276492 | 2019-07-25 08:21:39 -0700 | [diff] [blame] | 14 | # robot test functions |
| 15 | |
| 16 | *** Settings *** |
| 17 | Documentation Library for various utilities |
| 18 | Library SSHLibrary |
Kailash | 9276492 | 2019-07-25 08:21:39 -0700 | [diff] [blame] | 19 | Library String |
| 20 | Library DateTime |
| 21 | Library Process |
| 22 | Library Collections |
| 23 | Library RequestsLibrary |
| 24 | Library OperatingSystem |
Andy Bavier | 63460da | 2020-02-20 14:35:12 -0700 | [diff] [blame] | 25 | Library CORDRobot |
| 26 | Library ImportResource resources=CORDRobot |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 27 | Resource ./voltctl.robot |
Kailash | 9276492 | 2019-07-25 08:21:39 -0700 | [diff] [blame] | 28 | |
| 29 | *** Keywords *** |
Kailash | 528f7c0 | 2019-07-31 10:55:49 -0700 | [diff] [blame] | 30 | Check CLI Tools Configured |
| 31 | [Documentation] Tests that use 'voltctl' and 'kubectl' should execute this keyword in suite setup |
| 32 | # check voltctl and kubectl configured |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 33 | ${voltctl_rc}= Run And Return RC voltctl device list |
| 34 | ${kubectl_rc}= Run And Return RC kubectl get pods |
Gilles Depatie | 675a206 | 2019-10-22 12:44:42 -0400 | [diff] [blame] | 35 | Run Keyword If ${voltctl_rc} != 0 or ${kubectl_rc} != 0 FATAL ERROR |
| 36 | ... VOLTCTL and KUBECTL not configured. Please configure before executing tests. |
Gilles Depatie | b5682f8 | 2019-10-31 10:39:45 -0400 | [diff] [blame] | 37 | |
| 38 | Send File To Onos |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 39 | [Documentation] Send the content of the file to Onos to selected section of configuration |
| 40 | ... using Post Request |
| 41 | [Arguments] ${CONFIG_FILE} ${section} |
| 42 | ${Headers}= Create Dictionary Content-Type application/json |
| 43 | ${File_Data}= OperatingSystem.Get File ${CONFIG_FILE} |
| 44 | Log ${Headers} |
| 45 | Log ${File_Data} |
| 46 | ${resp}= Post Request ONOS |
| 47 | ... /onos/v1/network/configuration/${section} headers=${Headers} data=${File_Data} |
| 48 | Should Be Equal As Strings ${resp.status_code} 200 |
Andy Bavier | 88cd9f6 | 2019-11-26 16:22:33 -0700 | [diff] [blame] | 49 | |
| 50 | Common Test Suite Setup |
| 51 | [Documentation] Setup the test suite |
Andy Bavier | 88cd9f6 | 2019-11-26 16:22:33 -0700 | [diff] [blame] | 52 | Set Global Variable ${KUBECTL_CONFIG} export KUBECONFIG=%{KUBECONFIG} |
Matteo Scandolo | 5899be1 | 2020-11-11 15:38:07 -0800 | [diff] [blame] | 53 | Set Global Variable ${VOLTCTL_CONFIG} %{VOLTCONFIG} |
Andy Bavier | 88cd9f6 | 2019-11-26 16:22:33 -0700 | [diff] [blame] | 54 | ${k8s_node_ip}= Evaluate ${nodes}[0].get("ip") |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 55 | ${ONOS_REST_IP}= Get Environment Variable ONOS_REST_IP ${k8s_node_ip} |
| 56 | ${ONOS_SSH_IP}= Get Environment Variable ONOS_SSH_IP ${k8s_node_ip} |
| 57 | Set Global Variable ${ONOS_REST_IP} |
| 58 | Set Global Variable ${ONOS_SSH_IP} |
Andy Bavier | 88cd9f6 | 2019-11-26 16:22:33 -0700 | [diff] [blame] | 59 | ${k8s_node_user}= Evaluate ${nodes}[0].get("user") |
| 60 | ${k8s_node_pass}= Evaluate ${nodes}[0].get("pass") |
| 61 | Check CLI Tools Configured |
| 62 | ${onos_auth}= Create List karaf karaf |
| 63 | ${HEADERS} Create Dictionary Content-Type=application/json |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 64 | Create Session ONOS http://${ONOS_REST_IP}:${ONOS_REST_PORT} auth=${ONOS_AUTH} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 65 | #${olt_ip}= Evaluate ${olts}[0].get("ip") |
| 66 | #${olt_ssh_ip}= Evaluate ${olts}[0].get("sship") |
| 67 | #${olt_user}= Evaluate ${olts}[0].get("user") |
| 68 | #${olt_pass}= Evaluate ${olts}[0].get("pass") |
| 69 | #${olt_serial_number}= Evaluate ${olts}[0].get("serial") |
| 70 | ${num_olts} Get Length ${olts} |
| 71 | ${list_olts} Create List |
| 72 | FOR ${I} IN RANGE 0 ${num_olts} |
| 73 | ${ip} Evaluate ${olts}[${I}].get("ip") |
| 74 | ${user} Evaluate ${olts}[${I}].get("user") |
| 75 | ${pass} Evaluate ${olts}[${I}].get("pass") |
| 76 | ${serial_number} Evaluate ${olts}[${I}].get("serial") |
| 77 | ${olt_ssh_ip} Evaluate ${olts}[${I}].get("sship") |
| 78 | ${onu_count}= Get ONU Count For OLT ${hosts.src} ${serial_number} |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 79 | ${onu_list}= Get ONU List For OLT ${hosts.src} ${serial_number} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 80 | ${olt} Create Dictionary ip ${ip} user ${user} pass |
| 81 | ... ${pass} sn ${serial_number} onucount ${onu_count} |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 82 | ... sship ${olt_ssh_ip} onus ${onu_list} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 83 | Append To List ${list_olts} ${olt} |
| 84 | END |
| 85 | ${num_all_onus}= Get Length ${hosts.src} |
| 86 | ${num_all_onus}= Convert to String ${num_all_onus} |
Andy Bavier | 88cd9f6 | 2019-11-26 16:22:33 -0700 | [diff] [blame] | 87 | #send sadis file to onos |
Andy Bavier | a269175 | 2019-11-27 12:18:38 -0700 | [diff] [blame] | 88 | ${sadis_file}= Get Variable Value ${sadis.file} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 89 | Log To Console \nSadis File:${sadis_file} |
Andy Bavier | 88cd9f6 | 2019-11-26 16:22:33 -0700 | [diff] [blame] | 90 | Run Keyword Unless '${sadis_file}' is '${None}' Send File To Onos ${sadis_file} apps/ |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 91 | Set Suite Variable ${num_all_onus} |
| 92 | Set Suite Variable ${num_olts} |
| 93 | Set Suite Variable ${list_olts} |
| 94 | ${olt_count}= Get Length ${list_olts} |
| 95 | Set Suite Variable ${olt_count} |
| 96 | #Set Suite Variable ${olt_serial_number} |
| 97 | #Set Suite Variable ${olt_ip} |
| 98 | #Set Suite Variable ${olt_ssh_ip} |
| 99 | #Set Suite Variable ${olt_user} |
| 100 | #Set Suite Variable ${olt_pass} |
Andy Bavier | 88cd9f6 | 2019-11-26 16:22:33 -0700 | [diff] [blame] | 101 | @{container_list}= Create List adapter-open-olt adapter-open-onu voltha-api-server |
| 102 | ... voltha-ro-core voltha-rw-core-11 voltha-rw-core-12 voltha-ofagent |
| 103 | Set Suite Variable ${container_list} |
| 104 | ${datetime}= Get Current Date |
suraj gour | 7f6d5fe | 2019-11-29 10:56:35 +0000 | [diff] [blame] | 105 | Set Suite Variable ${datetime} |
| 106 | |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 107 | Get ONU Count For OLT |
| 108 | [Arguments] ${src} ${serial_number} |
| 109 | [Documentation] Gets ONU Count for the specified OLT |
| 110 | ${src_length}= Get Length ${src} |
| 111 | ${count}= Set Variable 0 |
| 112 | FOR ${I} IN RANGE 0 ${src_length} |
| 113 | ${sn} Evaluate ${src}[${I}].get("olt") |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 114 | ${count}= Run Keyword If '${serial_number}' == '${sn}' Evaluate ${count} + 1 |
| 115 | ... ELSE Set Variable ${count} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 116 | END |
| 117 | [Return] ${count} |
| 118 | |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 119 | Get ONU List For OLT |
| 120 | [Arguments] ${src} ${serial_number} |
| 121 | [Documentation] Gets ONU List for the specified OLT |
| 122 | ${src_length}= Get Length ${src} |
| 123 | ${onu_list}= Create List |
| 124 | FOR ${I} IN RANGE 0 ${src_length} |
| 125 | ${sn} Evaluate ${src}[${I}].get("olt") |
| 126 | Run Keyword If '${serial_number}' == '${sn}' Append To List ${onu_list} ${src}[${I}].get("onu") |
| 127 | ... ELSE Set Variable ${onu_list} |
| 128 | END |
| 129 | [Return] ${onu_list} |
| 130 | |
suraj gour | 7f6d5fe | 2019-11-29 10:56:35 +0000 | [diff] [blame] | 131 | WPA Reassociate |
suraj gour | 7f6d5fe | 2019-11-29 10:56:35 +0000 | [diff] [blame] | 132 | [Documentation] Executes a particular wpa_cli reassociate, which performs force reassociation |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 133 | [Arguments] ${iface} ${ip} ${user} ${pass}=${None} |
| 134 | ... ${container_type}=${None} ${container_name}=${None} |
suraj gour | 7f6d5fe | 2019-11-29 10:56:35 +0000 | [diff] [blame] | 135 | #Below for loops are used instead of sleep time, to execute reassociate command and check status |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 136 | FOR ${i} IN RANGE 70 |
| 137 | ${output}= Login And Run Command On Remote System |
| 138 | ... wpa_cli -i ${iface} reassociate ${ip} ${user} |
| 139 | ... ${pass} ${container_type} ${container_name} |
| 140 | ${passed}= Run Keyword And Return Status Should Contain ${output} OK |
Andy Bavier | b63f6d2 | 2020-03-12 15:34:37 -0700 | [diff] [blame] | 141 | Exit For Loop If ${passed} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 142 | END |
Andy Bavier | b63f6d2 | 2020-03-12 15:34:37 -0700 | [diff] [blame] | 143 | Should Be True ${passed} Status does not contain 'SUCCESS' |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 144 | FOR ${i} IN RANGE 70 |
| 145 | ${output}= Login And Run Command On Remote System |
Andy Bavier | ae4a17e | 2020-02-25 14:54:36 -0700 | [diff] [blame] | 146 | ... wpa_cli -i ${iface} status | grep SUCCESS ${ip} ${user} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 147 | ... ${pass} ${container_type} ${container_name} |
| 148 | ${passed}= Run Keyword And Return Status Should Contain ${output} SUCCESS |
Andy Bavier | b63f6d2 | 2020-03-12 15:34:37 -0700 | [diff] [blame] | 149 | Exit For Loop If ${passed} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 150 | END |
Andy Bavier | b63f6d2 | 2020-03-12 15:34:37 -0700 | [diff] [blame] | 151 | Should Be True ${passed} Status does not contain 'SUCCESS' |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 152 | |
suraj gour | 7f6d5fe | 2019-11-29 10:56:35 +0000 | [diff] [blame] | 153 | Validate Authentication After Reassociate |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 154 | [Arguments] ${auth_pass} ${iface} ${ip} ${user} ${pass}=${None} |
| 155 | ... ${container_type}=${None} ${container_name}=${None} |
| 156 | [Documentation] |
| 157 | ... Executes a particular reassociate request on the RG using wpa_cli. |
| 158 | ... auth_pass determines if authentication should pass |
Andy Bavier | 84834d4 | 2020-02-25 13:49:50 -0700 | [diff] [blame] | 159 | ${wpa_log}= Catenate SEPARATOR=. /tmp/wpa ${iface} log |
| 160 | ${output}= Login And Run Command On Remote System truncate -s 0 ${wpa_log}; cat ${wpa_log} |
| 161 | ... ${ip} ${user} ${pass} ${container_type} ${container_name} |
| 162 | Log ${output} |
| 163 | Should Not Contain ${output} authentication completed successfully |
suraj gour | 7f6d5fe | 2019-11-29 10:56:35 +0000 | [diff] [blame] | 164 | WPA Reassociate ${iface} ${ip} ${user} ${pass} ${container_type} ${container_name} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 165 | Run Keyword If '${auth_pass}' == 'True' Wait Until Keyword Succeeds ${timeout} 2s |
Andy Bavier | 84834d4 | 2020-02-25 13:49:50 -0700 | [diff] [blame] | 166 | ... Check Remote File Contents True ${wpa_log} ${iface}.*authentication completed successfully |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 167 | ... ${ip} ${user} ${pass} ${container_type} ${container_name} |
suraj gour | 7f6d5fe | 2019-11-29 10:56:35 +0000 | [diff] [blame] | 168 | Run Keyword If '${auth_pass}' == 'False' Sleep 20s |
Suchitra Vemuri | 3cb29f8 | 2020-02-25 13:59:58 -0800 | [diff] [blame] | 169 | Run Keyword If '${auth_pass}' == 'False' Check Remote File Contents False /tmp/wpa.log |
Andy Bavier | 84834d4 | 2020-02-25 13:49:50 -0700 | [diff] [blame] | 170 | ... ${iface}.*authentication completed successfully ${ip} ${user} ${pass} |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 171 | ... ${container_type} ${container_name} |
suraj gour | d5cfdbb | 2019-12-13 12:44:55 +0000 | [diff] [blame] | 172 | |
| 173 | Send Dhclient Request To Release Assigned IP |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 174 | [Arguments] ${iface} ${ip} ${user} ${path_dhcpleasefile} ${pass}=${None} |
| 175 | ... ${container_type}=${None} ${container_name}=${None} |
suraj gour | d5cfdbb | 2019-12-13 12:44:55 +0000 | [diff] [blame] | 176 | [Documentation] Executes a dhclient with option to release ip against a particular interface on the RG (src) |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 177 | ${result}= Login And Run Command On Remote System |
| 178 | ... dhclient -nw -r ${iface} && rm ${path_dhcpleasefile}/dhclient.* ${ip} ${user} |
suraj gour | d5cfdbb | 2019-12-13 12:44:55 +0000 | [diff] [blame] | 179 | ... ${pass} ${container_type} ${container_name} |
| 180 | Log ${result} |
| 181 | #Should Contain ${result} DHCPRELEASE |
| 182 | [Return] ${result} |
suraj gour | 1ecfae9 | 2019-12-20 15:11:40 +0000 | [diff] [blame] | 183 | |
| 184 | Check Remote File Contents For WPA Logs |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 185 | [Arguments] ${file_should_exist} ${file} ${pattern} ${ip} ${user} ${pass}=${None} |
| 186 | ... ${container_type}=${None} ${container_name}=${None} ${prompt}=~$ |
suraj gour | 1ecfae9 | 2019-12-20 15:11:40 +0000 | [diff] [blame] | 187 | [Documentation] Checks for particular pattern count in a file |
Zack Williams | a8fe75a | 2020-01-10 14:25:27 -0700 | [diff] [blame] | 188 | ${result}= Login And Run Command On Remote System |
| 189 | ... cat ${file} | grep '${pattern}' | wc -l ${ip} ${user} ${pass} |
suraj gour | 1ecfae9 | 2019-12-20 15:11:40 +0000 | [diff] [blame] | 190 | ... ${container_type} ${container_name} ${prompt} |
| 191 | [Return] ${result} |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 192 | |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 193 | |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 194 | Perform Sanity Test |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 195 | [Documentation] This keyword iterate all OLTs and performs Sanity Test Procedure |
| 196 | ... for all the ONUs connected to each OLT - ATT workflow |
| 197 | FOR ${J} IN RANGE 0 ${num_olts} |
| 198 | ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn] |
| 199 | ${onu_count}= Set Variable ${list_olts}[${J}][onucount] |
| 200 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 201 | ... ${olt_serial_number} |
| 202 | Set Global Variable ${of_id} |
| 203 | ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 204 | ... Get NNI Port in ONOS ${of_id} |
| 205 | Set Global Variable ${nni_port} |
| 206 | # Verify Default Meter in ONOS (valid only for ATT) |
| 207 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 208 | ... Verify Default Meter Present in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 209 | Perform Sanity Test Per OLT ${of_id} ${nni_port} ${olt_serial_number} ${onu_count} |
| 210 | END |
| 211 | |
| 212 | Perform Sanity Test Per OLT |
| 213 | [Arguments] ${of_id} ${nni_port} ${olt_serial_number} ${num_onus} |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 214 | [Documentation] This keyword performs Sanity Test Procedure |
| 215 | ... Sanity test performs authentication, dhcp and pings for all the ONUs given for the POD |
| 216 | ... This keyword can be used to call in any other tests where sanity check is required |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 217 | ... and avoids duplication of code. - ATT workflow |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 218 | #${of_id}= Wait Until Keyword Succeeds ${timeout} 15s |
| 219 | #... Validate OLT Device in ONOS ${olt_serial_number} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 220 | #Set Global Variable ${of_id} |
| 221 | #${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 222 | #... Get NNI Port in ONOS ${of_id} |
| 223 | #Set Global Variable ${nni_port} |
Hardik Windlass | 2a9b159 | 2020-07-23 18:28:13 +0530 | [diff] [blame] | 224 | # Verify Default Meter in ONOS (valid only for ATT) |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 225 | #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 226 | #... Verify Default Meter Present in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 227 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 228 | ${src}= Set Variable ${hosts.src[${I}]} |
| 229 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 230 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
Suchitra Vemuri | 0300591 | 2020-02-20 18:59:46 -0800 | [diff] [blame] | 231 | Run Keyword and Ignore Error Collect Logs |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 232 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 233 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 234 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
Suchitra Vemuri | 8078b97 | 2020-02-06 19:07:41 -0800 | [diff] [blame] | 235 | # Check ONU port is Enabled in ONOS |
| 236 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
Suchitra Vemuri | 760bdd3 | 2020-06-17 12:34:48 -0700 | [diff] [blame] | 237 | ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Suchitra Vemuri | 8078b97 | 2020-02-06 19:07:41 -0800 | [diff] [blame] | 238 | # Verify EAPOL flows are added for the ONU port |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 239 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 240 | ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
Suchitra Vemuri | 8078b97 | 2020-02-06 19:07:41 -0800 | [diff] [blame] | 241 | # Verify ONU state in voltha |
| 242 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 243 | ... ENABLED ACTIVE REACHABLE |
| 244 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 245 | # Perform Authentication |
Andy Bavier | 84834d4 | 2020-02-25 13:49:50 -0700 | [diff] [blame] | 246 | ${wpa_log}= Run Keyword If ${has_dataplane} Catenate SEPARATOR=. |
| 247 | ... /tmp/wpa ${src['dp_iface_name']} log |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 248 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate Authentication True |
| 249 | ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']} |
Andy Bavier | 84834d4 | 2020-02-25 13:49:50 -0700 | [diff] [blame] | 250 | ... ${src['container_type']} ${src['container_name']} ${wpa_log} |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 251 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2 |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 252 | ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 253 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2 |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 254 | ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 255 | ... volt-add-subscriber-access ${of_id} ${onu_port} |
Suchitra Vemuri | 9da4430 | 2020-03-04 14:24:49 -0800 | [diff] [blame] | 256 | # Verify that no pending flows exist for the ONU port |
| 257 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 258 | ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
Hardik Windlass | 2180763 | 2020-04-14 16:24:55 +0530 | [diff] [blame] | 259 | # Verify subscriber access flows are added for the ONU port |
| 260 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 261 | ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 262 | ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']} |
Hardik Windlass | 2a9b159 | 2020-07-23 18:28:13 +0530 | [diff] [blame] | 263 | # Verify Meters in ONOS |
| 264 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 265 | ... Verify Meters in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port} |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 266 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 267 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 268 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 269 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 270 | ... ${dst['container_name']} |
| 271 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 272 | ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 273 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 274 | Run Keyword and Ignore Error Collect Logs |
| 275 | END |
| 276 | |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 277 | Perform Sanity Test DT |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 278 | [Documentation] This keyword iterate all OLTs and performs Sanity Test Procedure for DT workflow |
| 279 | FOR ${J} IN RANGE 0 ${num_olts} |
| 280 | ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn] |
| 281 | ${num_onus}= Set Variable ${list_olts}[${J}][onucount] |
| 282 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
Suchitra Vemuri | 4b8f4f5 | 2020-11-17 19:12:50 -0800 | [diff] [blame] | 283 | Run Keyword and Ignore Error Collect Logs |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 284 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 285 | ... ${olt_serial_number} |
| 286 | Set Global Variable ${of_id} |
| 287 | ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 288 | ... Get NNI Port in ONOS ${of_id} |
| 289 | Set Global Variable ${nni_port} |
| 290 | Perform Sanity Test DT Per OLT ${of_id} ${nni_port} ${olt_serial_number} ${num_onus} |
| 291 | # Verify ONOS Flows |
| 292 | # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream) |
| 293 | ${onos_flows_count}= Evaluate 4 * ${num_onus} |
| 294 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 295 | ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 296 | ... ${onos_flows_count} |
| 297 | # Verify VOLTHA Flows |
| 298 | # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP |
| 299 | ${olt_flows}= Evaluate 2 * ${num_onus} + 1 |
| 300 | # Number of per ONU Flows equals 2 (one each for downstream and upstream) |
| 301 | ${onu_flows}= Set Variable 2 |
| 302 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows} |
| 303 | ... ${olt_device_id} |
| 304 | ${List_ONU_Serial} Create List |
| 305 | Set Suite Variable ${List_ONU_Serial} |
Suchitra Vemuri | 21a47fd | 2020-11-16 18:39:09 -0800 | [diff] [blame] | 306 | Build ONU SN List ${List_ONU_Serial} ${olt_serial_number} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 307 | Log ${List_ONU_Serial} |
| 308 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows |
| 309 | ... ${List_ONU_Serial} ${onu_flows} |
| 310 | END |
| 311 | |
| 312 | |
| 313 | Perform Sanity Test DT Per OLT |
| 314 | [Arguments] ${of_id} ${nni_port} ${olt_serial_number} ${num_onus} |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 315 | [Documentation] This keyword performs Sanity Test Procedure for DT Workflow |
| 316 | ... Sanity test performs dhcp and pings (without EAPOL and DHCP flows) for all the ONUs given for the POD |
| 317 | ... This keyword can be used to call in any other tests where sanity check is required |
| 318 | ... and avoids duplication of code. |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 319 | #${of_id}= Wait Until Keyword Succeeds 360s 15s Validate OLT Device in ONOS ${olt_serial_number} |
| 320 | #Set Global Variable ${of_id} |
| 321 | #${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 322 | #... Get NNI Port in ONOS ${of_id} |
| 323 | #Set Global Variable ${nni_port} |
| 324 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 325 | ${src}= Set Variable ${hosts.src[${I}]} |
| 326 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 327 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
Suchitra Vemuri | 4b8f4f5 | 2020-11-17 19:12:50 -0800 | [diff] [blame] | 328 | Run Keyword and Ignore Error Collect Logs |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 329 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 330 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 331 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 332 | # Check ONU port is Enabled in ONOS |
| 333 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
Suchitra Vemuri | 760bdd3 | 2020-06-17 12:34:48 -0700 | [diff] [blame] | 334 | ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 335 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2 |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 336 | ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 337 | ... volt-add-subscriber-access ${of_id} ${onu_port} |
Hardik Windlass | fb5eace | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 338 | # Verify subscriber access flows are added for the ONU port |
| 339 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
Hardik Windlass | 25e1170 | 2020-03-30 20:05:19 +0530 | [diff] [blame] | 340 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 341 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 342 | # Verify ONU state in voltha |
| 343 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 344 | ... ENABLED ACTIVE REACHABLE |
| 345 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
Hardik Windlass | 2a9b159 | 2020-07-23 18:28:13 +0530 | [diff] [blame] | 346 | # Verify Meters in ONOS |
| 347 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 348 | ... Verify Meters in ONOS ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} ${onu_port} |
Hardik Windlass | fb5eace | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 349 | # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652) |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 350 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 351 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 352 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 353 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 354 | ... ${dst['container_name']} |
| 355 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 356 | Run Keyword and Ignore Error Collect Logs |
| 357 | END |
Hardik Windlass | fb5eace | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 358 | # Verify ONOS Flows |
| 359 | # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream) |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 360 | #${onos_flows_count}= Evaluate 4 * ${num_onus} |
| 361 | #Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 362 | #... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 363 | #... ${onos_flows_count} |
Hardik Windlass | fb5eace | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 364 | # Verify VOLTHA Flows |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 365 | # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 366 | #${olt_flows}= Evaluate 2 * ${num_onus} + 1 |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 367 | # Number of per ONU Flows equals 2 (one each for downstream and upstream) |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 368 | #${onu_flows}= Set Variable 2 |
| 369 | #Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows} |
| 370 | #${List_ONU_Serial} Create List |
| 371 | #Set Suite Variable ${List_ONU_Serial} |
Andrea Campanella | 6391f84 | 2020-11-16 10:01:18 +0100 | [diff] [blame] | 372 | #Build ONU SN List ${List_ONU_Serial} ${olt_serial_number} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 373 | #Log ${List_ONU_Serial} |
| 374 | #Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows |
| 375 | #... ${List_ONU_Serial} ${onu_flows} |
| 376 | |
| 377 | Validate All OLT Flows |
| 378 | [Documentation] This keyword iterate all OLTs and performs Sanity Test Procedure for DT workflow |
| 379 | FOR ${J} IN RANGE 0 ${num_olts} |
| 380 | ${olt_serial_number}= Set Variable ${list_olts}[${J}][sn] |
| 381 | ${num_onus}= Set Variable ${list_olts}[${J}][onucount] |
| 382 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 383 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 384 | ... ${olt_serial_number} |
| 385 | Set Global Variable ${of_id} |
| 386 | # Verify ONOS Flows |
| 387 | # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream) |
| 388 | ${onos_flows_count}= Evaluate 4 * ${num_onus} |
| 389 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 390 | ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 391 | ... ${onos_flows_count} |
| 392 | # Verify VOLTHA Flows |
| 393 | # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP |
| 394 | ${olt_flows}= Evaluate 2 * ${num_onus} + 1 |
| 395 | # Number of per ONU Flows equals 2 (one each for downstream and upstream) |
| 396 | ${onu_flows}= Set Variable 2 |
| 397 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows} |
| 398 | ... ${olt_device_id} |
| 399 | ${List_ONU_Serial} Create List |
| 400 | Set Suite Variable ${List_ONU_Serial} |
Andrea Campanella | 6391f84 | 2020-11-16 10:01:18 +0100 | [diff] [blame] | 401 | Build ONU SN List ${List_ONU_Serial} ${olt_serial_number} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 402 | Log ${List_ONU_Serial} |
| 403 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows |
| 404 | ... ${List_ONU_Serial} ${onu_flows} |
| 405 | END |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 406 | |
Suchitra Vemuri | 2f1e07d | 2020-06-26 19:18:01 -0700 | [diff] [blame] | 407 | Perform Sanity Test TT |
| 408 | [Documentation] This keyword performs Sanity Test Procedure for TT Workflow |
| 409 | ... Sanity test performs dhcp and pings (without EAPOL and DHCP flows) for all the ONUs given for the POD |
| 410 | ... This keyword can be used to call in any other tests where sanity check is required |
| 411 | ... and avoids duplication of code. |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 412 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Suchitra Vemuri | 85cb7d6 | 2020-07-16 23:46:16 -0700 | [diff] [blame] | 413 | ${src}= Set Variable ${hosts.src[${I}]} |
| 414 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 415 | ${service_type}= Get Variable Value ${src['service_type']} "null" |
| 416 | Run Keyword IF '${service_type}' != 'mcast' Sanity Test TT one ONU ${src} ${dst} |
| 417 | Run Keyword and Ignore Error Collect Logs |
| 418 | END |
| 419 | Run Keyword and Ignore Error Collect Logs |
| 420 | |
| 421 | Sanity Test TT one ONU |
| 422 | [Documentation] This keyword performs sanity test for a single ONU for TT workflow |
| 423 | ... Tests for one ONU |
| 424 | ... Assertions apply to HSIA, VoD, VoIP services |
| 425 | [Arguments] ${src} ${dst} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 426 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${src['olt']} |
Suchitra Vemuri | 2f1e07d | 2020-06-26 19:18:01 -0700 | [diff] [blame] | 427 | Set Global Variable ${of_id} |
| 428 | ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 429 | ... Get NNI Port in ONOS ${of_id} |
| 430 | Set Global Variable ${nni_port} |
Suchitra Vemuri | 85cb7d6 | 2020-07-16 23:46:16 -0700 | [diff] [blame] | 431 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 432 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 433 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 434 | # Check ONU port is Enabled in ONOS |
| 435 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
| 436 | ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
| 437 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2 |
| 438 | ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 439 | ... volt-add-subscriber-access ${of_id} ${onu_port} |
| 440 | Sleep 30s |
| 441 | # Verify ONU state in voltha |
Matteo Scandolo | 74bd5c3 | 2020-12-08 09:52:19 -0800 | [diff] [blame] | 442 | ${onu_reasons}= Create List tech-profile-config-download-success omci-flows-pushed |
Suchitra Vemuri | 85cb7d6 | 2020-07-16 23:46:16 -0700 | [diff] [blame] | 443 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 444 | ... ENABLED ACTIVE REACHABLE |
Matteo Scandolo | 74bd5c3 | 2020-12-08 09:52:19 -0800 | [diff] [blame] | 445 | ... ${src['onu']} onu=True onu_reason=${onu_reasons} |
Suchitra Vemuri | 85cb7d6 | 2020-07-16 23:46:16 -0700 | [diff] [blame] | 446 | # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652) |
| 447 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 448 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 449 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 450 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 451 | ... ${dst['container_name']} |
Suchitra Vemuri | 16644bd | 2020-10-03 14:06:12 -0700 | [diff] [blame] | 452 | Run Keyword IF ${has_dataplane} |
Suchitra Vemuri | b4d9e8d | 2020-10-05 20:49:21 -0700 | [diff] [blame] | 453 | ... Run Keyword IF '${src['service_type']}'!='hsia' |
Suchitra Vemuri | 4281941 | 2020-10-01 17:45:43 -0700 | [diff] [blame] | 454 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
Suchitra Vemuri | 8d3b003 | 2020-09-11 17:49:08 -0700 | [diff] [blame] | 455 | ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
Suchitra Vemuri | 4281941 | 2020-10-01 17:45:43 -0700 | [diff] [blame] | 456 | ... ${src['c_tag']} |
Suchitra Vemuri | 85cb7d6 | 2020-07-16 23:46:16 -0700 | [diff] [blame] | 457 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 458 | Run Keyword and Ignore Error Collect Logs |
| 459 | |
| 460 | Perform Sanity Test TT MCAST |
| 461 | [Documentation] This keyword performs Sanity Test Procedure for TT Workflow |
| 462 | ... Adds subscribers |
| 463 | ... Validates for MCAST |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 464 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Suchitra Vemuri | 2f1e07d | 2020-06-26 19:18:01 -0700 | [diff] [blame] | 465 | ${src}= Set Variable ${hosts.src[${I}]} |
| 466 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Suchitra Vemuri | 85cb7d6 | 2020-07-16 23:46:16 -0700 | [diff] [blame] | 467 | ${service_type}= Get Variable Value ${src['service_type']} "null" |
| 468 | Run Keyword IF '${service_type}' == 'mcast' Sanity Test TT MCAST one ONU ${src} |
| 469 | ... ${dst} |
Suchitra Vemuri | 2f1e07d | 2020-06-26 19:18:01 -0700 | [diff] [blame] | 470 | Run Keyword and Ignore Error Collect Logs |
| 471 | END |
Suchitra Vemuri | 85cb7d6 | 2020-07-16 23:46:16 -0700 | [diff] [blame] | 472 | Run Keyword and Ignore Error Collect Logs |
| 473 | |
| 474 | Sanity Test TT MCAST one ONU |
| 475 | [Documentation] This keyword performs sanity test for a single ONU for TT workflow |
| 476 | ... Tests for one ONU |
| 477 | ... Assertions apply to MCAST services |
| 478 | [Arguments] ${src} ${dst} |
| 479 | # Check for iperf and jq tools |
| 480 | ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf jq |
| 481 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} |
| 482 | ... ${src['container_name']} |
| 483 | Pass Execution If ${rc} != 0 Skipping test: iperf / jq not found on the RG |
| 484 | |
| 485 | #Reset the IP on the interface |
| 486 | ${output}= Login And Run Command On Remote System sudo ifconfig ${src['dp_iface_name']} 0 |
| 487 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 488 | # Kill iperf on BNG |
| 489 | ${rg_output}= Run Keyword and Continue On Failure Login And Run Command On Remote System |
| 490 | ... sudo kill -9 `pidof iperf` |
| 491 | ... ${dst['bng_ip']} ${dst['bng_user']} ${dst['bng_pass']} ${dst['container_type']} |
| 492 | ... ${dst['container_name']} |
| 493 | |
| 494 | # Setup RG for Multi-cast test |
| 495 | ${output}= Login And Run Command On Remote System |
| 496 | ... sudo ifconfig ${src['dp_iface_name']} ${src['mcast_rg']} up ; sudo kill -9 `pidof iperf` |
| 497 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 498 | ${output}= Login And Run Command On Remote System |
| 499 | ... sudo ip route add ${src['mcast_grp_subnet_mask']} dev ${src['dp_iface_name']} scope link |
| 500 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 501 | |
| 502 | # Perform operations for adding subscriber |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 503 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${src['olt']} |
Suchitra Vemuri | 85cb7d6 | 2020-07-16 23:46:16 -0700 | [diff] [blame] | 504 | Set Global Variable ${of_id} |
| 505 | ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 506 | ... Get NNI Port in ONOS ${of_id} |
| 507 | Set Global Variable ${nni_port} |
| 508 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 509 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 510 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 511 | # Check ONU port is Enabled in ONOS |
| 512 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
| 513 | ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
| 514 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2 |
| 515 | ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 516 | ... volt-add-subscriber-access ${of_id} ${onu_port} |
| 517 | Sleep 30s |
| 518 | # Verify ONU state in voltha |
Matteo Scandolo | 74bd5c3 | 2020-12-08 09:52:19 -0800 | [diff] [blame] | 519 | ${onu_reasons}= Create List tech-profile-config-download-success omci-flows-pushed |
Suchitra Vemuri | 85cb7d6 | 2020-07-16 23:46:16 -0700 | [diff] [blame] | 520 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 521 | ... ENABLED ACTIVE REACHABLE |
Matteo Scandolo | 74bd5c3 | 2020-12-08 09:52:19 -0800 | [diff] [blame] | 522 | ... ${src['onu']} onu=True onu_reason=${onu_reasons} |
Suchitra Vemuri | 85cb7d6 | 2020-07-16 23:46:16 -0700 | [diff] [blame] | 523 | |
| 524 | # Setup iperf on the BNG |
| 525 | ${server_output}= Login And Run Command On Remote System |
| 526 | ... sudo iperf -c ${dst['dp_iface_ip_qinq']} -u -T 32 -t 60 -i 1 & |
| 527 | ... ${dst['bng_ip']} ${dst['bng_user']} ${dst['bng_pass']} ${dst['container_type']} |
| 528 | ... ${dst['container_name']} |
| 529 | |
| 530 | # Setup iperf on the RG |
| 531 | ${rg_output}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s |
| 532 | ... Login And Run Command On Remote System |
| 533 | ... rm -rf /tmp/rg_output ; sudo iperf -s -u -B ${dst['dp_iface_ip_qinq']} -i 1 -D >> /tmp/rg_output |
| 534 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 535 | Log ${rg_output} |
| 536 | Sleep 60s |
| 537 | ${output}= Run Keyword and Continue On Failure Wait Until Keyword Succeeds 90s 5s |
| 538 | ... Login And Run Command On Remote System |
| 539 | ... cat /tmp/rg_output | grep KBytes |
| 540 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 541 | Log ${output} |
| 542 | Should Contain ${output} KBytes |
| 543 | |
| 544 | # Kill iperf on BNG |
| 545 | ${rg_output}= Run Keyword and Continue On Failure Login And Run Command On Remote System |
| 546 | ... sudo kill -9 `pidof iperf` |
| 547 | ... ${dst['bng_ip']} ${dst['bng_user']} ${dst['bng_pass']} ${dst['container_type']} |
| 548 | ... ${dst['container_name']} |
| 549 | |
| 550 | # Kill iperf on the RG |
| 551 | ${output}= Run Keyword and Continue On Failure Login And Run Command On Remote System |
| 552 | ... sudo kill -9 `pidof iperf` |
| 553 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 554 | |
Suchitra Vemuri | 2f1e07d | 2020-06-26 19:18:01 -0700 | [diff] [blame] | 555 | |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 556 | Setup |
| 557 | [Documentation] Pre-test Setup |
| 558 | #test for empty device list |
| 559 | Test Empty Device List |
Suchitra Vemuri | 3158f3c | 2020-05-28 17:58:26 -0700 | [diff] [blame] | 560 | #Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s Openolt is Up |
| 561 | #... ${olt_ip} ${olt_user} ${olt_pass} |
Suchitra Vemuri | 1d8e817 | 2020-06-17 17:43:56 -0700 | [diff] [blame] | 562 | Run Keyword If ${has_dataplane} Sleep 230s |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 563 | # Create a list of olt ids (logical and device_id) |
| 564 | ${olt_ids} Create List |
| 565 | FOR ${I} IN RANGE 0 ${num_olts} |
| 566 | #create/preprovision device |
| 567 | ${olt_device_id}= Create Device ${list_olts}[${I}][ip] ${OLT_PORT} |
| 568 | ${olt_serial_number}= Set Variable ${list_olts}[${I}][sn] |
| 569 | #Set Suite Variable ${olt_device_id} |
| 570 | #validate olt states |
| 571 | Wait Until Keyword Succeeds ${timeout} 5s |
| 572 | ... Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN ${olt_device_id} |
| 573 | Sleep 5s |
| 574 | Enable Device ${olt_device_id} |
| 575 | Wait Until Keyword Succeeds 380s 5s |
| 576 | ... Validate OLT Device ENABLED ACTIVE REACHABLE ${olt_serial_number} |
| 577 | ${logical_id}= Get Logical Device ID From SN ${olt_serial_number} |
| 578 | # Set Suite Variable ${logical_id} |
| 579 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 580 | ... ${olt_serial_number} |
| 581 | ${olt} Create Dictionary device_id ${olt_device_id} logical_id ${logical_id} |
| 582 | ... of_id ${of_id} sn ${olt_serial_number} |
| 583 | Append To List ${olt_ids} ${olt} |
| 584 | END |
| 585 | Set Global Variable ${olt_ids} |
| 586 | |
| 587 | Get ofID From OLT List |
| 588 | [Documentation] Retrieves the corresponding of_id for the OLT serial number specified |
| 589 | [Arguments] ${serial_number} |
| 590 | FOR ${I} IN RANGE 0 ${olt_count} |
| 591 | ${sn}= Get From Dictionary ${olt_ids}[${I}] sn |
Andrea Campanella | 317a94c | 2020-11-13 10:38:19 +0100 | [diff] [blame] | 592 | ${of_id}= Run Keyword IF "${serial_number}"=="${sn}" |
| 593 | ... Get From Dictionary ${olt_ids}[${I}] of_id ELSE Set Variable ${of_id} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 594 | END |
| 595 | [Return] ${of_id} |
| 596 | |
| 597 | Get OLTDeviceID From OLT List |
| 598 | [Documentation] Retrieves the corresponding olt_device_id for the OLT serial number specified |
| 599 | [Arguments] ${serial_number} |
Suchitra Vemuri | 4b8f4f5 | 2020-11-17 19:12:50 -0800 | [diff] [blame] | 600 | ${olt_device_id}= Set Variable 0 |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 601 | FOR ${I} IN RANGE 0 ${olt_count} |
| 602 | ${sn}= Get From Dictionary ${olt_ids}[${I}] sn |
Andrea Campanella | 317a94c | 2020-11-13 10:38:19 +0100 | [diff] [blame] | 603 | ${olt_device_id}= Run Keyword IF "${serial_number}"=="${sn}" |
| 604 | ... Get From Dictionary ${olt_ids}[${I}] device_id ELSE Set Variable ${olt_device_id} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 605 | END |
| 606 | [Return] ${olt_device_id} |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 607 | |
Andrea Campanella | d848de0 | 2020-11-24 10:23:41 +0100 | [diff] [blame] | 608 | Get Num of Onus From OLT SN |
| 609 | [Documentation] Retrieves the corresponding number of ONUs for a given OLT based on serial number specified |
| 610 | [Arguments] ${serial_number} |
| 611 | ${num_of_olt_onus}= Set Variable 0 |
| 612 | FOR ${I} IN RANGE 0 ${olt_count} |
| 613 | ${sn}= Get From Dictionary ${olt_ids}[${I}] sn |
| 614 | ${num_of_olt_onus}= Run Keyword IF "${serial_number}"=="${sn}" |
| 615 | ... Get From Dictionary ${list_olts}[${I}] onucount ELSE Set Variable ${num_of_olt_onus} |
| 616 | END |
| 617 | [Return] ${num_of_olt_onus} |
| 618 | |
Hardik Windlass | aaea340 | 2020-03-10 19:45:45 +0530 | [diff] [blame] | 619 | Validate ONUs After OLT Disable |
| 620 | [Documentation] Validates the ONUs state in Voltha, ONUs port state in ONOS |
| 621 | ... and that pings do not succeed After corresponding OLT is Disabled |
Andrea Campanella | 4e50788 | 2020-11-26 11:33:11 +0100 | [diff] [blame] | 622 | [Arguments] ${num_onus} ${olt_serial_number} |
Hardik Windlass | aaea340 | 2020-03-10 19:45:45 +0530 | [diff] [blame] | 623 | FOR ${I} IN RANGE 0 ${num_onus} |
| 624 | ${src}= Set Variable ${hosts.src[${I}]} |
| 625 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Andrea Campanella | 4e50788 | 2020-11-26 11:33:11 +0100 | [diff] [blame] | 626 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 627 | ${of_id}= Get ofID From OLT List ${src['olt']} |
Hardik Windlass | aaea340 | 2020-03-10 19:45:45 +0530 | [diff] [blame] | 628 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 629 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 630 | ... ${of_id} |
| 631 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 632 | ... Validate Device ENABLED DISCOVERED |
| 633 | ... UNREACHABLE ${src['onu']} onu=True onu_reason=stopping-openomci |
| 634 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
Suchitra Vemuri | 760bdd3 | 2020-06-17 12:34:48 -0700 | [diff] [blame] | 635 | ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Hardik Windlass | aaea340 | 2020-03-10 19:45:45 +0530 | [diff] [blame] | 636 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 637 | ... Wait Until Keyword Succeeds 60s 2s |
| 638 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 639 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 640 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 641 | Run Keyword and Ignore Error Collect Logs |
| 642 | END |
| 643 | |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 644 | Delete All Devices and Verify |
| 645 | [Documentation] Remove any devices from VOLTHA and ONOS |
| 646 | # Clear devices from VOLTHA |
| 647 | Disable Devices In Voltha Root=true |
Suchitra Vemuri | 970747f | 2020-03-30 17:31:34 -0700 | [diff] [blame] | 648 | Sleep 5s |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 649 | Wait Until Keyword Succeeds ${timeout} 2s Test Devices Disabled In Voltha Root=true |
| 650 | Delete Devices In Voltha Root=true |
Matteo Scandolo | f6cea38 | 2020-04-20 14:32:00 -0700 | [diff] [blame] | 651 | Run Keyword If ${has_dataplane} Sleep 30s |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 652 | Wait Until Keyword Succeeds ${timeout} 2s Test Empty Device List |
| 653 | # Clear devices from ONOS |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 654 | #Remove All Devices From ONOS |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 655 | #... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 656 | |
| 657 | Teardown |
| 658 | [Documentation] kills processes and cleans up interfaces on src+dst servers |
| 659 | Run Keyword If ${has_dataplane} Clean Up Linux |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 660 | |
| 661 | Teardown Suite |
| 662 | [Documentation] Clean up device if desired |
| 663 | Run Keyword If ${teardown_device} Delete All Devices and Verify |
| 664 | |
| 665 | Delete Device and Verify |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 666 | [Arguments] ${olt_serial_number} |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 667 | [Documentation] Disable -> Delete devices via voltctl and verify its removed |
Suchitra Vemuri | 2fa9bba | 2020-01-22 17:38:48 -0800 | [diff] [blame] | 668 | ${olt_device_id}= Get Device ID From SN ${olt_serial_number} |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 669 | ${rc} ${output}= Run and Return Rc and Output |
Matteo Scandolo | 5899be1 | 2020-11-11 15:38:07 -0800 | [diff] [blame] | 670 | ... voltctl -c ${VOLTCTL_CONFIG} device disable ${olt_device_id} |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 671 | Should Be Equal As Integers ${rc} 0 |
| 672 | Sleep 5s |
| 673 | Wait Until Keyword Succeeds ${timeout} 5s |
| 674 | ... Validate OLT Device DISABLED UNKNOWN REACHABLE ${olt_serial_number} |
| 675 | ${rc} ${output}= Run and Return Rc and Output |
Matteo Scandolo | 5899be1 | 2020-11-11 15:38:07 -0800 | [diff] [blame] | 676 | ... voltctl -c ${VOLTCTL_CONFIG} device delete ${olt_device_id} |
Matteo Scandolo | f6cea38 | 2020-04-20 14:32:00 -0700 | [diff] [blame] | 677 | Run Keyword If ${has_dataplane} Sleep 50s |
Gayathri.Selvan | ee4a91b | 2020-01-17 06:49:53 +0000 | [diff] [blame] | 678 | Should Be Equal As Integers ${rc} 0 |
| 679 | Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed ${olt_device_id} |
| 680 | |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 681 | Repeat Sanity Test |
| 682 | [Documentation] This keyword performs Sanity Test Procedure |
| 683 | ... Sanity test performs authentication, dhcp and pings for all the ONUs given for the POD |
| 684 | ... This keyword can be used to call in any other tests where sanity check is required |
| 685 | ... with wpa reassociation |
| 686 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number} |
| 687 | Set Global Variable ${of_id} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 688 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Suchitra Vemuri | 0300591 | 2020-02-20 18:59:46 -0800 | [diff] [blame] | 689 | Run Keyword and Ignore Error Collect Logs |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 690 | ${src}= Set Variable ${hosts.src[${I}]} |
| 691 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Suchitra Vemuri | 8078b97 | 2020-02-06 19:07:41 -0800 | [diff] [blame] | 692 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 693 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 694 | # Check ONU port is Enabled in ONOD |
| 695 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
Suchitra Vemuri | 760bdd3 | 2020-06-17 12:34:48 -0700 | [diff] [blame] | 696 | ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Suchitra Vemuri | 8078b97 | 2020-02-06 19:07:41 -0800 | [diff] [blame] | 697 | # Verify EAPOL flows are added for the ONU port |
| 698 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
David K. Bainbridge | c0617c9 | 2020-03-05 21:17:19 -0800 | [diff] [blame] | 699 | ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
Suchitra Vemuri | 8078b97 | 2020-02-06 19:07:41 -0800 | [diff] [blame] | 700 | # Verify ONU state in voltha |
Suchitra Vemuri | d1e27fb | 2020-02-01 16:34:37 -0800 | [diff] [blame] | 701 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
Suchitra Vemuri | 81e4f02 | 2020-02-01 13:16:02 -0800 | [diff] [blame] | 702 | ... ENABLED ACTIVE REACHABLE |
| 703 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
Suchitra Vemuri | 8078b97 | 2020-02-06 19:07:41 -0800 | [diff] [blame] | 704 | # Perform Authentication |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 705 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 706 | ... Validate Authentication After Reassociate |
| 707 | ... True ${src['dp_iface_name']} ${src['ip']} ${src['user']} ${src['pass']} |
| 708 | ... ${src['container_type']} ${src['container_name']} |
| 709 | Wait Until Keyword Succeeds ${timeout} 2s |
David K. Bainbridge | c0617c9 | 2020-03-05 21:17:19 -0800 | [diff] [blame] | 710 | ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 711 | Wait Until Keyword Succeeds ${timeout} 2s |
David K. Bainbridge | c0617c9 | 2020-03-05 21:17:19 -0800 | [diff] [blame] | 712 | ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 713 | ... volt-add-subscriber-access ${of_id} ${onu_port} |
| 714 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 715 | ... Validate DHCP and Ping True True |
| 716 | ... ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 717 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 718 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 719 | ... ${dst['container_name']} |
| 720 | Wait Until Keyword Succeeds ${timeout} 2s Run Keyword And Continue On Failure |
David K. Bainbridge | c0617c9 | 2020-03-05 21:17:19 -0800 | [diff] [blame] | 721 | ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 722 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 723 | Run Keyword and Ignore Error Collect Logs |
| 724 | END |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 725 | |
Hardik Windlass | 16cdf96 | 2020-04-29 15:26:50 +0530 | [diff] [blame] | 726 | Validate ONUs for PON OLT Disable |
| 727 | [Arguments] ${olt_peer_list} |
| 728 | [Documentation] This keyword validates that Ping fails for ONUs connected to Disabled OLT PON port |
| 729 | ... And Pings succeed for other Active OLT PON port ONUs |
| 730 | ... Also it removes subscriber for Disabled OLT PON port ONUs to replicate ATT workflow |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 731 | FOR ${I} IN RANGE 0 ${num_all_nus} |
Hardik Windlass | 16cdf96 | 2020-04-29 15:26:50 +0530 | [diff] [blame] | 732 | ${src}= Set Variable ${hosts.src[${I}]} |
| 733 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 734 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 735 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 736 | ... ${of_id} |
| 737 | ${matched}= Match ONU in PON OLT Peer List ${olt_peer_list} ${onu_device_id} |
| 738 | Run Keyword If ${matched} |
| 739 | ... Run Keywords |
| 740 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 741 | ... Validate Device ENABLED DISCOVERED |
| 742 | ... UNREACHABLE ${src['onu']} onu=True onu_reason=stopping-openomci |
| 743 | ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 744 | ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
| 745 | ... AND Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 746 | ... Wait Until Keyword Succeeds 60s 2s |
| 747 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 748 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} |
| 749 | ... ${src['container_name']} |
| 750 | # Remove Subscriber Access (To replicate ATT workflow) |
| 751 | ... AND Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP} |
| 752 | ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port} |
| 753 | ... ELSE |
| 754 | ... Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 755 | ... Wait Until Keyword Succeeds 60s 2s |
| 756 | ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 757 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} |
| 758 | ... ${src['container_name']} |
| 759 | Run Keyword and Ignore Error Collect Logs |
| 760 | END |
| 761 | |
| 762 | Validate ONUs for PON OLT Enable |
| 763 | [Arguments] ${olt_peer_list} |
| 764 | [Documentation] This keyword validates Ping succeeds for all Enabled/Acitve OLT PON ports |
| 765 | ... Also performs Auth/subscriberAdd/DHCP/Ping for the ONUs on Re-Enabled OLT PON port |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 766 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Hardik Windlass | 16cdf96 | 2020-04-29 15:26:50 +0530 | [diff] [blame] | 767 | ${src}= Set Variable ${hosts.src[${I}]} |
| 768 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 769 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 770 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 771 | ... ${of_id} |
| 772 | ${matched}= Match ONU in PON OLT Peer List ${olt_peer_list} ${onu_device_id} |
| 773 | ${wpa_log}= Run Keyword If ${has_dataplane} and ${matched} Catenate SEPARATOR=. |
| 774 | ... /tmp/wpa ${src['dp_iface_name']} log |
| 775 | Run Keyword If ${matched} |
| 776 | ... Run Keywords |
| 777 | # Perform Cleanup |
| 778 | ... Run Keyword If ${has_dataplane} Clean Up Linux ${onu_device_id} |
| 779 | # Verify ONU port status |
| 780 | ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
| 781 | ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
| 782 | # Verify EAPOL flows are added for the ONU port |
| 783 | ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 784 | ... Verify Eapol Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
| 785 | # Verify ONU state in voltha |
| 786 | ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 787 | ... Validate Device ENABLED ACTIVE REACHABLE |
| 788 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 789 | # Perform Authentication |
| 790 | ... AND Run Keyword If ${has_dataplane} |
| 791 | ... Run Keyword And Continue On Failure Validate Authentication True |
| 792 | ... ${src['dp_iface_name']} wpa_supplicant.conf ${src['ip']} ${src['user']} ${src['pass']} |
| 793 | ... ${src['container_type']} ${src['container_name']} ${wpa_log} |
| 794 | ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2 |
| 795 | ... Verify ONU in AAA-Users ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
| 796 | ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2 |
| 797 | ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 798 | ... volt-add-subscriber-access ${of_id} ${onu_port} |
| 799 | # Verify that no pending flows exist for the ONU port |
| 800 | ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 801 | ... Verify No Pending Flows For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
| 802 | # Verify subscriber access flows are added for the ONU port |
| 803 | ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 804 | ... Verify Subscriber Access Flows Added For ONU ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 805 | ... ${onu_port} ${nni_port} ${src['c_tag']} ${src['s_tag']} |
| 806 | ... AND Run Keyword If ${has_dataplane} |
| 807 | ... Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 808 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 809 | ... ${src['ip']} ${src['user']} ${src['pass']} |
| 810 | ... ${src['container_type']} ${src['container_name']} |
| 811 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} |
| 812 | ... ${dst['container_type']} ${dst['container_name']} |
| 813 | ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 814 | ... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port} |
| 815 | ... AND Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 816 | ... ELSE |
| 817 | ... Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 818 | ... Wait Until Keyword Succeeds 60s 2s |
| 819 | ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 820 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} |
| 821 | ... ${src['container_name']} |
| 822 | Run Keyword and Ignore Error Collect Logs |
| 823 | END |
| 824 | |
| 825 | Validate ONUs for PON OLT Disable DT |
| 826 | [Arguments] ${olt_peer_list} |
| 827 | [Documentation] This keyword validates that Ping fails for ONUs connected to Disabled OLT PON port |
| 828 | ... And Pings succeed for other Active OLT PON port ONUs |
| 829 | ... Also it removes subscriber and deletes ONUs for Disabled OLT PON port to replicate DT workflow |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 830 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Hardik Windlass | 16cdf96 | 2020-04-29 15:26:50 +0530 | [diff] [blame] | 831 | ${src}= Set Variable ${hosts.src[${I}]} |
| 832 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 833 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 834 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 835 | ... ${of_id} |
| 836 | ${matched}= Match ONU in PON OLT Peer List ${olt_peer_list} ${onu_device_id} |
| 837 | Run Keyword If ${matched} |
| 838 | ... Run Keywords |
| 839 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 840 | ... Validate Device ENABLED DISCOVERED |
| 841 | ... UNREACHABLE ${src['onu']} onu=True onu_reason=stopping-openomci |
| 842 | ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 843 | ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
| 844 | ... AND Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 845 | ... Wait Until Keyword Succeeds 60s 2s |
| 846 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 847 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} |
| 848 | ... ${src['container_name']} |
| 849 | # Remove Subscriber Access (To replicate DT workflow) |
| 850 | ... AND Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP} |
| 851 | ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port} |
| 852 | ... AND Sleep 10s |
| 853 | # Delete ONU Device (To replicate DT workflow) |
| 854 | ... AND Delete Device ${onu_device_id} |
| 855 | ... AND Sleep 5s |
| 856 | ... ELSE |
| 857 | ... Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 858 | ... Wait Until Keyword Succeeds 60s 2s |
| 859 | ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 860 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} |
| 861 | ... ${src['container_name']} |
| 862 | Run Keyword and Ignore Error Collect Logs |
| 863 | END |
| 864 | |
| 865 | Validate ONUs for PON OLT Enable DT |
| 866 | [Arguments] ${olt_peer_list} |
| 867 | [Documentation] This keyword validates Ping succeeds for all Enabled/Acitve OLT PON ports |
| 868 | ... Also performs subscriberAdd/DHCP/Ping for the ONUs on Re-Enabled OLT PON port |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 869 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Hardik Windlass | 16cdf96 | 2020-04-29 15:26:50 +0530 | [diff] [blame] | 870 | ${src}= Set Variable ${hosts.src[${I}]} |
| 871 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 872 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 873 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 874 | ... ${of_id} |
| 875 | ${matched}= Match ONU in PON OLT Peer List ${olt_peer_list} ${onu_device_id} |
| 876 | Run Keyword If ${matched} |
| 877 | ... Run Keywords |
| 878 | # Perform Cleanup |
| 879 | ... Run Keyword If ${has_dataplane} Clean Up Linux ${onu_device_id} |
| 880 | # Verify ONU port status |
| 881 | ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds 120s 2s |
| 882 | ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
| 883 | ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2 |
| 884 | ... Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 885 | ... volt-add-subscriber-access ${of_id} ${onu_port} |
| 886 | # Verify ONU state in voltha |
| 887 | ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 888 | ... Validate Device ENABLED ACTIVE REACHABLE |
| 889 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 890 | # Verify subscriber access flows are added for the ONU port |
| 891 | ... AND Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 892 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 893 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
| 894 | ... AND Run Keyword If ${has_dataplane} |
| 895 | ... Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 896 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 897 | ... ${src['ip']} ${src['user']} ${src['pass']} |
| 898 | ... ${src['container_type']} ${src['container_name']} |
| 899 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} |
| 900 | ... ${dst['container_type']} ${dst['container_name']} |
| 901 | ... ELSE |
| 902 | ... Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 903 | ... Wait Until Keyword Succeeds 60s 2s |
| 904 | ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 905 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} |
| 906 | ... ${src['container_name']} |
| 907 | Run Keyword and Ignore Error Collect Logs |
| 908 | END |
| 909 | |
| 910 | Match ONU in PON OLT Peer List |
| 911 | [Arguments] ${olt_peer_list} ${onu_device_id} |
| 912 | [Documentation] This keyword matches if ONU device is present in OLT PON port peer list |
| 913 | ${matched}= Set Variable False |
| 914 | FOR ${olt_peer} IN @{olt_peer_list} |
| 915 | ${matched}= Set Variable If '${onu_device_id}' == '${olt_peer}' True False |
| 916 | Exit For Loop If ${matched} |
| 917 | END |
| 918 | [Return] ${matched} |
| 919 | |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 920 | Collect Logs |
| 921 | [Documentation] Collect Logs from voltha and onos cli for various commands |
| 922 | Run Keyword and Ignore Error Get Device List from Voltha |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 923 | FOR ${I} IN RANGE 0 ${num_olts} |
| 924 | Run Keyword and Ignore Error Get Logical Device Output from Voltha ${logical_id} |
| 925 | Run Keyword and Ignore Error Get Device Output from Voltha ${olt_ids}[${I}][device_id] |
| 926 | Run Keyword and Ignore Error Get Logical Device Output from Voltha ${olt_ids}[${I}][logical_id] |
| 927 | END |
| 928 | #Run Keyword and Ignore Error Get Device Output from Voltha ${olt_device_id} |
| 929 | #Run Keyword and Ignore Error Get Logical Device Output from Voltha ${logical_id} |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 930 | Get ONOS Status ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Gayathri.Selvan | f68ea4b | 2020-02-03 07:36:39 +0000 | [diff] [blame] | 931 | |
| 932 | Verify ping is succesful except for given device |
| 933 | [Arguments] ${num_onus} ${exceptional_onu_id} |
| 934 | [Documentation] Checks that ping for all the devices are successful except the given ONU. |
| 935 | ${pingStatus} Set Variable True |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 936 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Gayathri.Selvan | f68ea4b | 2020-02-03 07:36:39 +0000 | [diff] [blame] | 937 | ${src}= Set Variable ${hosts.src[${I}]} |
| 938 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 939 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 940 | ${pingStatus} Run Keyword If '${onu_device_id}' == '${exceptional_onu_id}' Set Variable False |
Suchitra Vemuri | 69bcad2 | 2020-12-09 11:11:14 -0800 | [diff] [blame] | 941 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 942 | ... Wait Until Keyword Succeeds 60s 2s |
Gayathri.Selvan | f68ea4b | 2020-02-03 07:36:39 +0000 | [diff] [blame] | 943 | ... Check Ping ${pingStatus} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 944 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 945 | END |
Andy Bavier | 4a8450e | 2020-02-04 08:58:37 -0700 | [diff] [blame] | 946 | |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 947 | Verify ping is successful for ONUs not on this OLT |
| 948 | [Arguments] ${num_all_onus} ${exceptional_olt_id} |
| 949 | [Documentation] Checks that pings work for all the ONUs except for the ONUs on the given OLT. |
| 950 | #${pingStatus} Set Variable True |
| 951 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 952 | ${src}= Set Variable ${hosts.src[${I}]} |
| 953 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 954 | ${olt_device_id}= Get Device ID From SN ${src['olt']} |
| 955 | Continue For Loop If "${olt_device_id}"=="${exceptional_olt_id}" |
| 956 | #${pingStatus} Run Keyword If '${olt_device_id}' == '${exceptional_olt_id}' Set Variable False |
Suchitra Vemuri | 69bcad2 | 2020-12-09 11:11:14 -0800 | [diff] [blame] | 957 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 958 | ... Wait Until Keyword Succeeds 60s 2s |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 959 | ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 960 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 961 | END |
| 962 | |
Andy Bavier | 1923ecc | 2020-06-18 14:06:40 -0700 | [diff] [blame] | 963 | Echo Message to OLT Logs |
| 964 | [Arguments] ${message} |
| 965 | [Documentation] Echoes ${message} into the OLT logs |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 966 | FOR ${I} IN RANGE 0 ${num_olts} |
| 967 | ${olt_user} Evaluate ${olts}[${I}].get("user") |
| 968 | ${olt_pass} Evaluate ${olts}[${I}].get("pass") |
| 969 | ${olt_ssh_ip} Evaluate ${olts}[${I}].get("sship") |
Andrea Campanella | 366ed46 | 2021-01-12 13:10:29 +0100 | [diff] [blame] | 970 | Continue For Loop If "${olt_user}" == "${None}" |
| 971 | Continue For Loop If "${olt_pass}" == "${None}" |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 972 | Wait Until Keyword Succeeds 180s 10s Execute Remote Command |
| 973 | ... printf '%s\n' '' '' '${message}' '' >> /var/log/openolt.log |
| 974 | ... ${olt_ssh_ip} ${olt_user} ${olt_pass} |
| 975 | Wait Until Keyword Succeeds 180s 10s Execute Remote Command |
| 976 | ... printf '%s\n' '' '' '${message}' '' >> /var/log/dev_mgmt_daemon.log |
| 977 | ... ${olt_ssh_ip} ${olt_user} ${olt_pass} |
| 978 | Wait Until Keyword Succeeds 180s 10s Execute Remote Command |
| 979 | ... printf '%s\n' '' '' '${message}' '' >> /var/log/openolt_process_watchdog.log |
| 980 | ... ${olt_ssh_ip} ${olt_user} ${olt_pass} |
| 981 | END |
Andy Bavier | 1923ecc | 2020-06-18 14:06:40 -0700 | [diff] [blame] | 982 | |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 983 | Start Logging |
| 984 | [Arguments] ${label} |
| 985 | [Documentation] Start logging for test ${label} |
| 986 | ${kail_process}= Run Keyword If "${container_log_dir}" != "${None}" Start Process kail -n default |
| 987 | ... -n voltha cwd=${container_log_dir} stdout=${label}-combined.log |
| 988 | Set Test Variable ${kail_process} |
Andy Bavier | 1923ecc | 2020-06-18 14:06:40 -0700 | [diff] [blame] | 989 | Run Keyword If ${has_dataplane} Echo Message to OLT Logs START ${label} |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 990 | |
| 991 | Stop Logging |
| 992 | [Arguments] ${label} |
| 993 | [Documentation] End logging for test; remove logfile if test passed |
| 994 | Run sync |
| 995 | Run Keyword If ${kail_process} Terminate Process ${kail_process} |
| 996 | ${test_logfile}= Run Keyword If "${container_log_dir}" != "${None}" |
| 997 | ... Join Path ${container_log_dir} ${label}-combined.log |
| 998 | Run Keyword If Test Passed Run Keyword If "${test_logfile}" != "${None}" Remove File ${test_logfile} |
Andy Bavier | 1923ecc | 2020-06-18 14:06:40 -0700 | [diff] [blame] | 999 | Run Keyword If ${has_dataplane} Echo Message to OLT Logs END ${label} |
Andy Bavier | abeba26 | 2020-02-07 16:22:16 -0700 | [diff] [blame] | 1000 | |
Suchitra Vemuri | a5fa3dd | 2020-02-04 14:38:49 -0800 | [diff] [blame] | 1001 | Clean Up Linux |
| 1002 | [Documentation] Kill processes and clean up interfaces on src+dst servers |
Hardik Windlass | 16cdf96 | 2020-04-29 15:26:50 +0530 | [diff] [blame] | 1003 | [Arguments] ${onu_id}=${EMPTY} |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 1004 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Suchitra Vemuri | a5fa3dd | 2020-02-04 14:38:49 -0800 | [diff] [blame] | 1005 | ${src}= Set Variable ${hosts.src[${I}]} |
| 1006 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Hardik Windlass | 16cdf96 | 2020-04-29 15:26:50 +0530 | [diff] [blame] | 1007 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 1008 | Continue For Loop If '${onu_id}' != '${EMPTY}' and '${onu_id}' != '${onu_device_id}' |
Andy Bavier | 84b8328 | 2020-06-30 05:47:49 -0700 | [diff] [blame] | 1009 | Execute Remote Command sudo pkill wpa_supplicant ${src['ip']} |
Suchitra Vemuri | a5fa3dd | 2020-02-04 14:38:49 -0800 | [diff] [blame] | 1010 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Andy Bavier | 84b8328 | 2020-06-30 05:47:49 -0700 | [diff] [blame] | 1011 | Execute Remote Command sudo pkill dhclient ${src['ip']} |
Suchitra Vemuri | a5fa3dd | 2020-02-04 14:38:49 -0800 | [diff] [blame] | 1012 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Andy Bavier | eff938d | 2020-06-29 18:27:49 -0700 | [diff] [blame] | 1013 | Execute Remote Command sudo pkill mausezahn ${src['ip']} |
| 1014 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 1015 | Run Keyword If '${dst['ip']}' != '${None}' Execute Remote Command pkill dhcpd |
| 1016 | ... ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} ${dst['container_name']} |
Suchitra Vemuri | a5fa3dd | 2020-02-04 14:38:49 -0800 | [diff] [blame] | 1017 | Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']} |
| 1018 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 1019 | Run Keyword If '${dst['ip']}' != '${None}' Delete Interface on Remote Host |
| 1020 | ... ${dst['dp_iface_name']}.${src['s_tag']} ${dst['ip']} ${dst['user']} ${dst['pass']} |
| 1021 | ... ${dst['container_type']} ${dst['container_name']} |
Andy Bavier | 84b8328 | 2020-06-30 05:47:49 -0700 | [diff] [blame] | 1022 | ${bng_ip}= Get Variable Value ${dst['noroot_ip']} |
| 1023 | ${bng_user}= Get Variable Value ${dst['noroot_user']} |
| 1024 | ${bng_pass}= Get Variable Value ${dst['noroot_pass']} |
Andy Bavier | f4b7d1d | 2020-06-30 11:14:04 -0700 | [diff] [blame] | 1025 | Run Keyword If "${bng_ip}" != "${NONE}" and "${bng_user}" != "${NONE}" and "${bng_pass}" != "${NONE}" |
| 1026 | ... Execute Remote Command sudo pkill mausezahn ${bng_ip} ${bng_user} ${bng_pass} |
Andy Bavier | eff938d | 2020-06-29 18:27:49 -0700 | [diff] [blame] | 1027 | ... ${dst['container_type']} ${dst['container_name']} |
Suchitra Vemuri | a5fa3dd | 2020-02-04 14:38:49 -0800 | [diff] [blame] | 1028 | END |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 1029 | |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 1030 | Clean Up Linux Per OLT |
| 1031 | [Documentation] Kill processes and clean up interfaces on src+dst servers |
| 1032 | [Arguments] ${olt_serial_number} |
| 1033 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 1034 | ${src}= Set Variable ${hosts.src[${I}]} |
| 1035 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 1036 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 1037 | ${sn}= Get Device ID From SN ${src['olt']} |
| 1038 | #Continue For Loop If '${onu_id}' != '${EMPTY}' and '${onu_id}' != '${onu_device_id}' |
| 1039 | Continue For Loop If '${olt_serial_number}' == '${sn}' |
| 1040 | Execute Remote Command sudo pkill wpa_supplicant ${src['ip']} |
| 1041 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 1042 | Execute Remote Command sudo pkill dhclient ${src['ip']} |
| 1043 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 1044 | Execute Remote Command sudo pkill mausezahn ${src['ip']} |
| 1045 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 1046 | Run Keyword If '${dst['ip']}' != '${None}' Execute Remote Command pkill dhcpd |
| 1047 | ... ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} ${dst['container_name']} |
| 1048 | Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']} |
| 1049 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 1050 | Run Keyword If '${dst['ip']}' != '${None}' Delete Interface on Remote Host |
| 1051 | ... ${dst['dp_iface_name']}.${src['s_tag']} ${dst['ip']} ${dst['user']} ${dst['pass']} |
| 1052 | ... ${dst['container_type']} ${dst['container_name']} |
| 1053 | ${bng_ip}= Get Variable Value ${dst['noroot_ip']} |
| 1054 | ${bng_user}= Get Variable Value ${dst['noroot_user']} |
| 1055 | ${bng_pass}= Get Variable Value ${dst['noroot_pass']} |
| 1056 | Run Keyword If "${bng_ip}" != "${NONE}" and "${bng_user}" != "${NONE}" and "${bng_pass}" != "${NONE}" |
| 1057 | ... Execute Remote Command sudo pkill mausezahn ${bng_ip} ${bng_user} ${bng_pass} |
| 1058 | ... ${dst['container_type']} ${dst['container_name']} |
| 1059 | END |
| 1060 | |
Suchitra Vemuri | 8d3b003 | 2020-09-11 17:49:08 -0700 | [diff] [blame] | 1061 | Clean dhclient |
| 1062 | [Documentation] Kills dhclient processes only for all RGs |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 1063 | FOR ${I} IN RANGE 0 ${num_all_nus} |
Suchitra Vemuri | 8d3b003 | 2020-09-11 17:49:08 -0700 | [diff] [blame] | 1064 | ${src}= Set Variable ${hosts.src[${I}]} |
| 1065 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 1066 | Execute Remote Command sudo pkill dhclient ${src['ip']} |
| 1067 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 1068 | END |
| 1069 | |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 1070 | Clean WPA Process |
| 1071 | [Documentation] Kills wpa_supplicant processes only for all RGs |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 1072 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Suchitra Vemuri | f7a033c | 2020-02-26 17:22:41 -0800 | [diff] [blame] | 1073 | ${src}= Set Variable ${hosts.src[${I}]} |
| 1074 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 1075 | Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']} |
| 1076 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 1077 | END |
| 1078 | |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 1079 | Should Be Larger Than |
| 1080 | [Documentation] Verify that value_1 is > value_2 |
| 1081 | [Arguments] ${value_1} ${value_2} |
| 1082 | Run Keyword If ${value_1} <= ${value_2} |
| 1083 | ... Fail The value ${value_1} is not larger than ${value_2} |
| 1084 | |
Scott Baker | ee67555 | 2020-02-11 10:43:34 -0800 | [diff] [blame] | 1085 | Should Be Larger Than Or Equal To |
| 1086 | [Documentation] Verify that value_1 is >= value_2 |
| 1087 | [Arguments] ${value_1} ${value_2} |
| 1088 | Run Keyword If ${value_1} < ${value_2} |
| 1089 | ... Fail The value ${value_1} is not larger than or equal to ${value_2} |
| 1090 | |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 1091 | Should Be Float |
| 1092 | [Documentation] Verify that value is a floating point number type |
| 1093 | [Arguments] ${value} |
| 1094 | ${type} Evaluate type(${value}).__name__ |
| 1095 | Should Be Equal ${type} float |
| 1096 | |
Scott Baker | ee67555 | 2020-02-11 10:43:34 -0800 | [diff] [blame] | 1097 | Should Be Newer Than Or Equal To |
| 1098 | [Documentation] Compare two RFC3339 dates |
| 1099 | [Arguments] ${value_1} ${value_2} |
| 1100 | ${unix_v1} Parse RFC3339 ${value_1} |
| 1101 | ${unix_v2} Parse RFC3339 ${value_2} |
| 1102 | Run Keyword If ${unix_v1} < ${unix_v2} |
| 1103 | ... Fail The value ${value_1} is not newer than or equal to ${value_2} |
| 1104 | |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 1105 | Get Current Time |
| 1106 | [Documentation] Return the current time in RFC3339 format |
| 1107 | ${output}= Run date -u +"%FT%T%:z" |
| 1108 | [return] ${output} |
Scott Baker | ee67555 | 2020-02-11 10:43:34 -0800 | [diff] [blame] | 1109 | |
| 1110 | Parse RFC3339 |
| 1111 | [Documentation] Parse an RFC3339 timestamp |
| 1112 | [Arguments] ${dateStr} |
| 1113 | ${rc} ${output}= Run and Return Rc and Output date --date="${dateStr}" "+%s" |
| 1114 | Should Be Equal As Numbers ${rc} 0 |
| 1115 | [return] ${output} |
Matteo Scandolo | 142e627 | 2020-04-29 17:36:59 -0700 | [diff] [blame] | 1116 | |
Gayathri.Selvan | 92d1686 | 2020-03-19 14:47:58 +0000 | [diff] [blame] | 1117 | Get Bandwidth Profile Name For Given Subscriber |
| 1118 | [Arguments] ${subscriber_id} ${stream_type}=upstreamBandwidthProfile |
| 1119 | [Documentation] Keyword to get the bandwidth details of the given subscriber |
| 1120 | ${bandwidth_profile_output}= Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 1121 | ... volt-programmed-subscribers | grep ${subscriber_id} |
| 1122 | @{bandwidth_profile_array}= Split String ${bandwidth_profile_output} , |
| 1123 | Log ${bandwidth_profile_array} |
| 1124 | FOR ${value} IN @{bandwidth_profile_array} |
| 1125 | @{row_value}= Split String ${value} = |
| 1126 | ${bandwidth_profile_name}= Set Variable If '${row_value[0]}' == ' ${stream_type}' |
| 1127 | ... ${row_value[1]} |
| 1128 | ${bandwidth_profile_name}= Convert To String ${bandwidth_profile_name} |
| 1129 | Run Keyword If "${bandwidth_profile_name}" != "None" Exit For Loop |
| 1130 | END |
| 1131 | Log ${bandwidth_profile_name} |
| 1132 | [Return] ${bandwidth_profile_name} |
| 1133 | |
| 1134 | Execute Remote Command |
| 1135 | [Documentation] SSH into a remote host and execute a command on the bare host or in a container. |
| 1136 | ... This replaces and simplifies the Login And Run Command On Remote System keyword in CORDRobot. |
| 1137 | [Arguments] ${cmd} ${ip} ${user} ${pass}=${None} |
Andy Bavier | eff938d | 2020-06-29 18:27:49 -0700 | [diff] [blame] | 1138 | ... ${container_type}=${None} ${container_name}=${None} ${timeout}=${None} |
Gayathri.Selvan | 92d1686 | 2020-03-19 14:47:58 +0000 | [diff] [blame] | 1139 | ${conn_id}= SSHLibrary.Open Connection ${ip} |
| 1140 | Run Keyword If '${pass}' != '${None}' |
| 1141 | ... SSHLibrary.Login ${user} ${pass} |
| 1142 | ... ELSE |
| 1143 | ... SSHLibrary.Login With Public Key ${user} %{HOME}/.ssh/id_rsa |
| 1144 | ${namespace}= Run Keyword If '${container_type}' == 'K8S' SSHLibrary.Execute Command |
| 1145 | ... kubectl get pods --all-namespaces | grep ${container_name} | awk '{print $1}' |
Andy Bavier | f6ab19c | 2020-05-14 10:34:47 -0700 | [diff] [blame] | 1146 | ${stdout} ${stderr} ${rc}= Run Keyword If '${container_type}' == 'LXC' |
| 1147 | ... SSHLibrary.Execute Command lxc exec ${container_name} -- ${cmd} |
Andy Bavier | eff938d | 2020-06-29 18:27:49 -0700 | [diff] [blame] | 1148 | ... return_stderr=True return_rc=True timeout=${timeout} |
Gayathri.Selvan | 92d1686 | 2020-03-19 14:47:58 +0000 | [diff] [blame] | 1149 | ... ELSE IF '${container_type}' == 'K8S' |
Andy Bavier | f6ab19c | 2020-05-14 10:34:47 -0700 | [diff] [blame] | 1150 | ... SSHLibrary.Execute Command kubectl -n ${namespace} exec ${container_name} -- ${cmd} |
Andy Bavier | eff938d | 2020-06-29 18:27:49 -0700 | [diff] [blame] | 1151 | ... return_stderr=True return_rc=True timeout=${timeout} |
Gayathri.Selvan | 92d1686 | 2020-03-19 14:47:58 +0000 | [diff] [blame] | 1152 | ... ELSE |
Andy Bavier | eff938d | 2020-06-29 18:27:49 -0700 | [diff] [blame] | 1153 | ... SSHLibrary.Execute Command ${cmd} return_stderr=True return_rc=True timeout=${timeout} |
Andy Bavier | f6ab19c | 2020-05-14 10:34:47 -0700 | [diff] [blame] | 1154 | |
| 1155 | Log ${stdout} |
| 1156 | Log ${stderr} |
| 1157 | Log ${rc} |
Gayathri.Selvan | 92d1686 | 2020-03-19 14:47:58 +0000 | [diff] [blame] | 1158 | SSHLibrary.Close Connection |
Andy Bavier | f6ab19c | 2020-05-14 10:34:47 -0700 | [diff] [blame] | 1159 | [Return] ${stdout} ${stderr} ${rc} |
Gayathri.Selvan | 92d1686 | 2020-03-19 14:47:58 +0000 | [diff] [blame] | 1160 | |
Suraj Gour | 3365127 | 2020-05-04 10:10:16 +0530 | [diff] [blame] | 1161 | Start Remote Command |
| 1162 | [Documentation] SSH into a remote host and execute a command on the bare host or in a container. |
| 1163 | ... This replaces and simplifies the Login And Run Command On Remote System keyword in CORDRobot. |
| 1164 | [Arguments] ${cmd} ${ip} ${user} ${pass}=${None} |
| 1165 | ... ${container_type}=${None} ${container_name}=${None} |
| 1166 | ${conn_id}= SSHLibrary.Open Connection ${ip} |
| 1167 | Run Keyword If '${pass}' != '${None}' |
| 1168 | ... SSHLibrary.Login ${user} ${pass} |
| 1169 | ... ELSE |
| 1170 | ... SSHLibrary.Login With Public Key ${user} %{HOME}/.ssh/id_rsa |
| 1171 | ${namespace}= Run Keyword If '${container_type}' == 'K8S' SSHLibrary.Execute Command |
| 1172 | ... kubectl get pods --all-namespaces | grep ${container_name} | awk '{print $1}' |
| 1173 | Run Keyword If '${container_type}' == 'LXC' |
| 1174 | ... SSHLibrary.Start Command lxc exec ${container_name} -- ${cmd} |
| 1175 | ... ELSE IF '${container_type}' == 'K8S' |
| 1176 | ... SSHLibrary.Start Command kubectl -n ${namespace} exec ${container_name} -- ${cmd} |
| 1177 | ... ELSE |
| 1178 | ... SSHLibrary.Start Command ${cmd} |
Andy Bavier | 9fb2323 | 2020-06-30 15:12:20 -0700 | [diff] [blame] | 1179 | # It seems that closing the connection immediately will sometimes kill the command |
| 1180 | Sleep 1s |
Suraj Gour | 3365127 | 2020-05-04 10:10:16 +0530 | [diff] [blame] | 1181 | SSHLibrary.Close Connection |
| 1182 | |
Gayathri.Selvan | 92d1686 | 2020-03-19 14:47:58 +0000 | [diff] [blame] | 1183 | Run Iperf3 Test Client |
| 1184 | [Arguments] ${src} ${server} ${args} |
| 1185 | [Documentation] Login to ${src} and run the iperf3 client against ${server} using ${args}. |
| 1186 | ... Return a Dictionary containing the results of the test. |
Andy Bavier | f6ab19c | 2020-05-14 10:34:47 -0700 | [diff] [blame] | 1187 | ${output} ${stderr} ${rc}= Execute Remote Command iperf3 -J -c ${server} ${args} | jq -M -c '.' |
Gayathri.Selvan | 92d1686 | 2020-03-19 14:47:58 +0000 | [diff] [blame] | 1188 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Andy Bavier | f6ab19c | 2020-05-14 10:34:47 -0700 | [diff] [blame] | 1189 | Should Be Equal As Integers ${rc} 0 |
Gayathri.Selvan | 92d1686 | 2020-03-19 14:47:58 +0000 | [diff] [blame] | 1190 | ${object}= Evaluate json.loads(r'''${output}''') json |
| 1191 | [Return] ${object} |
Hung-Wei Chiu | e0bec7c | 2020-05-29 22:16:56 +0000 | [diff] [blame] | 1192 | |
Suchitra Vemuri | 85cb7d6 | 2020-07-16 23:46:16 -0700 | [diff] [blame] | 1193 | Run Iperf Test Client for MCAST |
| 1194 | [Arguments] ${src} ${server} ${args} |
| 1195 | [Documentation] Login to ${src} and run the iperf client against ${server} using ${args}. |
| 1196 | ... Return a Dictionary containing the results of the test. |
| 1197 | ${output} ${stderr} ${rc}= Execute Remote Command sudo iperf -c ${server} ${args} | jq -M -c '.' |
| 1198 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 1199 | Should Be Equal As Integers ${rc} 0 |
| 1200 | ${object}= Evaluate json.loads(r'''${output}''') json |
| 1201 | [Return] ${object} |
| 1202 | |
Hung-Wei Chiu | e0bec7c | 2020-05-29 22:16:56 +0000 | [diff] [blame] | 1203 | RestoreONUs |
| 1204 | [Documentation] Restore all connected ONUs |
Suchitra Vemuri | a6879aa | 2020-11-03 11:03:11 -0800 | [diff] [blame] | 1205 | [Arguments] ${num_all_onus} |
| 1206 | FOR ${I} IN RANGE 0 ${num_all_onus} |
Hung-Wei Chiu | e0bec7c | 2020-05-29 22:16:56 +0000 | [diff] [blame] | 1207 | ${src}= Set Variable ${hosts.src[${I}]} |
Hung-Wei Chiu | cc6e655 | 2020-06-04 12:57:38 -0700 | [diff] [blame] | 1208 | ${container_type}= Get Variable Value ${src['container_type']} "null" |
| 1209 | ${container_name}= Get Variable Value ${src['container_name']} "null" |
Hung-Wei Chiu | e0bec7c | 2020-05-29 22:16:56 +0000 | [diff] [blame] | 1210 | ${onu_type}= Get Variable Value ${src['onu_type']} "null" |
Hung-Wei Chiu | cc6e655 | 2020-06-04 12:57:38 -0700 | [diff] [blame] | 1211 | #Get ens6f0 from ens6f0.22 |
| 1212 | ${if_name}= Replace String Using Regexp ${src['dp_iface_name']} \\..* \ |
Hung-Wei Chiu | e0bec7c | 2020-05-29 22:16:56 +0000 | [diff] [blame] | 1213 | Run Keyword IF '${onu_type}' == 'alpha' AlphaONURestoreDefault ${src['ip']} ${src['user']} |
Hung-Wei Chiu | cc6e655 | 2020-06-04 12:57:38 -0700 | [diff] [blame] | 1214 | ... ${src['pass']} ${if_name} admin admin ${container_type} ${container_name} |
Hung-Wei Chiu | e0bec7c | 2020-05-29 22:16:56 +0000 | [diff] [blame] | 1215 | END |
| 1216 | |
| 1217 | AlphaONURestoreDefault |
| 1218 | [Documentation] Restore the Alpha ONU to factory setting |
| 1219 | [Arguments] ${rg_ip} ${rg_user} ${rg_pass} ${onu_ifname} |
Hung-Wei Chiu | cc6e655 | 2020-06-04 12:57:38 -0700 | [diff] [blame] | 1220 | ... ${onu_user} ${onu_pass} ${container_type}=${None} ${container_name}=${None} |
Hung-Wei Chiu | e0bec7c | 2020-05-29 22:16:56 +0000 | [diff] [blame] | 1221 | ${output}= Login And Run Command On Remote System sudo ifconfig ${onu_ifname} 192.168.1.3/24 |
Hung-Wei Chiu | cc6e655 | 2020-06-04 12:57:38 -0700 | [diff] [blame] | 1222 | ... ${rg_ip} ${rg_user} ${rg_pass} ${container_type} ${container_name} |
Hung-Wei Chiu | e0bec7c | 2020-05-29 22:16:56 +0000 | [diff] [blame] | 1223 | ${cmd} Catenate |
| 1224 | ... (echo open "192.168.1.1"; sleep 1; |
| 1225 | ... echo "${onu_user}"; sleep 1; |
| 1226 | ... echo "${onu_pass}"; sleep 1; |
| 1227 | ... echo "restoredefault"; sleep 1) | telnet |
| 1228 | ${output}= Login And Run Command On Remote System ${cmd} |
Hung-Wei Chiu | cc6e655 | 2020-06-04 12:57:38 -0700 | [diff] [blame] | 1229 | ... ${rg_ip} ${rg_user} ${rg_pass} ${container_type} ${container_name} |
Hung-Wei Chiu | e0bec7c | 2020-05-29 22:16:56 +0000 | [diff] [blame] | 1230 | Log To Console ${output} |
| 1231 | ${output}= Login And Run Command On Remote System sudo ifconfig ${onu_ifname} 0 |
Hung-Wei Chiu | cc6e655 | 2020-06-04 12:57:38 -0700 | [diff] [blame] | 1232 | ... ${rg_ip} ${rg_user} ${rg_pass} ${container_type} ${container_name} |
Suraj Gour | 3365127 | 2020-05-04 10:10:16 +0530 | [diff] [blame] | 1233 | |
| 1234 | Create traffic with each pbit and capture at other end |
| 1235 | [Documentation] Generates upstream traffic using Mausezahn tool |
| 1236 | ... with each pbit and validates reception at other end using tcpdump |
| 1237 | [Arguments] ${target_ip} ${target_iface} ${src_iface} |
| 1238 | ... ${packet_count} ${packet_type} ${target_port} ${vlan} ${tcpdump_filter} |
| 1239 | ... ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name} |
| 1240 | ... ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} |
| 1241 | FOR ${pbit} IN RANGE 8 |
Andy Bavier | eff938d | 2020-06-29 18:27:49 -0700 | [diff] [blame] | 1242 | Execute Remote Command sudo pkill mausezahn |
Suraj Gour | 3365127 | 2020-05-04 10:10:16 +0530 | [diff] [blame] | 1243 | ... ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} |
Andy Bavier | eff938d | 2020-06-29 18:27:49 -0700 | [diff] [blame] | 1244 | ${var1}= Set Variable sudo mausezahn ${src_iface} -B ${target_ip} -c ${packet_count} -d 100m |
Suraj Gour | 3365127 | 2020-05-04 10:10:16 +0530 | [diff] [blame] | 1245 | ${var2}= Set Variable -t ${packet_type} "dp=${target_port}" -p 1472 -Q ${pbit}:${vlan} |
| 1246 | ${cmd}= Set Variable ${var1} ${var2} |
| 1247 | Start Remote Command ${cmd} ${src_ip} ${src_user} ${src_pass} |
| 1248 | ... ${src_container_type} ${src_container_name} |
| 1249 | ${output} ${stderr} ${rc}= Execute Remote Command |
Andy Bavier | eff938d | 2020-06-29 18:27:49 -0700 | [diff] [blame] | 1250 | ... sudo tcpdump -l -U -c 30 -i ${target_iface} -e ${tcpdump_filter} |
Suraj Gour | 3365127 | 2020-05-04 10:10:16 +0530 | [diff] [blame] | 1251 | ... ${dst_ip} ${dst_user} ${dst_pass} ${dst_container_type} ${dst_container_name} |
Andy Bavier | eff938d | 2020-06-29 18:27:49 -0700 | [diff] [blame] | 1252 | ... timeout=30 seconds |
| 1253 | Execute Remote Command sudo pkill mausezahn |
Suraj Gour | 3365127 | 2020-05-04 10:10:16 +0530 | [diff] [blame] | 1254 | ... ${src_ip} ${src_user} ${src_pass} ${src_container_type} ${src_container_name} |
| 1255 | # VOL-3262: I'm seeing untagged downstream traffic at RG for pbit 0. According to Girish this is |
| 1256 | # incorrect behavior. Simplify the following check when VOL-3262 is resolved. |
| 1257 | Run Keyword If ${pbit}==0 and "${tcpdump_filter}"=="udp" |
| 1258 | ... Should Match Regexp ${output} \\.${target_port}: UDP, |
| 1259 | ... ELSE Should Match Regexp ${output} , p ${pbit},.*\\.${target_port}: UDP, |
| 1260 | END |