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 |
| 64 | [Tags] sanityDt bbsim test1 |
| 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: |
| 76 | ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming test1 was executed) |
| 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 |
| 80 | [Tags] functionalDt SubAddDeleteDt bbsim released |
| 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 |
| 93 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip} |
| 94 | ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port} |
| 95 | Sleep 10s |
| 96 | # TODO: Yet to Verify on the Physical POD |
| 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']} |
| 101 | # Verify VOLTHA flows for OLT equals twice the number of ONUS (minus ONU under test) + 1 for LLDP |
| 102 | ${olt_flows}= Evaluate 2 * ( ${num_onus} - 1 ) + 1 |
| 103 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows} |
| 104 | # Verify VOLTHA flows for ONU under test is Zero |
| 105 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows |
| 106 | ... ${onu_device_id} 0 |
| 107 | # Disable and Re-Enable the ONU (To replicate DT current workflow) |
| 108 | # TODO: Delete and Auto-Discovery Add of ONU (not yet supported) |
| 109 | Disable Device ${onu_device_id} |
| 110 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 111 | ... Validate Device DISABLED UNKNOWN |
| 112 | ... REACHABLE ${src['onu']} |
| 113 | Enable Device ${onu_device_id} |
| 114 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 115 | ... Validate Device ENABLED ACTIVE |
| 116 | ... REACHABLE ${src['onu']} |
| 117 | # Add Subscriber Access |
| 118 | Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip} |
| 119 | ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
| 120 | Sleep 10s |
| 121 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s |
| 122 | ... Validate Device ENABLED ACTIVE |
| 123 | ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed |
| 124 | # TODO: Yet to Verify on the Physical POD |
| 125 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 126 | ... Wait Until Keyword Succeeds 60s 2s |
| 127 | ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 128 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 129 | Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id} |
| 130 | Run Keyword and Ignore Error Collect Logs |
| 131 | END |
| 132 | # Verify VOLTHA Flows (TODO: Add verification for ONOS Flows) |
| 133 | # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP |
| 134 | ${olt_flows}= Evaluate 2 * ${num_onus} + 1 |
| 135 | # Number of per ONU Flows equals 2 (one each for downstream and upstream) |
| 136 | ${onu_flows}= Set Variable 2 |
| 137 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows} |
| 138 | ${List_ONU_Serial} Create List |
| 139 | Set Suite Variable ${List_ONU_Serial} |
| 140 | Build ONU SN List ${List_ONU_Serial} |
| 141 | Log ${List_ONU_Serial} |
| 142 | Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows |
| 143 | ... ${List_ONU_Serial} ${onu_flows} |
| 144 | |
Hardik Windlass | a3d04b9 | 2020-02-17 15:06:05 +0000 | [diff] [blame] | 145 | *** Keywords *** |
| 146 | Setup Suite |
| 147 | [Documentation] Set up the test suite |
| 148 | Common Test Suite Setup |
| 149 | |
| 150 | Clear All Devices Then Create New Device |
| 151 | [Documentation] Remove any devices from VOLTHA and ONOS |
| 152 | # Remove all devices from voltha and nos |
| 153 | Delete All Devices and Verify |
| 154 | # Execute normal test Setup Keyword |
| 155 | Setup |
| 156 | |