TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 1 | # Copyright 2021 - 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. |
| 14 | # FIXME Can we use the same test against BBSim and Hardware? |
| 15 | |
| 16 | *** Settings *** |
| 17 | Documentation Test various functional end-to-end scenarios for TT workflow |
| 18 | Suite Setup Setup Suite |
| 19 | Test Setup Setup |
| 20 | Test Teardown Teardown |
| 21 | Suite Teardown Teardown Suite |
| 22 | Library Collections |
| 23 | Library String |
| 24 | Library OperatingSystem |
| 25 | Library XML |
| 26 | Library RequestsLibrary |
| 27 | Library ../../libraries/DependencyLibrary.py |
| 28 | Resource ../../libraries/onos.robot |
| 29 | Resource ../../libraries/voltctl.robot |
| 30 | Resource ../../libraries/voltha.robot |
| 31 | Resource ../../libraries/utils.robot |
| 32 | Resource ../../libraries/k8s.robot |
| 33 | Resource ../../variables/variables.robot |
| 34 | Resource ../../libraries/power_switch.robot |
| 35 | |
| 36 | *** Variables *** |
| 37 | ${POD_NAME} flex-ocp-cord |
| 38 | ${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 39 | ${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs |
| 40 | #${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 41 | ${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml |
| 42 | ${HELM_CHARTS_DIR} ~/helm-charts |
| 43 | ${VOLTHA_POD_NUM} 8 |
| 44 | ${NAMESPACE} voltha |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 45 | ${INFRA_NAMESPACE} default |
Matteo Scandolo | a4e5952 | 2021-08-31 14:56:24 -0700 | [diff] [blame] | 46 | ${STACK_NAME} voltha |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 47 | # For below variable value, using deployment name as using grep for |
| 48 | # parsing radius pod name, we can also use full radius pod name |
| 49 | ${RESTART_POD_NAME} radius |
| 50 | ${timeout} 60s |
| 51 | ${of_id} 0 |
| 52 | ${logical_id} 0 |
| 53 | ${has_dataplane} True |
Hardik Windlass | 04896f6 | 2021-03-05 16:15:11 +0530 | [diff] [blame] | 54 | ${teardown_device} True |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 55 | ${scripts} ../../scripts |
| 56 | |
| 57 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 58 | ${container_log_dir} ${None} |
| 59 | |
Matteo Scandolo | da1c64b | 2021-07-20 10:14:49 -0700 | [diff] [blame] | 60 | # logging flag to enable Collect Logs, can be passed via the command line too |
| 61 | # example: -v logging:False |
| 62 | ${logging} True |
| 63 | |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 64 | ${suppressaddsubscriber} True |
| 65 | |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 66 | # flag to choose the subscriber provisioning command type in ONOS |
| 67 | # TT often provision a single services for a subscriber (eg: hsia, voip, ...) one after the other. |
| 68 | # if set to True, command used is "volt-add-subscriber-unitag" |
| 69 | # if set to False, comand used is "volt-add-subscriber-access" |
| 70 | ${unitag_sub} False |
| 71 | |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 72 | *** Test Cases *** |
Hardik Windlass | 364ec45 | 2021-04-14 07:12:28 +0000 | [diff] [blame] | 73 | Verify ONU after Rebooting Physically for TT |
| 74 | [Documentation] Test the ONU functionality by physically turning on/off ONU. |
| 75 | ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityTT test was executed) |
| 76 | ... Test case runs only on the PODs that are configured with PowerSwitch that |
| 77 | ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot) |
| 78 | [Tags] functionalTT PowerSwitchOnuRebootTT PowerSwitch |
| 79 | [Setup] Start Logging RebootOnu_PowerSwitch_TT |
| 80 | [Teardown] Run Keywords Collect Logs |
Hardik Windlass | 364ec45 | 2021-04-14 07:12:28 +0000 | [diff] [blame] | 81 | ... AND Delete All Devices and Verify |
Girish Gowdra | f244d5b | 2021-09-01 17:16:16 -0700 | [diff] [blame] | 82 | ... AND Run Keyword If ${logging} Collect Logs |
| 83 | ... AND Stop Logging RebootOnu_PowerSwitch_TT |
Hardik Windlass | 364ec45 | 2021-04-14 07:12:28 +0000 | [diff] [blame] | 84 | # Add OLT device |
| 85 | Setup |
| 86 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 87 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 88 | Perform Sanity Tests TT |
Hardik Windlass | 364ec45 | 2021-04-14 07:12:28 +0000 | [diff] [blame] | 89 | Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password} |
| 90 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 91 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 92 | ${src}= Set Variable ${hosts.src[${I}]} |
| 93 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 94 | ${service_type}= Get Variable Value ${src['service_type']} "null" |
| 95 | ${of_id}= Get ofID From OLT List ${src['olt']} |
| 96 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 97 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | 364ec45 | 2021-04-14 07:12:28 +0000 | [diff] [blame] | 98 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
Girish Gowdra | a3a05c6 | 2022-02-16 13:54:37 -0800 | [diff] [blame] | 99 | # If the power switch port is not specified, continue |
| 100 | Continue For Loop If '${src["power_switch_port"]}' == '${None}' |
Hardik Windlass | 364ec45 | 2021-04-14 07:12:28 +0000 | [diff] [blame] | 101 | # Disable Power Switch |
| 102 | Disable Switch Outlet ${src['power_switch_port']} |
| 103 | # TODO: Add verification for MCAST |
| 104 | Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 105 | ... Wait Until Keyword Succeeds ${timeout} 5s |
Hardik Windlass | 364ec45 | 2021-04-14 07:12:28 +0000 | [diff] [blame] | 106 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 107 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 108 | # Remove Subscriber Access (To replicate TT workflow) |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 109 | ${del_sub_cmd}= Run Keyword If ${unitag_sub} |
| 110 | ... Catenate volt-remove-subscriber-unitag --tpId ${src['tp_id']} --sTag ${src['s_tag']} |
| 111 | ... --cTag ${src['c_tag']} ${src['onu']}-${src['uni_id']} |
| 112 | ... ELSE |
| 113 | ... Set Variable volt-remove-subscriber-access ${of_id} ${onu_port} |
TorstenThieme | 4e2168e | 2021-06-22 14:01:47 +0000 | [diff] [blame] | 114 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 115 | ... ${ONOS_SSH_PORT} ${del_sub_cmd} |
Hardik Windlass | 364ec45 | 2021-04-14 07:12:28 +0000 | [diff] [blame] | 116 | Sleep 5s |
| 117 | # Enable Power Switch |
| 118 | Enable Switch Outlet ${src['power_switch_port']} |
| 119 | # Check ONU port is Enabled in ONOS |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 120 | Wait Until Keyword Succeeds 120s 5s |
Hardik Windlass | 3901567 | 2021-07-05 05:48:08 +0000 | [diff] [blame] | 121 | ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 122 | # Add Subscriber Access |
| 123 | ${add_sub_cmd}= Run Keyword If ${unitag_sub} |
| 124 | ... Catenate volt-add-subscriber-unitag --tpId ${src['tp_id']} --sTag ${src['s_tag']} |
| 125 | ... --cTag ${src['c_tag']} ${src['onu']}-${src['uni_id']} |
| 126 | ... ELSE |
| 127 | ... Set Variable volt-add-subscriber-access ${of_id} ${onu_port} |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 128 | Wait Until Keyword Succeeds ${timeout} 2 |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 129 | ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${add_sub_cmd} |
Hardik Windlass | 364ec45 | 2021-04-14 07:12:28 +0000 | [diff] [blame] | 130 | # Verify ONU state in voltha |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 131 | Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
Hardik Windlass | 364ec45 | 2021-04-14 07:12:28 +0000 | [diff] [blame] | 132 | ... ENABLED ACTIVE REACHABLE |
| 133 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 134 | Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' |
| 135 | ... Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 136 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 137 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 138 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 139 | ... ${dst['container_name']} |
| 140 | ... ELSE IF ${has_dataplane} and '${service_type}' == 'mcast' Run Keyword And Continue On Failure |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 141 | ... Sanity Test TT MCAST one ONU ${src} |
Hardik Windlass | 364ec45 | 2021-04-14 07:12:28 +0000 | [diff] [blame] | 142 | ... ${dst} ${suppressaddsubscriber} |
| 143 | END |
| 144 | |
| 145 | Verify OLT after Rebooting Physically for TT |
| 146 | [Documentation] Test the physical reboot of the OLT |
| 147 | ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityTT test was executed) |
| 148 | ... Test performs a physical reboot, performs "reboot" from the OLT CLI |
| 149 | [Tags] functionalTT PhysicalOltRebootTT |
| 150 | [Setup] Start Logging RebootOlt_Physical_TT |
| 151 | [Teardown] Run Keywords Collect Logs |
Hardik Windlass | 364ec45 | 2021-04-14 07:12:28 +0000 | [diff] [blame] | 152 | ... AND Delete All Devices and Verify |
Girish Gowdra | f244d5b | 2021-09-01 17:16:16 -0700 | [diff] [blame] | 153 | ... AND Run Keyword If ${logging} Collect Logs |
| 154 | ... AND Stop Logging RebootOlt_Physical_TT |
Hardik Windlass | 364ec45 | 2021-04-14 07:12:28 +0000 | [diff] [blame] | 155 | # Add OLT device |
| 156 | Setup |
| 157 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 158 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 159 | Perform Sanity Tests TT |
Hardik Windlass | 364ec45 | 2021-04-14 07:12:28 +0000 | [diff] [blame] | 160 | # Reboot the OLT from the OLT CLI |
| 161 | FOR ${I} IN RANGE 0 ${olt_count} |
| 162 | ${olt_user}= Get From Dictionary ${list_olts}[${I}] user |
| 163 | ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass |
| 164 | ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship |
| 165 | ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn |
| 166 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 167 | Run Keyword If ${has_dataplane} Login And Run Command On Remote System |
| 168 | ... reboot ${olt_ssh_ip} ${olt_user} ${olt_pass} prompt=# |
| 169 | END |
| 170 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 171 | ${src}= Set Variable ${hosts.src[${I}]} |
| 172 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 173 | ${service_type}= Get Variable Value ${src['service_type']} "null" |
| 174 | # TODO: Add verification for MCAST |
| 175 | Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 176 | ... Wait Until Keyword Succeeds ${timeout} 5s |
Hardik Windlass | 364ec45 | 2021-04-14 07:12:28 +0000 | [diff] [blame] | 177 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 178 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 179 | END |
| 180 | # Wait for the OLT to come back up |
| 181 | FOR ${I} IN RANGE 0 ${olt_count} |
| 182 | ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn |
| 183 | ${olt_user}= Get From Dictionary ${list_olts}[${I}] user |
| 184 | ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass |
| 185 | ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship |
| 186 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 187 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s |
| 188 | ... Check Remote System Reachability True ${olt_ssh_ip} |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 189 | Wait Until Keyword Succeeds 360s 10s |
Hardik Windlass | 364ec45 | 2021-04-14 07:12:28 +0000 | [diff] [blame] | 190 | ... Validate OLT Device ENABLED ACTIVE |
| 191 | ... REACHABLE ${olt_serial_number} |
| 192 | END |
| 193 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 194 | Perform Sanity Tests TT |
Hardik Windlass | 364ec45 | 2021-04-14 07:12:28 +0000 | [diff] [blame] | 195 | |
Hardik Windlass | 8a8d81c | 2021-04-22 15:33:42 +0000 | [diff] [blame] | 196 | Verify ONU Soft Reboot for TT |
| 197 | [Documentation] Test the ONU Soft Reboot functionality. |
| 198 | [Tags] functionalTT OnuSoftRebootTT |
| 199 | [Setup] Start Logging SoftRebootOnu_TT |
| 200 | [Teardown] Run Keywords Collect Logs |
Hardik Windlass | 8a8d81c | 2021-04-22 15:33:42 +0000 | [diff] [blame] | 201 | ... AND Delete All Devices and Verify |
Girish Gowdra | f244d5b | 2021-09-01 17:16:16 -0700 | [diff] [blame] | 202 | ... AND Collect Logs |
| 203 | ... AND Stop Logging SoftRebootOnu_TT |
Hardik Windlass | 8a8d81c | 2021-04-22 15:33:42 +0000 | [diff] [blame] | 204 | # Add OLT device |
| 205 | Setup |
| 206 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 207 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 208 | Perform Sanity Tests TT |
Hardik Windlass | 8a8d81c | 2021-04-22 15:33:42 +0000 | [diff] [blame] | 209 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 210 | ${src}= Set Variable ${hosts.src[${I}]} |
| 211 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 212 | ${service_type}= Get Variable Value ${src['service_type']} "null" |
| 213 | ${of_id}= Get ofID From OLT List ${src['olt']} |
| 214 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 215 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | 8a8d81c | 2021-04-22 15:33:42 +0000 | [diff] [blame] | 216 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 217 | Reboot Device ${onu_device_id} |
| 218 | # TODO: Add verification for MCAST |
| 219 | Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 220 | ... Wait Until Keyword Succeeds ${timeout} 5s |
Hardik Windlass | 8a8d81c | 2021-04-22 15:33:42 +0000 | [diff] [blame] | 221 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 222 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 223 | # Remove Subscriber Access (To replicate TT workflow) |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 224 | ${del_sub_cmd}= Run Keyword If ${unitag_sub} |
| 225 | ... Catenate volt-remove-subscriber-unitag --tpId ${src['tp_id']} --sTag ${src['s_tag']} |
| 226 | ... --cTag ${src['c_tag']} ${src['onu']}-${src['uni_id']} |
| 227 | ... ELSE |
| 228 | ... Set Variable volt-remove-subscriber-access ${of_id} ${onu_port} |
TorstenThieme | 4e2168e | 2021-06-22 14:01:47 +0000 | [diff] [blame] | 229 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 230 | ... ${ONOS_SSH_PORT} ${del_sub_cmd} |
Hardik Windlass | 8a8d81c | 2021-04-22 15:33:42 +0000 | [diff] [blame] | 231 | # Check ONU port is Enabled in ONOS |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 232 | Wait Until Keyword Succeeds ${timeout} 5s |
Hardik Windlass | 3901567 | 2021-07-05 05:48:08 +0000 | [diff] [blame] | 233 | ... Verify UNI Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 234 | # Add Subscriber Access |
| 235 | ${add_sub_cmd}= Run Keyword If ${unitag_sub} |
| 236 | ... Catenate volt-add-subscriber-unitag --tpId ${src['tp_id']} --sTag ${src['s_tag']} |
| 237 | ... --cTag ${src['c_tag']} ${src['onu']}-${src['uni_id']} |
| 238 | ... ELSE |
| 239 | ... Set Variable volt-add-subscriber-access ${of_id} ${onu_port} |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 240 | Wait Until Keyword Succeeds ${timeout} 2 |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 241 | ... Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${add_sub_cmd} |
Hardik Windlass | 8a8d81c | 2021-04-22 15:33:42 +0000 | [diff] [blame] | 242 | # Verify ONU state in voltha |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 243 | Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
Hardik Windlass | 8a8d81c | 2021-04-22 15:33:42 +0000 | [diff] [blame] | 244 | ... ENABLED ACTIVE REACHABLE |
| 245 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 246 | Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' |
| 247 | ... Run Keyword And Continue On Failure Validate DHCP and Ping True |
| 248 | ... True ${src['dp_iface_name']} ${src['s_tag']} ${src['c_tag']} ${dst['dp_iface_ip_qinq']} |
| 249 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 250 | ... ${dst['dp_iface_name']} ${dst['ip']} ${dst['user']} ${dst['pass']} ${dst['container_type']} |
| 251 | ... ${dst['container_name']} |
| 252 | ... ELSE IF ${has_dataplane} and '${service_type}' == 'mcast' Run Keyword And Continue On Failure |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 253 | ... Sanity Test TT MCAST one ONU ${src} |
Hardik Windlass | 8a8d81c | 2021-04-22 15:33:42 +0000 | [diff] [blame] | 254 | ... ${dst} ${suppressaddsubscriber} |
| 255 | END |
| 256 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 257 | Perform Sanity Tests TT ${suppressaddsubscriber} |
Hardik Windlass | 8a8d81c | 2021-04-22 15:33:42 +0000 | [diff] [blame] | 258 | |
Hardik Windlass | 656661a | 2021-04-23 03:46:31 +0000 | [diff] [blame] | 259 | Verify OLT Soft Reboot for TT |
| 260 | [Documentation] Test the OLT Soft Reboot functionality. |
| 261 | [Tags] functionalTT OltSoftRebootTT |
| 262 | [Setup] Start Logging SoftRebootOlt_TT |
| 263 | [Teardown] Run Keywords Collect Logs |
Hardik Windlass | 656661a | 2021-04-23 03:46:31 +0000 | [diff] [blame] | 264 | ... AND Delete All Devices and Verify |
Girish Gowdra | f244d5b | 2021-09-01 17:16:16 -0700 | [diff] [blame] | 265 | ... AND Collect Logs |
| 266 | ... AND Stop Logging SoftRebootOlt_TT |
Hardik Windlass | 656661a | 2021-04-23 03:46:31 +0000 | [diff] [blame] | 267 | # Add OLT device |
| 268 | Setup |
| 269 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 270 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 271 | Perform Sanity Tests TT |
Hardik Windlass | 656661a | 2021-04-23 03:46:31 +0000 | [diff] [blame] | 272 | # Reboot the OLT from the OLT CLI |
| 273 | FOR ${I} IN RANGE 0 ${olt_count} |
| 274 | ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn |
| 275 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 276 | # Reboot the OLT using "voltctl device reboot" command |
| 277 | Reboot Device ${olt_device_id} |
Andrea Campanella | 9d8d3a5 | 2021-06-17 12:18:23 +0200 | [diff] [blame] | 278 | # Wait for the OLT to actually go down |
| 279 | Wait Until Keyword Succeeds 360s 5s Validate OLT Device ENABLED UNKNOWN UNREACHABLE |
| 280 | ... ${olt_serial_number} |
Hardik Windlass | 656661a | 2021-04-23 03:46:31 +0000 | [diff] [blame] | 281 | END |
| 282 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 283 | ${src}= Set Variable ${hosts.src[${I}]} |
| 284 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 285 | ${service_type}= Get Variable Value ${src['service_type']} "null" |
| 286 | # TODO: Add verification for MCAST |
| 287 | Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' Run Keyword And Continue On Failure |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 288 | ... Wait Until Keyword Succeeds ${timeout} 5s |
Hardik Windlass | 656661a | 2021-04-23 03:46:31 +0000 | [diff] [blame] | 289 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 290 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 291 | END |
| 292 | # Wait for the OLT to come back up |
| 293 | FOR ${I} IN RANGE 0 ${olt_count} |
| 294 | ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn |
| 295 | ${olt_user}= Get From Dictionary ${list_olts}[${I}] user |
| 296 | ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass |
| 297 | ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship |
| 298 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 299 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s |
| 300 | ... Check Remote System Reachability True ${olt_ssh_ip} |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 301 | Wait Until Keyword Succeeds 360s 10s |
Hardik Windlass | 656661a | 2021-04-23 03:46:31 +0000 | [diff] [blame] | 302 | ... Validate OLT Device ENABLED ACTIVE |
| 303 | ... REACHABLE ${olt_serial_number} |
| 304 | END |
| 305 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 306 | Perform Sanity Tests TT |
Hardik Windlass | 656661a | 2021-04-23 03:46:31 +0000 | [diff] [blame] | 307 | |
Emrehan UZUN | 2884ed5 | 2021-05-04 15:36:31 +0000 | [diff] [blame] | 308 | Verify restart openolt-adapter container before subscriber provisioning for TT |
| 309 | [Documentation] Restart openolt-adapter container after VOLTHA is operational. |
| 310 | [Tags] functionalTT Restart-OpenOlt-Before-Subscription-TT |
| 311 | [Setup] Start Logging Restart-OpenOlt-Before-Subscription-TT |
| 312 | [Teardown] Run Keywords Collect Logs |
Girish Gowdra | f244d5b | 2021-09-01 17:16:16 -0700 | [diff] [blame] | 313 | ... AND Stop Logging Restart-OpenOlt-Before-Subscription-TT |
Emrehan UZUN | 2884ed5 | 2021-05-04 15:36:31 +0000 | [diff] [blame] | 314 | # Add OLT device |
| 315 | Setup |
| 316 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 317 | FOR ${I} IN RANGE 0 ${olt_count} |
| 318 | ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn |
| 319 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 320 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 321 | ... ${olt_serial_number} |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 322 | ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s |
Emrehan UZUN | 2884ed5 | 2021-05-04 15:36:31 +0000 | [diff] [blame] | 323 | ... Get NNI Port in ONOS ${of_id} |
| 324 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 325 | ... Verify Default Downstream Flows are added in ONOS for OLT TT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 326 | ... ${nni_port} |
| 327 | END |
| 328 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 329 | Log ${podStatusOutput} |
| 330 | ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 331 | ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL} |
| 332 | Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName} |
| 333 | Sleep 5s |
| 334 | Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE} |
| 335 | ... app ${podName} Running |
| 336 | Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName} |
| 337 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 338 | Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart} |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 339 | Perform Sanity Tests TT |
Emrehan UZUN | 2884ed5 | 2021-05-04 15:36:31 +0000 | [diff] [blame] | 340 | Log to console Pod ${podName} restarted and sanity checks passed successfully |
| 341 | |
Hardik Windlass | d3f6389 | 2021-03-25 08:28:02 +0000 | [diff] [blame] | 342 | Verify restart ofagent container after subscriber is provisioned for TT |
| 343 | [Documentation] Restart ofagent container after VOLTHA is operational. |
Hardik Windlass | a9ec90d | 2021-05-27 11:33:22 +0000 | [diff] [blame] | 344 | [Tags] functionalTT ofagentRestart-TT |
Hardik Windlass | d3f6389 | 2021-03-25 08:28:02 +0000 | [diff] [blame] | 345 | [Setup] Start Logging ofagentRestart-TT |
| 346 | [Teardown] Run Keywords Collect Logs |
| 347 | ... AND Stop Logging ofagentRestart-TT |
Matteo Scandolo | a4e5952 | 2021-08-31 14:56:24 -0700 | [diff] [blame] | 348 | ... AND Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 1 |
Hardik Windlass | d3f6389 | 2021-03-25 08:28:02 +0000 | [diff] [blame] | 349 | # set timeout value |
| 350 | ${waitforRestart} Set Variable 120s |
| 351 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 352 | Log ${podStatusOutput} |
| 353 | ${countBforRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 354 | ${podName} Set Variable ofagent |
| 355 | Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName} |
| 356 | Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE} |
| 357 | ... app ${podName} Running |
| 358 | Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName} |
| 359 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 360 | Perform Sanity Test TT ${suppressaddsubscriber} |
Hardik Windlass | d3f6389 | 2021-03-25 08:28:02 +0000 | [diff] [blame] | 361 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 362 | Log ${podStatusOutput} |
| 363 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 364 | Should Be Equal As Strings ${countAfterRestart} ${countBforRestart} |
| 365 | # Scale Down the Of-Agent Deployment |
Matteo Scandolo | a4e5952 | 2021-08-31 14:56:24 -0700 | [diff] [blame] | 366 | Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 0 |
Hardik Windlass | d3f6389 | 2021-03-25 08:28:02 +0000 | [diff] [blame] | 367 | Sleep 30s |
| 368 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 369 | ${src}= Set Variable ${hosts.src[${I}]} |
| 370 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Hardik Windlass | a9ec90d | 2021-05-27 11:33:22 +0000 | [diff] [blame] | 371 | ${service_type}= Get Variable Value ${src['service_type']} "null" |
Hardik Windlass | d3f6389 | 2021-03-25 08:28:02 +0000 | [diff] [blame] | 372 | ${of_id}= Get ofID From OLT List ${src['olt']} |
| 373 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 374 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | d3f6389 | 2021-03-25 08:28:02 +0000 | [diff] [blame] | 375 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 376 | # Verify ONU state in voltha |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 377 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
Hardik Windlass | d3f6389 | 2021-03-25 08:28:02 +0000 | [diff] [blame] | 378 | ... ENABLED ACTIVE REACHABLE |
| 379 | ... ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 380 | # Check ONU port is Disabled in ONOS |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 381 | Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | 3901567 | 2021-07-05 05:48:08 +0000 | [diff] [blame] | 382 | ... Verify UNI Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Hardik Windlass | d3f6389 | 2021-03-25 08:28:02 +0000 | [diff] [blame] | 383 | # Verify Ping |
Hardik Windlass | a9ec90d | 2021-05-27 11:33:22 +0000 | [diff] [blame] | 384 | Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 385 | ... Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Check Ping True |
Hardik Windlass | d3f6389 | 2021-03-25 08:28:02 +0000 | [diff] [blame] | 386 | ... ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} ${src['ip']} |
| 387 | ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 388 | END |
| 389 | # Scale Up the Of-Agent Deployment |
Matteo Scandolo | a4e5952 | 2021-08-31 14:56:24 -0700 | [diff] [blame] | 390 | Scale K8s Deployment ${NAMESPACE} ${STACK_NAME}-voltha-ofagent 1 |
Hardik Windlass | d3f6389 | 2021-03-25 08:28:02 +0000 | [diff] [blame] | 391 | Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE} |
| 392 | ... Running |
| 393 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 394 | Perform Sanity Tests TT ${suppressaddsubscriber} |
Hardik Windlass | d3f6389 | 2021-03-25 08:28:02 +0000 | [diff] [blame] | 395 | Log to console Pod ${podName} restarted and sanity checks passed successfully |
| 396 | |
| 397 | Sanity E2E Test for OLT/ONU on POD With Core Fail and Restart for TT |
| 398 | [Documentation] Deploys an device instance. After that rw-core deployment is scaled to 0 instances to |
| 399 | ... simulate a POD crash. The test then scales the rw-core back to a single instance |
| 400 | ... and configures ONOS for access. The test succeeds if the device is able to |
| 401 | ... complete the DHCP sequence. |
Hardik Windlass | 3e3c994 | 2021-04-09 11:37:15 +0000 | [diff] [blame] | 402 | [Tags] functionalTT rwcore-restart-TT |
Hardik Windlass | d3f6389 | 2021-03-25 08:28:02 +0000 | [diff] [blame] | 403 | [Setup] Run Keywords Start Logging RwCoreFailAndRestart-TT |
| 404 | ... AND Clear All Devices Then Create New Device |
| 405 | [Teardown] Run Keywords Collect Logs |
| 406 | ... AND Stop Logging RwCoreFailAndRestart-TT |
| 407 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 408 | FOR ${I} IN RANGE 0 ${olt_count} |
| 409 | ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn |
| 410 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 411 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 412 | ... ${olt_serial_number} |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 413 | ${nni_port}= Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | d3f6389 | 2021-03-25 08:28:02 +0000 | [diff] [blame] | 414 | ... Get NNI Port in ONOS ${of_id} |
| 415 | END |
| 416 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 417 | ${src}= Set Variable ${hosts.src[${I}]} |
| 418 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 419 | ${of_id}= Get ofID From OLT List ${src['olt']} |
| 420 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 421 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 422 | ... ${of_id} |
| 423 | # Bring up the device and verify it authenticates |
| 424 | Wait Until Keyword Succeeds 360s 5s Validate Device ENABLED ACTIVE REACHABLE |
Hardik Windlass | 8b44649 | 2021-06-10 06:25:23 +0000 | [diff] [blame] | 425 | ... ${onu_device_id} onu=True onu_reason=initial-mib-downloaded by_dev_id=True |
Hardik Windlass | d3f6389 | 2021-03-25 08:28:02 +0000 | [diff] [blame] | 426 | END |
| 427 | |
| 428 | # Scale down the rw-core deployment to 0 PODs and once confirmed, scale it back to 1 |
| 429 | Scale K8s Deployment voltha voltha-voltha-rw-core 0 |
| 430 | Wait Until Keyword Succeeds ${timeout} 2s Pod Does Not Exist voltha voltha-voltha-rw-core |
| 431 | # Ensure the ofagent POD goes "not-ready" as expected |
| 432 | Wait Until keyword Succeeds ${timeout} 2s |
| 433 | ... Check Expected Available Deployment Replicas voltha voltha-voltha-ofagent 0 |
| 434 | # Scale up the core deployment and make sure both it and the ofagent deployment are back |
| 435 | Scale K8s Deployment voltha voltha-voltha-rw-core 1 |
| 436 | Wait Until Keyword Succeeds ${timeout} 2s |
| 437 | ... Check Expected Available Deployment Replicas voltha voltha-voltha-rw-core 1 |
| 438 | Wait Until Keyword Succeeds ${timeout} 2s |
| 439 | ... Check Expected Available Deployment Replicas voltha voltha-voltha-ofagent 1 |
| 440 | # For some reason scaling down and up the POD behind a service causes the port forward to stop working, |
| 441 | # so restart the port forwarding for the API service |
| 442 | Restart VOLTHA Port Forward voltha-api |
| 443 | # Ensure that the ofagent pod is up and ready and the device is available in ONOS, this |
| 444 | # represents system connectivity being restored |
| 445 | FOR ${I} IN RANGE 0 ${olt_count} |
| 446 | ${olt_serial_number}= Get From Dictionary ${olt_ids}[${I}] sn |
| 447 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 448 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 449 | ... ${olt_serial_number} |
| 450 | Wait Until Keyword Succeeds 120s 2s Device Is Available In ONOS |
| 451 | ... http://karaf:karaf@${ONOS_REST_IP}:${ONOS_REST_PORT} ${of_id} |
| 452 | END |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 453 | Perform Sanity Tests TT |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 454 | |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 455 | Verify restart openonu-adapter container for TT |
Hardik Windlass | d50b020 | 2021-09-02 14:45:09 +0000 | [diff] [blame] | 456 | [Documentation] Restart openonu-adapter container after VOLTHA is operational. |
| 457 | ... Run the ping continuously in background during container restart, |
| 458 | ... and verify that there should be no affect on the dataplane. |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 459 | ... Also, verify that the voltha control plane functionality is not affected. |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 460 | [Tags] functionalTT Restart-OpenOnu-Ping-TT dataplaneTT |
Hardik Windlass | d50b020 | 2021-09-02 14:45:09 +0000 | [diff] [blame] | 461 | [Setup] Start Logging Restart-OpenOnu-Ping-TT |
| 462 | [Teardown] Run Keywords Collect Logs |
| 463 | ... AND Stop Logging Restart-OpenOnu-Ping-TT |
| 464 | Clear All Devices Then Create New Device |
| 465 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 466 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 467 | Perform Sanity Test TT |
Hardik Windlass | d50b020 | 2021-09-02 14:45:09 +0000 | [diff] [blame] | 468 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 469 | ${src}= Set Variable ${hosts.src[${I}]} |
| 470 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 471 | ${service_type}= Get Variable Value ${src['service_type']} "null" |
| 472 | Continue For Loop If '${service_type}' == 'mcast' |
| 473 | ${ping_output_file}= Set Variable /tmp/${src['onu']}_${service_type}_ping |
| 474 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 475 | ... Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | d50b020 | 2021-09-02 14:45:09 +0000 | [diff] [blame] | 476 | ... Run Ping In Background ${ping_output_file} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 477 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 478 | END |
| 479 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 480 | Log ${podStatusOutput} |
| 481 | ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 482 | ${podName} Set Variable adapter-open-onu |
| 483 | Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName} |
| 484 | Sleep 5s |
| 485 | Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE} |
| 486 | ... app ${podName} Running |
| 487 | Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName} |
| 488 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 489 | Log ${podStatusOutput} |
| 490 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 491 | Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart} |
| 492 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 493 | ${src}= Set Variable ${hosts.src[${I}]} |
| 494 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 495 | ${service_type}= Get Variable Value ${src['service_type']} "null" |
| 496 | Continue For Loop If '${service_type}' == 'mcast' |
| 497 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 498 | ... Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | d50b020 | 2021-09-02 14:45:09 +0000 | [diff] [blame] | 499 | ... Stop Ping Running In Background ${src['ip']} ${src['user']} ${src['pass']} |
| 500 | ... ${src['container_type']} ${src['container_name']} |
| 501 | END |
| 502 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 503 | ${src}= Set Variable ${hosts.src[${I}]} |
| 504 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 505 | ${service_type}= Get Variable Value ${src['service_type']} "null" |
| 506 | Continue For Loop If '${service_type}' == 'mcast' |
| 507 | ${ping_output_file}= Set Variable /tmp/${src['onu']}_${service_type}_ping |
| 508 | ${ping_output}= Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 509 | ... Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | d50b020 | 2021-09-02 14:45:09 +0000 | [diff] [blame] | 510 | ... Retrieve Remote File Contents ${ping_output_file} ${src['ip']} ${src['user']} ${src['pass']} |
| 511 | ... ${src['container_type']} ${src['container_name']} |
| 512 | Check Ping Result True ${ping_output} |
| 513 | END |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 514 | # Verify Control Plane Functionality by Deleting and Re-adding the Subscriber |
| 515 | Verify Control Plane After Pod Restart TT |
Hardik Windlass | d50b020 | 2021-09-02 14:45:09 +0000 | [diff] [blame] | 516 | |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 517 | Verify restart openolt-adapter container for TT |
Hardik Windlass | d50b020 | 2021-09-02 14:45:09 +0000 | [diff] [blame] | 518 | [Documentation] Restart openolt-adapter container after VOLTHA is operational. |
| 519 | ... Run the ping continuously in background during container restart, |
| 520 | ... and verify that there should be no affect on the dataplane. |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 521 | ... Also, verify that the voltha control plane functionality is not affected. |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 522 | [Tags] functionalTT Restart-OpenOlt-Ping-TT dataplaneTT |
Hardik Windlass | d50b020 | 2021-09-02 14:45:09 +0000 | [diff] [blame] | 523 | [Setup] Start Logging Restart-OpenOlt-Ping-TT |
| 524 | [Teardown] Run Keywords Collect Logs |
| 525 | ... AND Stop Logging Restart-OpenOlt-Ping-TT |
| 526 | Clear All Devices Then Create New Device |
| 527 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 528 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 529 | Perform Sanity Test TT |
Hardik Windlass | d50b020 | 2021-09-02 14:45:09 +0000 | [diff] [blame] | 530 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 531 | ${src}= Set Variable ${hosts.src[${I}]} |
| 532 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 533 | ${service_type}= Get Variable Value ${src['service_type']} "null" |
| 534 | Continue For Loop If '${service_type}' == 'mcast' |
| 535 | ${ping_output_file}= Set Variable /tmp/${src['onu']}_${service_type}_ping |
| 536 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 537 | ... Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | d50b020 | 2021-09-02 14:45:09 +0000 | [diff] [blame] | 538 | ... Run Ping In Background ${ping_output_file} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 539 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 540 | END |
| 541 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 542 | Log ${podStatusOutput} |
| 543 | ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 544 | ${podName} Set Variable ${OLT_ADAPTER_APP_LABEL} |
| 545 | Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName} |
| 546 | Sleep 5s |
| 547 | Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE} |
| 548 | ... app ${podName} Running |
| 549 | Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName} |
| 550 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 551 | Log ${podStatusOutput} |
| 552 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 553 | Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart} |
| 554 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 555 | ${src}= Set Variable ${hosts.src[${I}]} |
| 556 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 557 | ${service_type}= Get Variable Value ${src['service_type']} "null" |
| 558 | Continue For Loop If '${service_type}' == 'mcast' |
| 559 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 560 | ... Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | d50b020 | 2021-09-02 14:45:09 +0000 | [diff] [blame] | 561 | ... Stop Ping Running In Background ${src['ip']} ${src['user']} ${src['pass']} |
| 562 | ... ${src['container_type']} ${src['container_name']} |
| 563 | END |
| 564 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 565 | ${src}= Set Variable ${hosts.src[${I}]} |
| 566 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 567 | ${service_type}= Get Variable Value ${src['service_type']} "null" |
| 568 | Continue For Loop If '${service_type}' == 'mcast' |
| 569 | ${ping_output_file}= Set Variable /tmp/${src['onu']}_${service_type}_ping |
| 570 | ${ping_output}= Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 571 | ... Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | d50b020 | 2021-09-02 14:45:09 +0000 | [diff] [blame] | 572 | ... Retrieve Remote File Contents ${ping_output_file} ${src['ip']} ${src['user']} ${src['pass']} |
| 573 | ... ${src['container_type']} ${src['container_name']} |
| 574 | Check Ping Result True ${ping_output} |
| 575 | END |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 576 | # Verify Control Plane Functionality by Deleting and Re-adding the Subscriber |
| 577 | Verify Control Plane After Pod Restart TT |
| 578 | |
| 579 | Verify restart rw-core container for TT |
| 580 | [Documentation] Restart rw-core container after VOLTHA is operational. |
| 581 | ... Run the ping continuously in background during container restart, |
| 582 | ... and verify that there should be no affect on the dataplane. |
| 583 | ... Also, verify that the voltha control plane functionality is not affected. |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 584 | [Tags] functionalTT Restart-RwCore-Ping-TT dataplaneTT |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 585 | [Setup] Start Logging Restart-RwCore-Ping-TT |
| 586 | [Teardown] Run Keywords Collect Logs |
| 587 | ... AND Stop Logging Restart-RwCore-Ping-TT |
| 588 | Clear All Devices Then Create New Device |
| 589 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 590 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 591 | Perform Sanity Test TT |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 592 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 593 | ${src}= Set Variable ${hosts.src[${I}]} |
| 594 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 595 | ${service_type}= Get Variable Value ${src['service_type']} "null" |
| 596 | Continue For Loop If '${service_type}' == 'mcast' |
| 597 | ${ping_output_file}= Set Variable /tmp/${src['onu']}_${service_type}_ping |
| 598 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 599 | ... Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 600 | ... Run Ping In Background ${ping_output_file} ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 601 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 602 | END |
| 603 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 604 | Log ${podStatusOutput} |
| 605 | ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 606 | ${podName} Set Variable rw-core |
| 607 | Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName} |
| 608 | Sleep 5s |
| 609 | Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE} |
| 610 | ... app ${podName} Running |
| 611 | Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName} |
| 612 | # For some reason scaling down and up the POD behind a service causes the port forward to stop working, |
| 613 | # so restart the port forwarding for the API service |
| 614 | Restart VOLTHA Port Forward voltha-api |
| 615 | ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE} |
| 616 | Log ${podStatusOutput} |
| 617 | ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 618 | Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart} |
| 619 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 620 | ${src}= Set Variable ${hosts.src[${I}]} |
| 621 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 622 | ${service_type}= Get Variable Value ${src['service_type']} "null" |
| 623 | Continue For Loop If '${service_type}' == 'mcast' |
| 624 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 625 | ... Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 626 | ... Stop Ping Running In Background ${src['ip']} ${src['user']} ${src['pass']} |
| 627 | ... ${src['container_type']} ${src['container_name']} |
| 628 | END |
| 629 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 630 | ${src}= Set Variable ${hosts.src[${I}]} |
| 631 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 632 | ${service_type}= Get Variable Value ${src['service_type']} "null" |
| 633 | Continue For Loop If '${service_type}' == 'mcast' |
| 634 | ${ping_output_file}= Set Variable /tmp/${src['onu']}_${service_type}_ping |
| 635 | ${ping_output}= Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 636 | ... Wait Until Keyword Succeeds ${timeout} 2s |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 637 | ... Retrieve Remote File Contents ${ping_output_file} ${src['ip']} ${src['user']} ${src['pass']} |
| 638 | ... ${src['container_type']} ${src['container_name']} |
| 639 | Check Ping Result True ${ping_output} |
| 640 | END |
| 641 | # Verify Control Plane Functionality by Deleting and Re-adding the Subscriber |
| 642 | Verify Control Plane After Pod Restart TT |
Hardik Windlass | d50b020 | 2021-09-02 14:45:09 +0000 | [diff] [blame] | 643 | |
TorstenThieme | 136ebf7 | 2021-02-26 14:27:07 +0000 | [diff] [blame] | 644 | *** Keywords *** |
| 645 | Setup Suite |
| 646 | [Documentation] Set up the test suite |
| 647 | Common Test Suite Setup |
| 648 | ${switch_type}= Get Variable Value ${web_power_switch.type} |
| 649 | Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type} |
| 650 | |
Hardik Windlass | d3f6389 | 2021-03-25 08:28:02 +0000 | [diff] [blame] | 651 | Clear All Devices Then Create New Device |
| 652 | [Documentation] Remove any devices from VOLTHA and ONOS & then Create new devices |
| 653 | # Remove all devices from voltha and onos |
| 654 | Delete All Devices and Verify |
| 655 | # Execute normal test Setup Keyword |
| 656 | Setup |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 657 | |
| 658 | Verify Control Plane After Pod Restart TT |
| 659 | [Documentation] Verifies the control plane functionality after the voltha pod restart |
| 660 | ... by deleting and re-adding the subscriber |
| 661 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 662 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 663 | ${src}= Set Variable ${hosts.src[${I}]} |
| 664 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 665 | ${service_type}= Get Variable Value ${src['service_type']} "null" |
| 666 | ${of_id}= Get ofID From OLT List ${src['olt']} |
| 667 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 668 | ... ${of_id} ${src['uni_id']} |
| 669 | # Remove Subscriber Access |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 670 | ${del_sub_cmd}= Run Keyword If ${unitag_sub} |
| 671 | ... Catenate volt-remove-subscriber-unitag --tpId ${src['tp_id']} --sTag ${src['s_tag']} |
| 672 | ... --cTag ${src['c_tag']} ${src['onu']}-${src['uni_id']} |
| 673 | ... ELSE |
| 674 | ... Set Variable volt-remove-subscriber-access ${of_id} ${onu_port} |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 675 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 676 | ... ${ONOS_SSH_PORT} ${del_sub_cmd} |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 677 | Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 678 | ... Wait Until Keyword Succeeds ${timeout} 5s |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 679 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 680 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 681 | # Add Subscriber Access |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 682 | ${add_sub_cmd}= Run Keyword If ${unitag_sub} |
| 683 | ... Catenate volt-add-subscriber-unitag --tpId ${src['tp_id']} --sTag ${src['s_tag']} |
| 684 | ... --cTag ${src['c_tag']} ${src['onu']}-${src['uni_id']} |
| 685 | ... ELSE |
Matteo Scandolo | 2786d21 | 2021-12-06 12:22:53 -0800 | [diff] [blame] | 686 | ... Set Variable volt-add-subscriber-access ${of_id} ${onu_port} |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 687 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command use single connection ${ONOS_SSH_IP} |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 688 | ... ${ONOS_SSH_PORT} ${add_sub_cmd} |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 689 | Wait Until Keyword Succeeds ${timeout} 5s |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 690 | ... Validate Device ENABLED ACTIVE |
| 691 | ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed |
Hardik Windlass | 5a2d1f4 | 2021-11-12 12:52:04 +0000 | [diff] [blame] | 692 | Run Keyword If ${has_dataplane} and '${service_type}' != 'mcast' |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 693 | ... Sanity Test TT one ONU ${src} ${dst} ${suppressaddsubscriber} |
Hardik Windlass | 5a2d1f4 | 2021-11-12 12:52:04 +0000 | [diff] [blame] | 694 | ... ELSE IF ${has_dataplane} and '${service_type}' == 'mcast' |
Hardik Windlass | 5083b3a | 2021-11-11 12:16:22 +0000 | [diff] [blame] | 695 | ... Sanity Test TT MCAST one ONU ${src} ${dst} ${suppressaddsubscriber} |
Hardik Windlass | cf46ec4 | 2021-09-28 08:05:49 +0000 | [diff] [blame] | 696 | END |