Hema | df00368 | 2020-04-28 21:22:22 +0530 | [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 failure scenarios |
| 17 | Suite Setup Setup Suite |
| 18 | Test Setup Setup |
| 19 | Test Teardown Teardown |
| 20 | #Suite Teardown Teardown Suite |
| 21 | Library Collections |
| 22 | Library String |
| 23 | Library OperatingSystem |
| 24 | Library XML |
| 25 | Library RequestsLibrary |
| 26 | Library ../../libraries/DependencyLibrary.py |
| 27 | Resource ../../libraries/onos.robot |
| 28 | Resource ../../libraries/voltctl.robot |
| 29 | Resource ../../libraries/voltha.robot |
| 30 | Resource ../../libraries/utils.robot |
| 31 | Resource ../../libraries/k8s.robot |
| 32 | Resource ../../variables/variables.robot |
| 33 | Resource ../../libraries/power_switch.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 | ${DEFAULTSPACE} default |
| 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 |
| 52 | ${teardown_device} False |
| 53 | ${scripts} ../../scripts |
| 54 | |
| 55 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 56 | ${container_log_dir} ${None} |
| 57 | |
| 58 | *** Test Cases *** |
| 59 | Verify OLT Soft Reboot |
| 60 | [Documentation] Test soft reboot of the OLT using voltctl command |
| 61 | [Tags] VOL-2745 OLTSoftReboot notready |
| 62 | [Setup] Start Logging OLTSoftReboot |
| 63 | #... AND Setup |
| 64 | [Teardown] Run Keywords Collect Logs |
| 65 | ... AND Stop Logging OLTSoftReboot |
| 66 | #... AND Delete Device and Verify |
| 67 | ## Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable |
| 68 | #Run Keyword If ${has_dataplane} Clean Up Linux |
| 69 | #Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 70 | # Reboot the OLT using "voltctl device reboot" command |
| 71 | Reboot Device ${olt_device_id} |
| 72 | Run Keyword And Ignore Error Collect Logs |
| 73 | #Verify that ping fails |
| 74 | FOR ${I} IN RANGE 0 ${num_onus} |
| 75 | ${src}= Set Variable ${hosts.src[${I}]} |
| 76 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 77 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 78 | ... Wait Until Keyword Succeeds 60s 2s |
| 79 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 80 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 81 | END |
| 82 | # Wait for the OLT to come back up |
| 83 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s |
| 84 | ... Check Remote System Reachability True ${olt_ip} |
| 85 | # Waiting extra time for the ONUs to come up |
| 86 | Sleep 60s |
| 87 | # Check OLT states |
| 88 | Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Device ENABLED ACTIVE REACHABLE |
| 89 | ... ${olt_serial_number} |
| 90 | Run Keyword And Ignore Error Collect Logs |
| 91 | #Check after reboot that ONUs are active, authenticated/DHCP/pingable |
| 92 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 93 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 94 | |
| 95 | |
| 96 | *** Keywords *** |
| 97 | Setup Suite |
| 98 | [Documentation] Set up the test suite |
| 99 | Common Test Suite Setup |