Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [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 | |
| 15 | *** Settings *** |
| 16 | Documentation Test various end-to-end scenarios involing Multiple OLTs |
| 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 | # 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 |
| 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 | |
Matteo Scandolo | da1c64b | 2021-07-20 10:14:49 -0700 | [diff] [blame] | 57 | # logging flag to enable Collect Logs, can be passed via the command line too |
| 58 | # example: -v logging:False |
| 59 | ${logging} True |
| 60 | |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 61 | *** Test Cases *** |
| 62 | Verify OLT after Rebooting Physically for DT - Multiple OLT |
| 63 | [Documentation] Test the physical reboot of the OLT |
| 64 | ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming sanityDt test was executed) |
| 65 | ... Test performs a physical reboot, performs "reboot" from the OLT CLI |
| 66 | ... Test runs when more than one OLT exists |
| 67 | ... Only one OLT is rebooted in the test, while verifying if the ONUs on the |
Hardik Windlass | a119a10 | 2021-02-15 14:52:07 +0530 | [diff] [blame] | 68 | ... other OLT are still functional |
Hardik Windlass | 5ceb84e | 2021-02-11 11:17:08 +0000 | [diff] [blame] | 69 | [Tags] functionalDt MultiOLTPhysicalRebootDt |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 70 | [Setup] Start Logging MultiOlt_Physical_Dt |
| 71 | [Teardown] Run Keywords Collect Logs |
| 72 | ... AND Stop Logging MultiOlt_Physical_Dt |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 73 | # Execute the test when the number of OLTs are greater than one |
| 74 | Pass Execution If ${olt_count} == 1 Skipping test: just one OLT |
Hardik Windlass | a119a10 | 2021-02-15 14:52:07 +0530 | [diff] [blame] | 75 | Clear All Devices Then Perform Setup And Sanity |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 76 | # Reboot the first OLT from the list of olts - rebooting from the OLT CLI |
| 77 | ${olt_user}= Get From Dictionary ${list_olts}[0] user |
| 78 | ${olt_pass}= Get From Dictionary ${list_olts}[0] pass |
| 79 | ${olt_ssh_ip}= Get From Dictionary ${list_olts}[0] sship |
| 80 | ${olt_serial_number}= Get From Dictionary ${list_olts}[0] sn |
| 81 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 82 | Run Keyword If ${has_dataplane} Login And Run Command On Remote System |
Andrea Campanella | 5ef8814 | 2021-02-02 14:34:50 +0100 | [diff] [blame] | 83 | ... reboot ${olt_ssh_ip} ${olt_user} ${olt_pass} prompt=# |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 84 | # validate that the ONUs on the other OLTs are still functional |
| 85 | Verify ping is successful for ONUs not on this OLT ${num_all_onus} ${olt_device_id} |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 86 | |
| 87 | # validate that the ONUs on the rebooted OLT are not pingable |
| 88 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 89 | ${src}= Set Variable ${hosts.src[${I}]} |
| 90 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 91 | ${olt_serial_number}= Get From Dictionary ${list_olts}[0] sn |
| 92 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
| 93 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 94 | ... Wait Until Keyword Succeeds 60s 2s |
| 95 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 96 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 97 | END |
| 98 | # Wait for the rebooted OLT to come back up |
| 99 | ${olt_user}= Get From Dictionary ${list_olts}[0] user |
| 100 | ${olt_pass}= Get From Dictionary ${list_olts}[0] pass |
| 101 | ${olt_ssh_ip}= Get From Dictionary ${list_olts}[0] sship |
| 102 | ${olt_serial_number}= Get From Dictionary ${list_olts}[0] sn |
| 103 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 104 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s |
| 105 | ... Check Remote System Reachability True ${olt_ssh_ip} |
| 106 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s |
| 107 | ... Validate OLT Device ENABLED ACTIVE |
| 108 | ... REACHABLE ${olt_serial_number} |
| 109 | # Waiting extra time for the ONUs to come up |
| 110 | Sleep 60s |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 111 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 112 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 113 | |
| 114 | Verify OLT Soft Reboot for DT - Multiple OLT |
| 115 | [Documentation] Test soft reboot of the OLT using voltctl command |
| 116 | ... Test runs when more than one OLT exists |
| 117 | ... Only one OLT is rebooted in the test, while verifying if the ONUs on the |
Hardik Windlass | a119a10 | 2021-02-15 14:52:07 +0530 | [diff] [blame] | 118 | ... other OLT are still functional |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 119 | [Tags] MultiOLTSoftRebootDt functionalDt |
| 120 | [Setup] Start Logging MultiOLTSoftRebootDt |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 121 | [Teardown] Run Keywords Collect Logs |
| 122 | ... AND Stop Logging MultiOLTSoftRebootDt |
Suchitra Vemuri | 6971c39 | 2020-12-08 10:41:33 -0800 | [diff] [blame] | 123 | ... AND Delete All Devices and Verify |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 124 | Pass Execution If ${olt_count} == 1 Skipping test: just one OLT |
Hardik Windlass | a119a10 | 2021-02-15 14:52:07 +0530 | [diff] [blame] | 125 | Clear All Devices Then Perform Setup And Sanity |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 126 | # Reboot the first OLT |
| 127 | ${olt_user}= Get From Dictionary ${list_olts}[0] user |
| 128 | ${olt_pass}= Get From Dictionary ${list_olts}[0] pass |
| 129 | ${olt_ssh_ip}= Get From Dictionary ${list_olts}[0] sship |
| 130 | ${olt_serial_number}= Get From Dictionary ${list_olts}[0] sn |
| 131 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 132 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s |
| 133 | ... Validate OLT Device ENABLED ACTIVE |
| 134 | ... REACHABLE ${olt_serial_number} |
| 135 | # Reboot the OLT using "voltctl device reboot" command |
| 136 | Reboot Device ${olt_device_id} |
Andrea Campanella | 9d8d3a5 | 2021-06-17 12:18:23 +0200 | [diff] [blame] | 137 | # Wait for the OLT to actually go down |
| 138 | Wait Until Keyword Succeeds 360s 5s Validate OLT Device ENABLED UNKNOWN UNREACHABLE |
| 139 | ... ${olt_serial_number} |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 140 | # validate that the ONUs on the other OLTs are still functional |
| 141 | Verify ping is successful for ONUs not on this OLT ${num_all_onus} ${olt_device_id} |
| 142 | #Verify that ping fails for the ONUs where the OLT has been rebooted |
| 143 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 144 | ${src}= Set Variable ${hosts.src[${I}]} |
| 145 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 146 | ${olt_serial_number}= Get From Dictionary ${list_olts}[0] sn |
| 147 | Continue For Loop If "${olt_serial_number}"!="${src['olt']}" |
| 148 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 149 | ... Wait Until Keyword Succeeds 60s 2s |
| 150 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 151 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 152 | END |
| 153 | # Check OLT state |
| 154 | ${olt_serial_number}= Get From Dictionary ${list_olts}[0] sn |
| 155 | ${olt_ssh_ip}= Get From Dictionary ${list_olts}[0] sship |
| 156 | ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number} |
| 157 | # Wait for the OLT to come back up |
| 158 | Run Keyword If ${has_dataplane} Wait Until Keyword Succeeds 120s 10s |
| 159 | ... Check Remote System Reachability True ${olt_ssh_ip} |
| 160 | # Check OLT states |
| 161 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds 360s 5s |
| 162 | ... Validate OLT Device ENABLED ACTIVE |
| 163 | ... REACHABLE ${olt_serial_number} |
| 164 | # Waiting extra time for the ONUs to come up |
| 165 | Sleep 60s |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 166 | #Check after reboot that ONUs are active, DHCP and pingable |
| 167 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 168 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |
| 169 | |
| 170 | *** Keywords *** |
| 171 | Setup Suite |
| 172 | [Documentation] Set up the test suite |
| 173 | Common Test Suite Setup |
| 174 | #power_switch.robot needs it to support different vendor's power switch |
| 175 | ${switch_type}= Get Variable Value ${web_power_switch.type} |
| 176 | Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type} |
| 177 | |
Hardik Windlass | a119a10 | 2021-02-15 14:52:07 +0530 | [diff] [blame] | 178 | Clear All Devices Then Perform Setup And Sanity |
| 179 | [Documentation] Remove any devices from VOLTHA and Verify in ONOS |
| 180 | ... Create New Device through Setup and Perform Sanity |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 181 | # Remove all devices from voltha and nos |
Hardik Windlass | a119a10 | 2021-02-15 14:52:07 +0530 | [diff] [blame] | 182 | Run Keyword and Ignore Error Delete All Devices and Verify |
Suchitra Vemuri | fe30941 | 2020-12-01 19:19:52 -0800 | [diff] [blame] | 183 | # Execute normal test Setup Keyword |
| 184 | Setup |
Hardik Windlass | a119a10 | 2021-02-15 14:52:07 +0530 | [diff] [blame] | 185 | # Performing Sanity Test to make sure subscribers are all DHCP and pingable |
| 186 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 187 | Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT |