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