Andrea Campanella | 4c40463 | 2020-08-26 14:41:36 +0200 | [diff] [blame] | 1 | # Copyright 2020 - 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 ONOS high avaliablity tests |
| 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 | Resource ../../libraries/power_switch.robot |
| 35 | |
| 36 | *** Variables *** |
| 37 | ${POD_NAME} flex-ocp-cord |
| 38 | ${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf |
| 39 | ${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs |
| 40 | ${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml |
| 41 | ${HELM_CHARTS_DIR} ~/helm-charts |
| 42 | ${VOLTHA_POD_NUM} 8 |
| 43 | ${NAMESPACE} default |
Matteo Scandolo | 10acf56 | 2021-05-03 15:35:16 -0700 | [diff] [blame] | 44 | ${INFRA_NAMESPACE} infra |
Andrea Campanella | 4c40463 | 2020-08-26 14:41:36 +0200 | [diff] [blame] | 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} True |
Andrea Campanella | 962fe83 | 2020-09-21 10:41:47 +0200 | [diff] [blame] | 53 | ${numOfOnos} 1 |
Andrea Campanella | 4c40463 | 2020-08-26 14:41:36 +0200 | [diff] [blame] | 54 | ${scripts} ../../scripts |
| 55 | ${workflow} ATT |
| 56 | |
| 57 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 58 | ${container_log_dir} ${None} |
| 59 | |
Matteo Scandolo | da1c64b | 2021-07-20 10:14:49 -0700 | [diff] [blame] | 60 | # logging flag to enable Collect Logs, can be passed via the command line too |
| 61 | # example: -v logging:False |
| 62 | ${logging} True |
| 63 | |
Andrea Campanella | 4c40463 | 2020-08-26 14:41:36 +0200 | [diff] [blame] | 64 | *** Test Cases *** |
| 65 | Verify restart ONOS instace master of device after subscriber is provisioned |
| 66 | [Documentation] Restat ONOS instance master of a given device and check that during restart and after the |
| 67 | ... subscriuber still has dataplane traffic. |
| 68 | ... Prerequisite : ONUs are authenticated and pingable, thus setup and sanity is performed. |
| 69 | [Tags] onosHa VOL-3436 onosMasterRestart |
Suchitra Vemuri | 8130be8 | 2020-09-15 16:47:58 -0700 | [diff] [blame] | 70 | [Setup] Start Logging onosMasterRestart |
Andrea Campanella | 4c40463 | 2020-08-26 14:41:36 +0200 | [diff] [blame] | 71 | [Teardown] Run Keywords Collect Logs |
| 72 | ... AND Stop Logging onosMasterRestart |
Matteo Scandolo | 10acf56 | 2021-05-03 15:35:16 -0700 | [diff] [blame] | 73 | ${numOfOnos}= Wait Until Keyword Succeeds 20s 5s Get Number of Running Pods Number By Label ${INFRA_NAMESPACE} |
Hardik Windlass | 71702fa | 2021-04-28 15:46:51 +0000 | [diff] [blame] | 74 | ... app onos-classic |
| 75 | Should Not Be Equal As Integers ${numOfOnos} 0 Error fetching number of ONOS instances |
Andrea Campanella | 962fe83 | 2020-09-21 10:41:47 +0200 | [diff] [blame] | 76 | Pass Execution If ${numOfOnos} == 1 Skipping test: just one instance of ONOS |
Suchitra Vemuri | 94f045c | 2020-09-14 15:56:25 -0700 | [diff] [blame] | 77 | Delete All Devices and Verify |
| 78 | Setup |
Andrea Campanella | 4c40463 | 2020-08-26 14:41:36 +0200 | [diff] [blame] | 79 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 80 | Run Keyword If '${workflow}' == 'ATT' Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test |
| 81 | Run Keyword If '${workflow}' == 'DT' Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
Suchitra Vemuri | f8462be | 2020-11-05 13:38:42 -0800 | [diff] [blame] | 82 | FOR ${I} IN RANGE 0 ${olt_count} |
| 83 | ${olt_user}= Get From Dictionary ${list_olts}[${I}] user |
| 84 | ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass |
| 85 | ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship |
| 86 | ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn |
| 87 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 88 | ${of_id}= Wait Until Keyword Succeeds 360s 15s Validate OLT Device in ONOS ${olt_serial_number} |
| 89 | ${node_id}= Wait Until Keyword Succeeds 20s 5s Get Master Instace in ONOS ${of_id} |
Hardik Windlass | 347472c | 2021-02-23 18:54:31 +0530 | [diff] [blame] | 90 | @{onos_id}= Split String ${node_id} - |
Hardik Windlass | 71702fa | 2021-04-28 15:46:51 +0000 | [diff] [blame] | 91 | ${podName}= Catenate SEPARATOR=- voltha-infra-onos-classic ${onos_id[1]} |
Matteo Scandolo | 10acf56 | 2021-05-03 15:35:16 -0700 | [diff] [blame] | 92 | Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Name ${INFRA_NAMESPACE} ${podName} |
Suchitra Vemuri | f8462be | 2020-11-05 13:38:42 -0800 | [diff] [blame] | 93 | Sleep 60s |
Matteo Scandolo | 10acf56 | 2021-05-03 15:35:16 -0700 | [diff] [blame] | 94 | Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Name ${INFRA_NAMESPACE} |
Suchitra Vemuri | f8462be | 2020-11-05 13:38:42 -0800 | [diff] [blame] | 95 | ... ${podName} Running |
Andrea Campanella | d6226c6 | 2020-11-27 11:44:33 +0100 | [diff] [blame] | 96 | # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable |
| 97 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 98 | ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS |
| 99 | ... ${olt_serial_number} |
| 100 | Set Global Variable ${of_id} |
| 101 | ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s |
| 102 | ... Get NNI Port in ONOS ${of_id} |
| 103 | Set Global Variable ${nni_port} |
| 104 | ${num_onus}= Set Variable ${list_olts}[${I}][onucount] |
| 105 | Run Keyword If '${workflow}' == 'ATT' Wait Until Keyword Succeeds ${timeout} 2s |
| 106 | ... Perform Sanity Test Per OLT ${of_id} ${nni_port} ${olt_serial_number} ${num_onus} |
| 107 | Run Keyword If '${workflow}' == 'DT' Wait Until Keyword Succeeds ${timeout} 2s |
| 108 | ... Perform Sanity Test DT Per OLT ${of_id} ${nni_port} ${olt_serial_number} ${num_onus} |
Suchitra Vemuri | f8462be | 2020-11-05 13:38:42 -0800 | [diff] [blame] | 109 | END |
Andrea Campanella | 4c40463 | 2020-08-26 14:41:36 +0200 | [diff] [blame] | 110 | Log to console Pod ${podName} deleted and sanity checks passed successfully |
| 111 | |
| 112 | *** Keywords *** |
| 113 | Setup Suite |
| 114 | [Documentation] Set up the test suite |
Suchitra Vemuri | 94f045c | 2020-09-14 15:56:25 -0700 | [diff] [blame] | 115 | Common Test Suite Setup |