Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [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. |
| 14 | # FIXME Can we use the same test against BBSim and Hardware? |
| 15 | |
| 16 | *** Settings *** |
| 17 | Documentation Test various end-to-end scenarios |
| 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 |
Suchitra Vemuri | 1d8e817 | 2020-06-17 17:43:56 -0700 | [diff] [blame] | 34 | Resource ../../libraries/power_switch.robot |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 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 |
| 45 | # For below variable value, using deployment name as using grep for |
| 46 | # parsing radius pod name, we can also use full radius pod name |
| 47 | ${RESTART_POD_NAME} radius |
| 48 | ${timeout} 60s |
| 49 | ${of_id} 0 |
| 50 | ${logical_id} 0 |
| 51 | ${has_dataplane} True |
Hardik Windlass | ffbf060 | 2020-04-24 23:14:45 +0530 | [diff] [blame] | 52 | ${teardown_device} True |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 53 | ${scripts} ../../scripts |
| 54 | |
Andy Bavier | e19991a | 2020-05-08 10:42:40 -0700 | [diff] [blame] | 55 | # For dataplane bandwidth testing |
| 56 | ${upper_margin_pct} 105 # Allow 5% over the limit |
Andy Bavier | f6ab19c | 2020-05-14 10:34:47 -0700 | [diff] [blame] | 57 | ${lower_margin_pct} 92 # Allow 8% under the limit |
Andy Bavier | e19991a | 2020-05-08 10:42:40 -0700 | [diff] [blame] | 58 | ${udp_rate_multiplier} 1.10 # Send UDP at bw profile limit * rate_multiplier |
| 59 | ${udp_packet_bytes} 1400 # UDP payload in bytes |
| 60 | |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 61 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 62 | ${container_log_dir} ${None} |
| 63 | |
| 64 | *** Test Cases *** |
Suchitra Vemuri | 1d8e817 | 2020-06-17 17:43:56 -0700 | [diff] [blame] | 65 | Reboot DT ONUs Physically |
| 66 | [Documentation] This test reboots ONUs physically before execution all the tests |
| 67 | ... Test case runs only on the PODs that are configured with PowerSwitch that |
| 68 | ... controls the power off/on ONUs/OLT remotely (simulating a physical reboot) |
| 69 | [Tags] functional PowerSwitch RebootAllDTONUs |
| 70 | [Setup] Start Logging RebootAllDTONUs |
| 71 | [Teardown] Run Keywords Collect Logs |
| 72 | ... AND Stop Logging RebootAllDTONUs |
| 73 | Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password} |
| 74 | FOR ${I} IN RANGE 0 ${num_onus} |
| 75 | ${src}= Set Variable ${hosts.src[${I}]} |
| 76 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 77 | Disable Switch Outlet ${src['power_switch_port']} |
| 78 | Sleep 60s |
| 79 | Enable Switch Outlet ${src['power_switch_port']} |
| 80 | Sleep 60s |
| 81 | END |
| 82 | |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 83 | Sanity E2E Test for OLT/ONU on POD for DT |
| 84 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 85 | ... Validate successful DHCP/E2E ping (no EAPOL and DHCP flows) for the tech profile that is used |
| 86 | ... Traffic sent with same vlan from different RGs, |
| 87 | ... should reach the NNI port on the OLT with the expected double tagged vlan ids |
| 88 | ... Inner vlans from the RG should not change |
Suchitra Vemuri | f2388ad | 2020-03-15 21:44:44 -0700 | [diff] [blame] | 89 | [Tags] sanityDt |
Andy Bavier | e187eda | 2020-04-20 15:00:02 -0700 | [diff] [blame] | 90 | [Setup] Run Keywords Start Logging SanityTestDt |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 91 | ... AND Setup |
| 92 | [Teardown] Run Keywords Collect Logs |
| 93 | ... AND Stop Logging SanityTestDt |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 94 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 95 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 96 | |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 97 | Test Subscriber Delete and Add for DT |
| 98 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
Hardik Windlass | 63d5e00 | 2020-03-06 21:07:09 +0530 | [diff] [blame] | 99 | ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed) |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 100 | ... Delete a subscriber and validate that the pings do not succeed and state is purged |
| 101 | ... Disable and Enable the ONU (This is to replicate the existing DT behaviour) |
| 102 | ... Re-add the subscriber, and validate that the flows are present and pings are successful |
Suchitra Vemuri | f2388ad | 2020-03-15 21:44:44 -0700 | [diff] [blame] | 103 | [Tags] functionalDt SubAddDeleteDt |
Andy Bavier | e187eda | 2020-04-20 15:00:02 -0700 | [diff] [blame] | 104 | [Setup] Start Logging SubAddDeleteDt |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 105 | [Teardown] Run Keywords Collect Logs |
| 106 | ... AND Stop Logging SubAddDeleteDt |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 107 | FOR ${I} IN RANGE 0 ${num_onus} |
| 108 | ${src}= Set Variable ${hosts.src[${I}]} |
| 109 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 110 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 111 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 112 | ... ${of_id} |
| 113 | # Remove Subscriber Access |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 114 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP} |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 115 | ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port} |
| 116 | Sleep 10s |
Hardik Windlass | fb5eace | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 117 | # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652) |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 118 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 119 | ... Wait Until Keyword Succeeds 60s 2s |
| 120 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 121 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Hardik Windlass | fb5eace | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 122 | # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream) |
| 123 | ${onos_flows_count}= Evaluate 4 * ( ${num_onus} - 1 ) |
| 124 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 125 | ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Hardik Windlass | 25e1170 | 2020-03-30 20:05:19 +0530 | [diff] [blame] | 126 | ... ${of_id} ${onos_flows_count} |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 127 | # Verify VOLTHA flows for OLT equals twice the number of ONUS (minus ONU under test) + 1 for LLDP |
| 128 | ${olt_flows}= Evaluate 2 * ( ${num_onus} - 1 ) + 1 |
| 129 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows} |
| 130 | # Verify VOLTHA flows for ONU under test is Zero |
| 131 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows |
| 132 | ... ${onu_device_id} 0 |
| 133 | # Disable and Re-Enable the ONU (To replicate DT current workflow) |
| 134 | # TODO: Delete and Auto-Discovery Add of ONU (not yet supported) |
| 135 | Disable Device ${onu_device_id} |
| 136 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 137 | ... Validate Device DISABLED UNKNOWN |
| 138 | ... REACHABLE ${src['onu']} |
| 139 | Enable Device ${onu_device_id} |
| 140 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 141 | ... Validate Device ENABLED ACTIVE |
| 142 | ... REACHABLE ${src['onu']} |
| 143 | # Add Subscriber Access |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 144 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP} |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 145 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 146 | Sleep 10s |
Hardik Windlass | fb5eace | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 147 | # Verify subscriber access flows are added for the ONU port |
| 148 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
Hardik Windlass | 25e1170 | 2020-03-30 20:05:19 +0530 | [diff] [blame] | 149 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 150 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 151 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 152 | ... Validate Device ENABLED ACTIVE |
| 153 | ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed |
Hardik Windlass | fb5eace | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 154 | # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652) |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 155 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 156 | ... Wait Until Keyword Succeeds 60s 2s |
| 157 | ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 158 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 159 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 160 | Run Keyword and Ignore Error Collect Logs |
| 161 | END |
Hardik Windlass | fb5eace | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 162 | # Verify ONOS Flows |
| 163 | # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream) |
| 164 | ${onos_flows_count}= Evaluate 4 * ${num_onus} |
| 165 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
Hardik Windlass | 25e1170 | 2020-03-30 20:05:19 +0530 | [diff] [blame] | 166 | ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 167 | ... ${of_id} ${onos_flows_count} |
Hardik Windlass | fb5eace | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 168 | # Verify VOLTHA Flows |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 169 | # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP |
| 170 | ${olt_flows}= Evaluate 2 * ${num_onus} + 1 |
| 171 | # Number of per ONU Flows equals 2 (one each for downstream and upstream) |
| 172 | ${onu_flows}= Set Variable 2 |
| 173 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows} |
| 174 | ${List_ONU_Serial} Create List |
| 175 | Set Suite Variable ${List_ONU_Serial} |
| 176 | Build ONU SN List ${List_ONU_Serial} |
| 177 | Log ${List_ONU_Serial} |
| 178 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows |
| 179 | ... ${List_ONU_Serial} ${onu_flows} |
| 180 | |
Hardik Windlass | 63d5e00 | 2020-03-06 21:07:09 +0530 | [diff] [blame] | 181 | Test Disable and Enable ONU for DT |
| 182 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 183 | ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed) |
| 184 | ... Perform disable on the ONUs and validate that the pings do not succeed |
| 185 | ... Perform enable on the ONUs and validate that the pings are successful |
Suchitra Vemuri | f2388ad | 2020-03-15 21:44:44 -0700 | [diff] [blame] | 186 | [Tags] functionalDt DisableEnableONUDt |
Andy Bavier | e187eda | 2020-04-20 15:00:02 -0700 | [diff] [blame] | 187 | [Setup] Start Logging DisableEnableONUDt |
Hardik Windlass | 63d5e00 | 2020-03-06 21:07:09 +0530 | [diff] [blame] | 188 | [Teardown] Run Keywords Collect Logs |
| 189 | ... AND Stop Logging DisableEnableONUDt |
Hardik Windlass | 63d5e00 | 2020-03-06 21:07:09 +0530 | [diff] [blame] | 190 | FOR ${I} IN RANGE 0 ${num_onus} |
| 191 | ${src}= Set Variable ${hosts.src[${I}]} |
| 192 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 193 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 194 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 195 | ... ${of_id} |
| 196 | Disable Device ${onu_device_id} |
| 197 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 198 | ... Validate Device DISABLED UNKNOWN |
| 199 | ... REACHABLE ${src['onu']} onu=True onu_reason=omci-admin-lock |
| 200 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
Suchitra Vemuri | 760bdd3 | 2020-06-17 12:34:48 -0700 | [diff] [blame] | 201 | ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Hardik Windlass | fb5eace | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 202 | # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652) |
Hardik Windlass | 63d5e00 | 2020-03-06 21:07:09 +0530 | [diff] [blame] | 203 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 204 | ... Wait Until Keyword Succeeds 60s 2s |
| 205 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 206 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 207 | Sleep 5s |
| 208 | Enable Device ${onu_device_id} |
| 209 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 210 | ... Validate Device ENABLED ACTIVE |
| 211 | ... REACHABLE ${src['onu']} onu=True onu_reason=onu-reenabled |
| 212 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
Suchitra Vemuri | 760bdd3 | 2020-06-17 12:34:48 -0700 | [diff] [blame] | 213 | ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Hardik Windlass | fb5eace | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 214 | # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652) |
Hardik Windlass | 63d5e00 | 2020-03-06 21:07:09 +0530 | [diff] [blame] | 215 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 216 | ... Wait Until Keyword Succeeds 60s 2s |
| 217 | ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 218 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 219 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 220 | Run Keyword and Ignore Error Collect Logs |
| 221 | END |
| 222 | |
Hardik Windlass | aaea340 | 2020-03-10 19:45:45 +0530 | [diff] [blame] | 223 | Test Disable and Delete OLT for DT |
| 224 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 225 | ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed) |
| 226 | ... Perform disable on the OLT and validate ONUs state and that the pings do not succeed |
| 227 | ... Perform delete on the OLT, Re-do Setup (Recreate the OLT) and Perform Sanity Test DT |
Suchitra Vemuri | f2388ad | 2020-03-15 21:44:44 -0700 | [diff] [blame] | 228 | [Tags] functionalDt DisableDeleteOLTDt |
Suchitra Vemuri | 221398a | 2020-05-29 22:45:17 -0700 | [diff] [blame] | 229 | [Setup] Start Logging DisableDeleteOLTDt |
Hardik Windlass | aaea340 | 2020-03-10 19:45:45 +0530 | [diff] [blame] | 230 | [Teardown] Run Keywords Collect Logs |
| 231 | ... AND Stop Logging DisableDeleteOLTDt |
Hardik Windlass | aaea340 | 2020-03-10 19:45:45 +0530 | [diff] [blame] | 232 | # Disable and Validate OLT Device |
| 233 | Disable Device ${olt_device_id} |
| 234 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 235 | ... Validate OLT Device DISABLED UNKNOWN REACHABLE |
| 236 | ... ${olt_serial_number} |
| 237 | # Validate ONUs |
| 238 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONUs After OLT Disable |
Hardik Windlass | fb5eace | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 239 | # Verify ONOS Flows |
| 240 | # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream) |
| 241 | ${onos_flows_count}= Evaluate 4 * ${num_onus} |
| 242 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
Hardik Windlass | 25e1170 | 2020-03-30 20:05:19 +0530 | [diff] [blame] | 243 | ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 244 | ... ${of_id} ${onos_flows_count} |
Hardik Windlass | fb5eace | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 245 | # Verify VOLTHA Flows |
Hardik Windlass | aaea340 | 2020-03-10 19:45:45 +0530 | [diff] [blame] | 246 | # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP |
| 247 | ${olt_flows}= Evaluate 2 * ${num_onus} + 1 |
| 248 | # Number of per ONU Flows equals 2 (one each for downstream and upstream) |
| 249 | ${onu_flows}= Set Variable 2 |
| 250 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows} |
| 251 | ${List_ONU_Serial} Create List |
| 252 | Set Suite Variable ${List_ONU_Serial} |
| 253 | Build ONU SN List ${List_ONU_Serial} |
| 254 | Log ${List_ONU_Serial} |
| 255 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows |
| 256 | ... ${List_ONU_Serial} ${onu_flows} |
| 257 | # Delete OLT and Validate Empty Device List |
| 258 | Delete Device ${olt_device_id} |
| 259 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List |
Hardik Windlass | 480f3e2 | 2020-04-02 20:14:14 +0530 | [diff] [blame] | 260 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 261 | ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
Hardik Windlass | aaea340 | 2020-03-10 19:45:45 +0530 | [diff] [blame] | 262 | Run Keyword and Ignore Error Collect Logs |
| 263 | # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT |
| 264 | Run Keyword Setup |
| 265 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
Suchitra Vemuri | ae9cecb | 2020-03-12 12:59:14 -0700 | [diff] [blame] | 266 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | aaea340 | 2020-03-10 19:45:45 +0530 | [diff] [blame] | 267 | |
Hardik Windlass | 3b531fa | 2020-04-23 18:51:44 +0530 | [diff] [blame] | 268 | Test Disable and Enable OLT for DT |
| 269 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 270 | ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed) |
| 271 | ... Perform disable on the OLT and validate that the pings do not succeed |
| 272 | ... Perform enable on the OLT and validate that the pings are successful |
Suchitra Vemuri | 221398a | 2020-05-29 22:45:17 -0700 | [diff] [blame] | 273 | [Tags] functionalDt DisableEnableOLTDt notready |
Hardik Windlass | 3b531fa | 2020-04-23 18:51:44 +0530 | [diff] [blame] | 274 | [Setup] Start Logging DisableEnableOLTDt |
| 275 | [Teardown] Run Keywords Collect Logs |
| 276 | ... AND Stop Logging DisableEnableOLTDt |
| 277 | # Disable and Validate OLT Device |
| 278 | Disable Device ${olt_device_id} |
| 279 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 280 | ... Validate OLT Device DISABLED UNKNOWN REACHABLE |
| 281 | ... ${olt_serial_number} |
Hardik Windlass | 7c801e6 | 2020-05-04 19:33:21 +0530 | [diff] [blame] | 282 | FOR ${I} IN RANGE 0 ${num_onus} |
| 283 | ${src}= Set Variable ${hosts.src[${I}]} |
| 284 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 285 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 286 | ${onu_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 287 | ... Get ONU Port in ONOS ${src['onu']} ${of_id} |
| 288 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
Suchitra Vemuri | 760bdd3 | 2020-06-17 12:34:48 -0700 | [diff] [blame] | 289 | ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Hardik Windlass | 7c801e6 | 2020-05-04 19:33:21 +0530 | [diff] [blame] | 290 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 291 | ... Wait Until Keyword Succeeds 60s 2s |
| 292 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 293 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 294 | # Remove Subscriber Access (To replicate DT workflow) |
| 295 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${ONOS_SSH_IP} |
| 296 | ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port} |
| 297 | # Delete ONU Device (To replicate DT workflow) |
| 298 | Delete Device ${onu_device_id} |
| 299 | END |
| 300 | Sleep 15s |
Hardik Windlass | 3b531fa | 2020-04-23 18:51:44 +0530 | [diff] [blame] | 301 | # Enable the OLT back and check ONU, OLT status are back to "ACTIVE" |
| 302 | Enable Device ${olt_device_id} |
| 303 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE |
| 304 | ... ${olt_serial_number} |
| 305 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Port Types |
| 306 | ... PON_OLT ETHERNET_NNI |
Hardik Windlass | 7c801e6 | 2020-05-04 19:33:21 +0530 | [diff] [blame] | 307 | # Waiting extra time for the ONUs to come up |
| 308 | Sleep 60s |
| 309 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 310 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
Hardik Windlass | 3b531fa | 2020-04-23 18:51:44 +0530 | [diff] [blame] | 311 | |
| 312 | Test Delete and ReAdd OLT for DT |
| 313 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 314 | ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed) |
| 315 | ... Disable and Delete the OLT |
| 316 | ... Create/Enable the same OLT again |
| 317 | ... Validate DHCP/E2E pings succeed for all the ONUs connected to the OLT |
| 318 | [Tags] functionalDt DeleteReAddOLTDt |
| 319 | [Setup] Start Logging DeleteReAddOLTDt |
| 320 | [Teardown] Run Keywords Collect Logs |
| 321 | ... AND Stop Logging DeleteReAddOLTDt |
| 322 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 323 | Delete Device and Verify |
| 324 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 325 | ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 326 | Run Keyword and Ignore Error Collect Logs |
| 327 | # Recreate the OLT |
| 328 | Setup |
| 329 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 330 | |
| 331 | Test Disable ONUs and OLT Then Delete ONUs and OLT for DT |
| 332 | [Documentation] On deployed POD, disable the ONU, disable the OLT and then delete ONU and OLT. |
| 333 | ... This TC is to confirm that ONU removal is not impacting OLT |
| 334 | ... Devices will be removed during the execution of this TC |
| 335 | ... so calling setup at the end to add the devices back to avoid the confusion. |
| 336 | [Tags] functionalDt DisableDeleteONUOLTDt |
| 337 | [Setup] Start Logging DisableDeleteONUOLTDt |
| 338 | [Teardown] Run Keywords Collect Logs |
| 339 | ... AND Stop Logging DisableDeleteONUOLTDt |
| 340 | ${olt_device_id}= Get Device ID From SN ${olt_serial_number} |
| 341 | FOR ${I} IN RANGE 0 ${num_onus} |
| 342 | ${src}= Set Variable ${hosts.src[${I}]} |
| 343 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 344 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 345 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 346 | ... Validate Device ENABLED ACTIVE |
| 347 | ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 348 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 349 | ... Validate OLT Device ENABLED ACTIVE |
| 350 | ... REACHABLE ${olt_serial_number} |
| 351 | Disable Device ${onu_device_id} |
| 352 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 353 | ... Validate Device DISABLED UNKNOWN |
| 354 | ... REACHABLE ${src['onu']} onu=false |
| 355 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 356 | ... Validate OLT Device ENABLED ACTIVE |
| 357 | ... REACHABLE ${olt_serial_number} |
| 358 | END |
| 359 | Disable Device ${olt_device_id} |
| 360 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 361 | ... Validate OLT Device DISABLED UNKNOWN REACHABLE |
| 362 | ... ${olt_serial_number} |
| 363 | FOR ${I} IN RANGE 0 ${num_onus} |
| 364 | ${src}= Set Variable ${hosts.src[${I}]} |
| 365 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 366 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 367 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 368 | ... Validate Device DISABLED DISCOVERED |
| 369 | ... UNREACHABLE ${src['onu']} onu=false |
| 370 | Delete Device ${onu_device_id} |
| 371 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 372 | ... Validate OLT Device DISABLED UNKNOWN |
| 373 | ... REACHABLE ${olt_serial_number} |
| 374 | END |
| 375 | Delete Device ${olt_device_id} |
| 376 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List |
| 377 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 378 | ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 379 | # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT |
| 380 | Run Keyword Setup |
| 381 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 382 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 383 | |
Andy Bavier | e19991a | 2020-05-08 10:42:40 -0700 | [diff] [blame] | 384 | Data plane verification using TCP for DT |
| 385 | [Documentation] Test bandwidth profile is met and not exceeded for each subscriber. |
| 386 | ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server |
Andy Bavier | 1b144eb | 2020-05-28 11:22:11 -0700 | [diff] [blame] | 387 | [Tags] dataplaneDt BandwidthProfileTCPDt VOL-3061 notready |
Andy Bavier | dfbcaef | 2020-05-27 15:34:18 -0700 | [diff] [blame] | 388 | [Setup] Start Logging BandwidthProfileTCPDt |
| 389 | [Teardown] Run Keywords Collect Logs |
| 390 | ... AND Stop Logging BandwidthProfileTCPDt |
Andy Bavier | e19991a | 2020-05-08 10:42:40 -0700 | [diff] [blame] | 391 | Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in |
| 392 | ... physical pod. Skipping this test in BBSIM. |
Andy Bavier | d74f33c | 2020-05-12 12:45:36 -0700 | [diff] [blame] | 393 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number} |
Andy Bavier | e19991a | 2020-05-08 10:42:40 -0700 | [diff] [blame] | 394 | FOR ${I} IN RANGE 0 ${num_onus} |
| 395 | ${src}= Set Variable ${hosts.src[${I}]} |
| 396 | ${dst}= Set Variable ${hosts.dst[${I}]} |
Andy Bavier | f6ab19c | 2020-05-14 10:34:47 -0700 | [diff] [blame] | 397 | |
| 398 | # Check for iperf3 and jq tools |
| 399 | ${stdout} ${stderr} ${rc}= Execute Remote Command which iperf3 jq |
| 400 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 401 | Pass Execution If ${rc} != 0 Skipping test: iperf3 / jq not found on the RG |
| 402 | |
Andy Bavier | e19991a | 2020-05-08 10:42:40 -0700 | [diff] [blame] | 403 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 404 | ... ${of_id} |
| 405 | ${subscriber_id}= Set Variable ${of_id}/${onu_port} |
| 406 | ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} |
| 407 | ... upstreamBandwidthProfile |
| 408 | ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name} |
| 409 | ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} |
| 410 | ... downstreamBandwidthProfile |
| 411 | ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name} |
| 412 | |
| 413 | # Stream TCP packets from RG to server |
| 414 | ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']} |
| 415 | ... args=-t 30 |
| 416 | ${actual_upstream_bw_used}= Evaluate ${updict['end']['sum_received']['bits_per_second']}/1000 |
| 417 | |
| 418 | # Stream TCP packets from server to RG |
| 419 | ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']} |
| 420 | ... args=-R -t 30 |
| 421 | ${actual_dnstream_bw_used}= Evaluate ${dndict['end']['sum_received']['bits_per_second']}/1000 |
| 422 | |
| 423 | ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream} |
| 424 | ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream} |
| 425 | Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%) |
| 426 | Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%) |
| 427 | |
| 428 | Should Be True ${pct_limit_up} <= ${upper_margin_pct} |
| 429 | ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit) |
| 430 | Should Be True ${pct_limit_dn} <= ${upper_margin_pct} |
| 431 | ... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit) |
| 432 | Should Be True ${pct_limit_up} >= ${lower_margin_pct} |
| 433 | ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv) |
| 434 | Should Be True ${pct_limit_dn} >= ${lower_margin_pct} |
| 435 | ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv) |
| 436 | END |
| 437 | |
| 438 | Data plane verification using UDP for DT |
| 439 | [Documentation] Test bandwidth profile is met and not exceeded for each subscriber. |
| 440 | ... Assumes iperf3 and jq installed on client and iperf -s running on DHCP server |
Andy Bavier | dfbcaef | 2020-05-27 15:34:18 -0700 | [diff] [blame] | 441 | [Tags] dataplaneDt BandwidthProfileUDPDt VOL-3061 notready |
| 442 | [Setup] Start Logging BandwidthProfileUDPDt |
| 443 | [Teardown] Run Keywords Collect Logs |
| 444 | ... AND Stop Logging BandwidthProfileUDPDt |
Andy Bavier | e19991a | 2020-05-08 10:42:40 -0700 | [diff] [blame] | 445 | Pass Execution If '${has_dataplane}'=='False' Bandwidth profile validation can be done only in |
| 446 | ... physical pod. Skipping this test in BBSIM. |
Andy Bavier | d74f33c | 2020-05-12 12:45:36 -0700 | [diff] [blame] | 447 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS ${olt_serial_number} |
Andy Bavier | e19991a | 2020-05-08 10:42:40 -0700 | [diff] [blame] | 448 | FOR ${I} IN RANGE 0 ${num_onus} |
| 449 | ${src}= Set Variable ${hosts.src[${I}]} |
| 450 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 451 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 452 | ... ${of_id} |
| 453 | ${subscriber_id}= Set Variable ${of_id}/${onu_port} |
| 454 | ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} |
| 455 | ... upstreamBandwidthProfile |
| 456 | ${limiting_bw_value_upstream} Get Bandwidth Details ${bandwidth_profile_name} |
| 457 | ${bandwidth_profile_name} Get Bandwidth Profile Name For Given Subscriber ${subscriber_id} |
| 458 | ... downstreamBandwidthProfile |
| 459 | ${limiting_bw_value_dnstream} Get Bandwidth Details ${bandwidth_profile_name} |
| 460 | |
| 461 | # Stream UDP packets from RG to server |
| 462 | ${uprate}= Evaluate ${limiting_bw_value_upstream}*${udp_rate_multiplier} |
| 463 | ${updict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']} |
Andy Bavier | 7dc5062 | 2020-05-28 14:34:12 -0700 | [diff] [blame] | 464 | ... args=-u -b ${uprate}K -t 30 -l ${udp_packet_bytes} --pacing-timer 0 |
Andy Bavier | e19991a | 2020-05-08 10:42:40 -0700 | [diff] [blame] | 465 | # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput. |
| 466 | ${actual_upstream_bw_used}= Evaluate |
| 467 | ... (100 - ${updict['end']['sum']['lost_percent']})*${updict['end']['sum']['bits_per_second']}/100000 |
| 468 | |
| 469 | # Stream UDP packets from server to RG |
| 470 | ${dnrate}= Evaluate ${limiting_bw_value_dnstream}*${udp_rate_multiplier} |
| 471 | ${dndict}= Run Iperf3 Test Client ${src} server=${dst['dp_iface_ip_qinq']} |
Andy Bavier | 7dc5062 | 2020-05-28 14:34:12 -0700 | [diff] [blame] | 472 | ... args=-u -b ${dnrate}K -R -t 30 -l ${udp_packet_bytes} --pacing-timer 0 |
Andy Bavier | e19991a | 2020-05-08 10:42:40 -0700 | [diff] [blame] | 473 | # With UDP test, bits per second is the sending rate. Multiply by the loss rate to get the throughput. |
| 474 | ${actual_dnstream_bw_used}= Evaluate |
| 475 | ... (100 - ${dndict['end']['sum']['lost_percent']})*${dndict['end']['sum']['bits_per_second']}/100000 |
| 476 | |
| 477 | ${pct_limit_up}= Evaluate 100*${actual_upstream_bw_used}/${limiting_bw_value_upstream} |
| 478 | ${pct_limit_dn}= Evaluate 100*${actual_dnstream_bw_used}/${limiting_bw_value_dnstream} |
| 479 | Log Up: bwprof ${limiting_bw_value_upstream}Kbps, got ${actual_upstream_bw_used}Kbps (${pct_limit_up}%) |
| 480 | Log Down: bwprof ${limiting_bw_value_dnstream}Kbps, got ${actual_dnstream_bw_used}Kbps (${pct_limit_dn}%) |
| 481 | |
| 482 | Should Be True ${pct_limit_up} <= ${upper_margin_pct} |
| 483 | ... The upstream bandwidth exceeded the limit (${pct_limit_up}% of limit) |
| 484 | Should Be True ${pct_limit_dn} <= ${upper_margin_pct} |
| 485 | ... The downstream bandwidth exceeded the limit (${pct_limit_dn}% of limit) |
| 486 | Should Be True ${pct_limit_up} >= ${lower_margin_pct} |
| 487 | ... The upstream bandwidth guarantee was not met (${pct_limit_up}% of resv) |
| 488 | Should Be True ${pct_limit_dn} >= ${lower_margin_pct} |
| 489 | ... The downstream bandwidth guarantee was not met (${pct_limit_dn}% of resv) |
| 490 | END |
| 491 | |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 492 | *** Keywords *** |
| 493 | Setup Suite |
| 494 | [Documentation] Set up the test suite |
| 495 | Common Test Suite Setup |
Hung-Wei Chiu | cc6e655 | 2020-06-04 12:57:38 -0700 | [diff] [blame] | 496 | #Restore all ONUs |
Suchitra Vemuri | 1d8e817 | 2020-06-17 17:43:56 -0700 | [diff] [blame] | 497 | #Run Keyword If ${has_dataplane} RestoreONUs ${num_onus} |
| 498 | #power_switch.robot needs it to support different vendor's power switch |
| 499 | ${switch_type}= Get Variable Value ${web_power_switch.type} |
| 500 | Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type} |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 501 | |
| 502 | Clear All Devices Then Create New Device |
| 503 | [Documentation] Remove any devices from VOLTHA and ONOS |
| 504 | # Remove all devices from voltha and nos |
| 505 | Delete All Devices and Verify |
| 506 | # Execute normal test Setup Keyword |
| 507 | Setup |
| 508 | |