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