Suchitra Vemuri | 3f8b0f6 | 2019-09-12 13:25:16 -0700 | [diff] [blame] | 1 | #Copyright 2017-present Open Networking Foundation |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 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 | |
Matteo Scandolo | 1294aeb | 2019-09-24 16:20:32 -0700 | [diff] [blame] | 15 | # FIXME Can we use the same test against BBSim and Hardware? |
| 16 | |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 17 | *** Settings *** |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 18 | Documentation Test various end-to-end scenarios |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 19 | Suite Setup Setup Suite |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 20 | Test Setup Setup |
| 21 | Test Teardown Teardown |
| 22 | Library Collections |
| 23 | Library String |
| 24 | Library OperatingSystem |
| 25 | Library XML |
| 26 | Library RequestsLibrary |
Suchitra Vemuri | b8ed2d5 | 2019-09-30 13:22:51 -0700 | [diff] [blame] | 27 | Library ../../../voltha/tests/atests/common/testCaseUtils.py |
| 28 | Resource ../../../cord-tester/src/test/cord-api/Framework/Subscriber.robot |
| 29 | Resource ../../../cord-tester/src/test/cord-api/Framework/OLT.robot |
| 30 | Resource ../../../cord-tester/src/test/cord-api/Framework/DHCP.robot |
| 31 | Resource ../../../cord-tester/src/test/cord-api/Framework/Kubernetes.robot |
| 32 | Resource ../../libraries/onos.robot |
| 33 | Resource ../../libraries/voltctl.robot |
| 34 | Resource ../../libraries/utils.robot |
| 35 | Resource ../../variables/variables.robot |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 36 | |
| 37 | *** Variables *** |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 38 | ${POD_NAME} flex-ocp-cord |
| 39 | ${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 40 | ${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs |
| 41 | #${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 42 | ${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml |
| 43 | ${HELM_CHARTS_DIR} ~/helm-charts |
| 44 | ${VOLTHA_POD_NUM} 8 |
| 45 | ${timeout} 90s |
| 46 | ${num_onus} 1 |
| 47 | ${of_id} 0 |
| 48 | ${logical_id} 0 |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 49 | |
| 50 | *** Test Cases *** |
| 51 | Sanity E2E Test for OLT/ONU on POD |
| 52 | [Documentation] Validates E2E Ping Connectivity and object states for the given scenario: |
| 53 | ... Validate successful authentication/DHCP/E2E ping for the tech profile that is used |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 54 | [Tags] test1 |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 55 | #[Setup] Clean Up Linux |
| 56 | ${of_id}= Wait Until Keyword Succeeds 60s 15s Validate OLT Device in ONOS ${olt_serial_number} |
| 57 | #Wait Until Keyword Succeeds 60s 2s Verify Eapol Flows Added ${k8s_node_ip} ${ONOS_SSH_PORT} 5 |
| 58 | Validate Authentication True ${src0['dp_iface_name']} wpa_supplicant.conf ${src0['ip']} ${src0['user']} ${src0['pass']} |
| 59 | ... ${src0['container_type']} ${src0['container_name']} |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 60 | #Validate ONU authenticated in ONOS |
Suchitra Vemuri | 65e5fbb | 2019-09-27 15:23:52 -0700 | [diff] [blame] | 61 | #Wait Until Keyword Succeeds 90s 2s Verify Number of AAA-Users ${k8s_node_ip} ${ONOS_SSH_PORT} ${num_onus} |
| 62 | ${onu_port}= Wait Until Keyword Succeeds 90s 2s Get ONU Port in ONOS ${onu_serial_number} ${of_id} |
| 63 | Wait Until Keyword Succeeds 60s 2s Execute ONOS Command ${k8s_node_ip} ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port} |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 64 | # Perform dhclient and ping operations |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 65 | Validate DHCP and Ping True True ${src0['dp_iface_name']} ${src0['s_tag']} ${src0['c_tag']} ${dst0['dp_iface_ip_qinq']} |
| 66 | ... ${src0['ip']} ${src0['user']} ${src0['pass']} ${src0['container_type']} ${src0['container_name']} ${dst0['dp_iface_name']} |
| 67 | ... ${dst0['ip']} ${dst0['user']} ${dst0['pass']} ${dst0['container_type']} ${dst0['container_name']} |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 68 | #Validate DHCP allocation in ONOS |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 69 | Wait Until Keyword Succeeds 60s 2s Validate DHCP Allocations ${k8s_node_ip} ${ONOS_SSH_PORT} ${num_onus} |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 70 | |
| 71 | *** Keywords *** |
| 72 | Setup Suite |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 73 | [Documentation] Setup the whole test suite |
Suchitra Vemuri | 2adc07e | 2019-09-05 17:25:31 -0700 | [diff] [blame] | 74 | Set Global Variable ${KUBECTL_CONFIG} export KUBECONFIG=%{KUBECONFIG} |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 75 | Set Global Variable ${export_kubeconfig} export KUBECONFIG=${KUBERNETES_CONF} |
| 76 | Set Global Variable ${of_id} |
| 77 | Set Global Variable ${VOLTCTL_CONFIG} export VOLTCONFIG=%{VOLTCONFIG} |
| 78 | ${k8s_node_ip}= Evaluate ${nodes}[0].get("ip") |
| 79 | ${k8s_node_user}= Evaluate ${nodes}[0].get("user") |
| 80 | ${k8s_node_pass}= Evaluate ${nodes}[0].get("pass") |
| 81 | Check CLI Tools Configured |
| 82 | ${onos_auth}= Create List karaf karaf |
| 83 | ${HEADERS} Create Dictionary Content-Type=application/json |
Suchitra Vemuri | 9c24d2b | 2019-09-30 10:28:25 -0700 | [diff] [blame] | 84 | Create Session ONOS http://${k8s_node_ip}:${ONOS_REST_PORT} auth=${ONOS_AUTH} |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 85 | Set Global Variable ${export_kubeconfig} export KUBECONFIG=${KUBERNETES_CONF} |
| 86 | ${olt_ip}= Evaluate ${olts}[0].get("ip") |
| 87 | ${olt_user}= Evaluate ${olts}[0].get("user") |
| 88 | ${olt_pass}= Evaluate ${olts}[0].get("pass") |
| 89 | ${olt_serial_number}= Evaluate ${olts}[0].get("serial") |
| 90 | ${onu_serial_number}= Evaluate ${onus}[0].get("serial") |
Suchitra Vemuri | 2adc07e | 2019-09-05 17:25:31 -0700 | [diff] [blame] | 91 | Set Suite Variable ${olt_serial_number} |
| 92 | Set Suite Variable ${onu_serial_number} |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 93 | Set Suite Variable ${olt_ip} |
| 94 | Set Suite Variable ${olt_user} |
| 95 | Set Suite Variable ${olt_pass} |
| 96 | Set Suite Variable ${k8s_node_ip} |
| 97 | Set Suite Variable ${k8s_node_user} |
| 98 | Set Suite Variable ${k8s_node_pass} |
| 99 | @{container_list}= Create List |
| 100 | Append To List ${container_list} adapter-open-olt |
| 101 | Append To List ${container_list} adapter-open-onu |
| 102 | Append To List ${container_list} voltha-api-server |
| 103 | Append To List ${container_list} voltha-ro-core |
| 104 | Append To List ${container_list} voltha-rw-core-11 |
| 105 | Append To List ${container_list} voltha-rw-core-12 |
| 106 | Append To List ${container_list} voltha-ofagent |
| 107 | Set Suite Variable ${container_list} |
| 108 | Set Deployment Config Variables |
| 109 | ${datetime}= Get Current Datetime On Kubernetes Node ${k8s_node_ip} ${k8s_node_user} ${k8s_node_pass} |
| 110 | Set Suite Variable ${datetime} |
| 111 | |
| 112 | Setup |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 113 | [Documentation] Pre-test Setup |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 114 | #create/preprovision device |
Suchitra Vemuri | c59eb27 | 2019-09-18 17:59:33 -0700 | [diff] [blame] | 115 | ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT} |
| 116 | Set Suite Variable ${olt_device_id} |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 117 | #enable device |
Suchitra Vemuri | c59eb27 | 2019-09-18 17:59:33 -0700 | [diff] [blame] | 118 | Enable Device ${olt_device_id} |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 119 | #validate olt states |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 120 | Wait Until Keyword Succeeds 60s 5s Validate Device ${olt_serial_number} ENABLED ACTIVE |
| 121 | ... REACHABLE |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 122 | #validate onu states |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 123 | Wait Until Keyword Succeeds 60s 5s Validate Device ${onu_serial_number} ENABLED ACTIVE |
| 124 | ... REACHABLE onu=True onu_reason=tech-profile-config-download-success |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 125 | #get onu device id |
| 126 | ${onu_device_id}= Get Device ID From SN ${onu_serial_number} |
| 127 | Set Suite Variable ${onu_device_id} |
Suchitra Vemuri | 00d147d | 2019-09-13 13:07:32 -0700 | [diff] [blame] | 128 | ${logical_id}= Get Logical Device ID From SN ${olt_serial_number} |
| 129 | Set Suite Variable ${logical_id} |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 130 | |
| 131 | Teardown |
| 132 | [Documentation] kills processes and cleans up interfaces on src+dst servers |
Suchitra Vemuri | 65e5fbb | 2019-09-27 15:23:52 -0700 | [diff] [blame] | 133 | Get Device Output from Voltha ${olt_device_id} |
| 134 | #Get Logical Device Output from Voltha ${logical_id} |
Suchitra Vemuri | c59eb27 | 2019-09-18 17:59:33 -0700 | [diff] [blame] | 135 | Get ONOS Status ${k8s_node_ip} |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 136 | Clean Up Linux |
| 137 | Log Kubernetes Containers Logs Since Time ${datetime} ${container_list} |
| 138 | |
| 139 | Clean Up Linux |
| 140 | [Documentation] Kill processes and clean up interfaces on src+dst servers |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 141 | Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src0['ip']} ${src0['user']} ${src0['pass']} ${src0['container_type']} |
| 142 | ... ${src0['container_name']} |
| 143 | Run Keyword And Ignore Error Kill Linux Process [d]hclient ${src0['ip']} ${src0['user']} ${src0['pass']} ${src0['container_type']} |
| 144 | ... ${src0['container_name']} |
| 145 | Run Keyword If '${dst0['ip']}' != '${None}' Run Keyword And Ignore Error Kill Linux Process [d]hcpd ${dst0['ip']} ${dst0['user']} |
| 146 | ... ${dst0['pass']} ${dst0['container_type']} ${dst0['container_name']} |
Suchitra Vemuri | 65cd65f | 2019-08-30 14:39:22 -0700 | [diff] [blame] | 147 | Delete IP Addresses from Interface on Remote Host ${src0['dp_iface_name']} ${src0['ip']} ${src0['user']} ${src0['pass']} ${src0['container_type']} ${src0['container_name']} |
Zack Williams | ec53a1b | 2019-09-16 15:50:52 -0700 | [diff] [blame] | 148 | Run Keyword If '${dst0['ip']}' != '${None}' Delete Interface on Remote Host ${dst0['dp_iface_name']}.${src0['s_tag']} ${dst0['ip']} ${dst0['user']} ${dst0['pass']} |
| 149 | ... ${dst0['container_type']} ${dst0['container_name']} |