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 |
| 34 | |
| 35 | *** Variables *** |
| 36 | ${POD_NAME} flex-ocp-cord |
| 37 | ${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 38 | ${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs |
| 39 | #${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 40 | ${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml |
| 41 | ${HELM_CHARTS_DIR} ~/helm-charts |
| 42 | ${VOLTHA_POD_NUM} 8 |
| 43 | ${NAMESPACE} voltha |
| 44 | # For below variable value, using deployment name as using grep for |
| 45 | # parsing radius pod name, we can also use full radius pod name |
| 46 | ${RESTART_POD_NAME} radius |
| 47 | ${timeout} 60s |
| 48 | ${of_id} 0 |
| 49 | ${logical_id} 0 |
| 50 | ${has_dataplane} True |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 51 | ${teardown_device} False |
| 52 | ${scripts} ../../scripts |
| 53 | |
| 54 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 55 | ${container_log_dir} ${None} |
| 56 | |
| 57 | *** Test Cases *** |
| 58 | Sanity E2E Test for OLT/ONU on POD for DT |
| 59 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 60 | ... Validate successful DHCP/E2E ping (no EAPOL and DHCP flows) for the tech profile that is used |
| 61 | ... Traffic sent with same vlan from different RGs, |
| 62 | ... should reach the NNI port on the OLT with the expected double tagged vlan ids |
| 63 | ... Inner vlans from the RG should not change |
Suchitra Vemuri | f2388ad | 2020-03-15 21:44:44 -0700 | [diff] [blame] | 64 | [Tags] sanityDt |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 65 | [Setup] Run Keywords Announce Message START TEST SanityTestDt |
| 66 | ... AND Start Logging SanityTestDt |
| 67 | ... AND Setup |
| 68 | [Teardown] Run Keywords Collect Logs |
| 69 | ... AND Stop Logging SanityTestDt |
| 70 | ... AND Announce Message END TEST SanityTestDt |
| 71 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 72 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 73 | |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 74 | Test Subscriber Delete and Add for DT |
| 75 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
Hardik Windlass | 63d5e00 | 2020-03-06 21:07:09 +0530 | [diff] [blame] | 76 | ... 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] | 77 | ... Delete a subscriber and validate that the pings do not succeed and state is purged |
| 78 | ... Disable and Enable the ONU (This is to replicate the existing DT behaviour) |
| 79 | ... 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] | 80 | [Tags] functionalDt SubAddDeleteDt |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 81 | [Setup] Run Keywords Announce Message START TEST SubAddDeleteDt |
| 82 | ... AND Start Logging SubAddDeleteDt |
| 83 | [Teardown] Run Keywords Collect Logs |
| 84 | ... AND Stop Logging SubAddDeleteDt |
| 85 | ... AND Announce Message END TEST SubAddDeleteDt |
| 86 | FOR ${I} IN RANGE 0 ${num_onus} |
| 87 | ${src}= Set Variable ${hosts.src[${I}]} |
| 88 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 89 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 90 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 91 | ... ${of_id} |
| 92 | # Remove Subscriber Access |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 93 | 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] | 94 | ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port} |
| 95 | Sleep 10s |
Hardik Windlass | 59a759f | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 96 | # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652) |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 97 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 98 | ... Wait Until Keyword Succeeds 60s 2s |
| 99 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 100 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
Hardik Windlass | 59a759f | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 101 | # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream) |
| 102 | ${onos_flows_count}= Evaluate 4 * ( ${num_onus} - 1 ) |
| 103 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 104 | ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
Hardik Windlass | f187a87 | 2020-03-30 20:05:19 +0530 | [diff] [blame] | 105 | ... ${of_id} ${onos_flows_count} |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 106 | # Verify VOLTHA flows for OLT equals twice the number of ONUS (minus ONU under test) + 1 for LLDP |
| 107 | ${olt_flows}= Evaluate 2 * ( ${num_onus} - 1 ) + 1 |
| 108 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows} |
| 109 | # Verify VOLTHA flows for ONU under test is Zero |
| 110 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows |
| 111 | ... ${onu_device_id} 0 |
| 112 | # Disable and Re-Enable the ONU (To replicate DT current workflow) |
| 113 | # TODO: Delete and Auto-Discovery Add of ONU (not yet supported) |
| 114 | Disable Device ${onu_device_id} |
| 115 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 116 | ... Validate Device DISABLED UNKNOWN |
| 117 | ... REACHABLE ${src['onu']} |
| 118 | Enable Device ${onu_device_id} |
| 119 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 120 | ... Validate Device ENABLED ACTIVE |
| 121 | ... REACHABLE ${src['onu']} |
| 122 | # Add Subscriber Access |
ubuntu | 6b6e7d4 | 2020-03-02 12:35:42 -0800 | [diff] [blame] | 123 | 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] | 124 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 125 | Sleep 10s |
Hardik Windlass | 59a759f | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 126 | # Verify subscriber access flows are added for the ONU port |
| 127 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
Hardik Windlass | f187a87 | 2020-03-30 20:05:19 +0530 | [diff] [blame] | 128 | ... Verify Subscriber Access Flows Added For ONU DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
| 129 | ... ${onu_port} ${nni_port} ${src['s_tag']} |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 130 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 131 | ... Validate Device ENABLED ACTIVE |
| 132 | ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed |
Hardik Windlass | 59a759f | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 133 | # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652) |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 134 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 135 | ... Wait Until Keyword Succeeds 60s 2s |
| 136 | ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 137 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 138 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 139 | Run Keyword and Ignore Error Collect Logs |
| 140 | END |
Hardik Windlass | 59a759f | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 141 | # Verify ONOS Flows |
| 142 | # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream) |
| 143 | ${onos_flows_count}= Evaluate 4 * ${num_onus} |
| 144 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
Hardik Windlass | f187a87 | 2020-03-30 20:05:19 +0530 | [diff] [blame] | 145 | ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 146 | ... ${of_id} ${onos_flows_count} |
Hardik Windlass | 59a759f | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 147 | # Verify VOLTHA Flows |
Hardik Windlass | 35706ba | 2020-02-20 08:16:42 +0000 | [diff] [blame] | 148 | # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP |
| 149 | ${olt_flows}= Evaluate 2 * ${num_onus} + 1 |
| 150 | # Number of per ONU Flows equals 2 (one each for downstream and upstream) |
| 151 | ${onu_flows}= Set Variable 2 |
| 152 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows} |
| 153 | ${List_ONU_Serial} Create List |
| 154 | Set Suite Variable ${List_ONU_Serial} |
| 155 | Build ONU SN List ${List_ONU_Serial} |
| 156 | Log ${List_ONU_Serial} |
| 157 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows |
| 158 | ... ${List_ONU_Serial} ${onu_flows} |
| 159 | |
Hardik Windlass | 63d5e00 | 2020-03-06 21:07:09 +0530 | [diff] [blame] | 160 | Test Disable and Enable ONU for DT |
| 161 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 162 | ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed) |
| 163 | ... Perform disable on the ONUs and validate that the pings do not succeed |
| 164 | ... Perform enable on the ONUs and validate that the pings are successful |
Suchitra Vemuri | f2388ad | 2020-03-15 21:44:44 -0700 | [diff] [blame] | 165 | [Tags] functionalDt DisableEnableONUDt |
Hardik Windlass | 63d5e00 | 2020-03-06 21:07:09 +0530 | [diff] [blame] | 166 | [Setup] Run Keywords Announce Message START TEST DisableEnableONUDt |
| 167 | ... AND Start Logging DisableEnableONUDt |
| 168 | [Teardown] Run Keywords Collect Logs |
| 169 | ... AND Stop Logging DisableEnableONUDt |
| 170 | ... AND Announce Message END TEST DisableEnableONUDt |
| 171 | FOR ${I} IN RANGE 0 ${num_onus} |
| 172 | ${src}= Set Variable ${hosts.src[${I}]} |
| 173 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 174 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 175 | ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']} |
| 176 | ... ${of_id} |
| 177 | Disable Device ${onu_device_id} |
| 178 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 179 | ... Validate Device DISABLED UNKNOWN |
| 180 | ... REACHABLE ${src['onu']} onu=True onu_reason=omci-admin-lock |
| 181 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
Suchitra Vemuri | 1ed9be7 | 2020-06-18 11:22:18 -0700 | [diff] [blame] | 182 | ... Verify ONU Port Is Disabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Hardik Windlass | 59a759f | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 183 | # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652) |
Hardik Windlass | 63d5e00 | 2020-03-06 21:07:09 +0530 | [diff] [blame] | 184 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 185 | ... Wait Until Keyword Succeeds 60s 2s |
| 186 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 187 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 188 | Sleep 5s |
| 189 | Enable Device ${onu_device_id} |
| 190 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 191 | ... Validate Device ENABLED ACTIVE |
| 192 | ... REACHABLE ${src['onu']} onu=True onu_reason=onu-reenabled |
| 193 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
Suchitra Vemuri | 1ed9be7 | 2020-06-18 11:22:18 -0700 | [diff] [blame] | 194 | ... Verify ONU Port Is Enabled ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${src['onu']} |
Hardik Windlass | 59a759f | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 195 | # TODO: Yet to Verify on the GPON based Physical POD (VOL-2652) |
Hardik Windlass | 63d5e00 | 2020-03-06 21:07:09 +0530 | [diff] [blame] | 196 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 197 | ... Wait Until Keyword Succeeds 60s 2s |
| 198 | ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 199 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 200 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 201 | Run Keyword and Ignore Error Collect Logs |
| 202 | END |
| 203 | |
Hardik Windlass | aaea340 | 2020-03-10 19:45:45 +0530 | [diff] [blame] | 204 | Test Disable and Delete OLT for DT |
| 205 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 206 | ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed) |
| 207 | ... Perform disable on the OLT and validate ONUs state and that the pings do not succeed |
| 208 | ... 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] | 209 | [Tags] functionalDt DisableDeleteOLTDt |
Hardik Windlass | aaea340 | 2020-03-10 19:45:45 +0530 | [diff] [blame] | 210 | [Setup] Run Keywords Announce Message START TEST DisableDeleteOLTDt |
| 211 | ... AND Start Logging DisableDeleteOLTDt |
| 212 | [Teardown] Run Keywords Collect Logs |
| 213 | ... AND Stop Logging DisableDeleteOLTDt |
| 214 | ... AND Announce Message END TEST DisableDeleteOLTDt |
| 215 | # Disable and Validate OLT Device |
| 216 | Disable Device ${olt_device_id} |
| 217 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 218 | ... Validate OLT Device DISABLED UNKNOWN REACHABLE |
| 219 | ... ${olt_serial_number} |
| 220 | # Validate ONUs |
| 221 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONUs After OLT Disable |
Hardik Windlass | 59a759f | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 222 | # Verify ONOS Flows |
| 223 | # Number of Access Flows on ONOS equals 4 * the Number of Active ONUs (2 for each downstream and upstream) |
| 224 | ${onos_flows_count}= Evaluate 4 * ${num_onus} |
| 225 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
Hardik Windlass | f187a87 | 2020-03-30 20:05:19 +0530 | [diff] [blame] | 226 | ... Verify Subscriber Access Flows Added Count DT ${ONOS_SSH_IP} ${ONOS_SSH_PORT} |
| 227 | ... ${of_id} ${onos_flows_count} |
Hardik Windlass | 59a759f | 2020-03-26 14:49:01 +0530 | [diff] [blame] | 228 | # Verify VOLTHA Flows |
Hardik Windlass | aaea340 | 2020-03-10 19:45:45 +0530 | [diff] [blame] | 229 | # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP |
| 230 | ${olt_flows}= Evaluate 2 * ${num_onus} + 1 |
| 231 | # Number of per ONU Flows equals 2 (one each for downstream and upstream) |
| 232 | ${onu_flows}= Set Variable 2 |
| 233 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows} |
| 234 | ${List_ONU_Serial} Create List |
| 235 | Set Suite Variable ${List_ONU_Serial} |
| 236 | Build ONU SN List ${List_ONU_Serial} |
| 237 | Log ${List_ONU_Serial} |
| 238 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows |
| 239 | ... ${List_ONU_Serial} ${onu_flows} |
| 240 | # Delete OLT and Validate Empty Device List |
| 241 | Delete Device ${olt_device_id} |
| 242 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Test Empty Device List |
Hardik Windlass | b80b25b | 2020-04-02 20:14:14 +0530 | [diff] [blame] | 243 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 244 | ... Verify Device Flows Removed ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${of_id} |
Hardik Windlass | aaea340 | 2020-03-10 19:45:45 +0530 | [diff] [blame] | 245 | Run Keyword and Ignore Error Collect Logs |
| 246 | # Re-do Setup (Recreate the OLT) and Perform Sanity Test DT |
| 247 | Run Keyword Setup |
| 248 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
Suchitra Vemuri | ae9cecb | 2020-03-12 12:59:14 -0700 | [diff] [blame] | 249 | Run Keyword If ${has_dataplane} Clean Up Linux |
Hardik Windlass | aaea340 | 2020-03-10 19:45:45 +0530 | [diff] [blame] | 250 | |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 251 | *** Keywords *** |
| 252 | Setup Suite |
| 253 | [Documentation] Set up the test suite |
| 254 | Common Test Suite Setup |
Hung-Wei Chiu | 228d7ae | 2020-05-29 22:16:56 +0000 | [diff] [blame] | 255 | #Restore all ONUs |
Hung-Wei Chiu | 5a2a55f | 2020-06-19 10:29:53 -0700 | [diff] [blame] | 256 | #Run Keyword If ${has_dataplane} RestoreONUs ${num_onus} |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 257 | |
| 258 | Clear All Devices Then Create New Device |
| 259 | [Documentation] Remove any devices from VOLTHA and ONOS |
| 260 | # Remove all devices from voltha and nos |
| 261 | Delete All Devices and Verify |
| 262 | # Execute normal test Setup Keyword |
| 263 | Setup |
| 264 | |