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