TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [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 | |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 15 | *** Settings *** |
| 16 | Documentation Test Template handling of ONU Go adapter with BBSIM controlledActivation: only-onu only! |
| 17 | ... Values.yaml must contain 'onu: 2' and 'controlledActivation: only-onu' under BBSIM! |
| 18 | ... Run robot with bbsim-kind-2x2.yaml |
| 19 | Suite Setup Setup Suite |
| 20 | Suite Teardown Teardown Suite |
| 21 | Test Setup Setup |
| 22 | Test Teardown Teardown |
| 23 | Library Collections |
| 24 | Library String |
| 25 | Library OperatingSystem |
| 26 | Library XML |
| 27 | Library RequestsLibrary |
| 28 | Library ../../libraries/DependencyLibrary.py |
| 29 | Resource ../../libraries/onos.robot |
| 30 | Resource ../../libraries/voltctl.robot |
| 31 | Resource ../../libraries/voltha.robot |
| 32 | Resource ../../libraries/utils.robot |
| 33 | Resource ../../libraries/k8s.robot |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 34 | Resource ../../libraries/onu_utilities.robot |
TorstenThieme | fe7099e | 2021-01-29 08:41:04 +0000 | [diff] [blame] | 35 | Resource ../../libraries/bbsim.robot |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 36 | Resource ../../variables/variables.robot |
| 37 | |
| 38 | *** Variables *** |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 39 | ${NAMESPACE} voltha |
| 40 | ${INFRA_NAMESPACE} default |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 41 | ${timeout} 60s |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 42 | ${of_id} 0 |
| 43 | ${logical_id} 0 |
| 44 | ${has_dataplane} True |
| 45 | ${external_libs} True |
| 46 | ${teardown_device} True |
| 47 | ${scripts} ../../scripts |
| 48 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 49 | ${container_log_dir} ${None} |
| 50 | |
| 51 | # flag debugmode is used, if true timeout calculation various, can be passed via the command line too |
| 52 | # example: -v debugmode:True |
| 53 | ${debugmode} False |
| 54 | # logging flag to enable Collect Logs, can be passed via the command line too |
| 55 | # example: -v logging:True |
| 56 | ${logging} False |
| 57 | # if True execution will be paused before clean up |
| 58 | # example: -v pausebeforecleanup:True |
| 59 | ${pausebeforecleanup} False |
| 60 | ${data_dir} ../data |
| 61 | |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 62 | # flag to choose the subscriber provisioning command type in ONOS |
| 63 | # TT often provision a single services for a subscriber (eg: hsia, voip, ...) one after the other. |
| 64 | # if set to True, command used is "volt-add-subscriber-unitag" |
| 65 | # if set to False, comand used is "volt-add-subscriber-access" |
| 66 | ${unitag_sub} False |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 67 | |
| 68 | *** Test Cases *** |
| 69 | ONU MIB Template Data Test |
| 70 | [Documentation] Validates ONU Go adapter storage of MIB Template Data in etcd and checks the usage |
| 71 | ... - setup one ONU |
| 72 | ... - request MIB-Upload-Data by ONU via OMCI |
| 73 | ... - storage MIB-Upload-Data in etcd |
| 74 | ... - store setup duration of ONU |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 75 | ... - check Template-Data in etcd stored (service/%{NAME}/omci_mibs/go_templates/) |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 76 | ... - setup second ONU |
| 77 | ... - collect setup durationof second ONU |
| 78 | ... - compare both duration |
| 79 | ... - duration of second ONU should be at least 10 times faster than the first one |
| 80 | ... - MIB-Upload-Data should not requested via OMCI by second ONU |
| 81 | ... - MIB-Upload-Data should read from etcd |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 82 | [Tags] functionalOnuGo MibTemplateOnuGo |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 83 | [Setup] Run Keywords Start Logging ONUMibTemplateTest |
| 84 | ... AND Setup |
| 85 | Perform ONU MIB Template Data Test |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame^] | 86 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id |
| 87 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 88 | ... AND Stop Logging ONUMibTemplateTest |
| 89 | |
| 90 | |
| 91 | *** Keywords *** |
| 92 | Setup Suite |
| 93 | [Documentation] Set up the test suite |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 94 | Start Logging Setup or Teardown Setup-${SUITE NAME} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 95 | ${LogInfo}= Catenate |
| 96 | ... \r\nPassed arguments: |
| 97 | ... debugmode:${debugmode}, logging:${logging}, pausebeforecleanup:${pausebeforecleanup}, |
| 98 | Log ${LogInfo} console=yes |
| 99 | Common Test Suite Setup |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 100 | # delete etcd MIB Template Data |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 101 | Delete MIB Template Data ${INFRA_NAMESPACE} |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 102 | Run Keyword If ${logging} Collect Logs |
| 103 | Stop Logging Setup or Teardown Setup-${SUITE NAME} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 104 | |
| 105 | Teardown Suite |
| 106 | [Documentation] Replaces the Suite Teardown in utils.robot. |
| 107 | ... Cleans up and checks all ONU ports disabled in ONOS. |
| 108 | ... Furthermore gives the possibility to pause the execution. |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 109 | Start Logging Setup or Teardown Teardown-${SUITE NAME} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 110 | Run Keyword If ${pausebeforecleanup} Import Library Dialogs |
| 111 | Run Keyword If ${pausebeforecleanup} Pause Execution Press OK to continue with clean up! |
| 112 | Run Keyword If ${pausebeforecleanup} Log Teardown will be continued... console=yes |
| 113 | Run Keyword If ${teardown_device} Delete All Devices and Verify |
TorstenThieme | 731a759 | 2021-07-01 14:26:54 +0000 | [diff] [blame] | 114 | Wait for Ports in ONOS for all OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT} 0 BBSM |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 115 | # delete etcd MIB Template Data (for repeating test) |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 116 | Delete MIB Template Data ${INFRA_NAMESPACE} |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 117 | Run Keyword If ${logging} Collect Logs |
| 118 | Stop Logging Setup or Teardown Teardown-${SUITE NAME} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 119 | Close All ONOS SSH Connections |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 120 | |
| 121 | Perform ONU MIB Template Data Test |
| 122 | [Documentation] This keyword performs ONU MIB Template Data Test |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 123 | ${firstonu}= Set Variable 0 |
| 124 | ${secondonu}= Set Variable 1 |
| 125 | ${state2test}= Set Variable omci-flows-pushed |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 126 | Set Global Variable ${state2test} |
| 127 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 128 | # Start first Onu |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 129 | ${src}= Set Variable ${hosts.src[${0}]} |
| 130 | Log \r\nONU ${src['onu']}: startup with MIB upload cycle and storage of template data to etcd. console=yes |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 131 | ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release bbsim0 |
| 132 | Power On ONU ${NAMESPACE} ${bbsim_pod} ${src['onu']} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 133 | ${timeStart}= Get Current Date |
| 134 | ${firstonustartup}= Get ONU Startup Duration ${firstonu} ${timeStart} |
| 135 | # check MIB Template data stored in etcd |
| 136 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 3s |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 137 | ... Verify MIB Template Data Available ${INFRA_NAMESPACE} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 138 | # Start second Onu |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 139 | ${src}= Set Variable ${hosts.src[${1}]} |
| 140 | Log ONU ${src['onu']}: startup without MIB upload cycle by using of template data of etcd. console=yes |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 141 | ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release bbsim0 |
| 142 | Power On ONU ${NAMESPACE} ${bbsim_pod} ${src['onu']} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 143 | ${timeStart}= Get Current Date |
| 144 | ${secondonustartup}= Get ONU Startup Duration ${secondonu} ${timeStart} |
| 145 | # compare both durations, second onu should be at least 3 times faster |
| 146 | ${status} Evaluate ${firstonustartup}>=${secondonustartup}*3 |
| 147 | Should Be True ${status} |
| 148 | ... Startup durations (${firstonustartup} and ${secondonustartup}) do not full fill the requirements of 1/10. |
| 149 | |
| 150 | Get ONU Startup Duration |
| 151 | [Documentation] This keyword delivers startup duration of onu |
| 152 | [Arguments] ${onu} ${starttime} |
| 153 | ${src}= Set Variable ${hosts.src[${onu}]} |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 154 | ${admin_state} ${oper_status} ${connect_status} ${onu_state_nb} ${onu_state}= |
| 155 | ... Map State ${state2test} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 156 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 50ms |
| 157 | ... Validate Device ${admin_state} ${oper_status} ${connect_status} |
| 158 | ... ${src['onu']} onu=True onu_reason=${onu_state} |
| 159 | ${timeCurrent} = Get Current Date |
| 160 | ${timeTotalMs} = Subtract Date From Date ${timeCurrent} ${startTime} result_format=number |
| 161 | Log ONU ${src['onu']}: reached the state ${onu_state} after ${timeTotalMs} sec. console=yes |
| 162 | [Return] ${timeTotalMs} |