Joey Armstrong | 9fadcbe | 2024-01-17 19:00:37 -0500 | [diff] [blame] | 1 | # Copyright 2020-2024 Open Networking Foundation (ONF) and the ONF Contributors |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 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 *** |
TorstenThieme | 2d8327b | 2022-03-15 08:42:27 +0000 | [diff] [blame] | 16 | Documentation Test MIB Template handling of ONU Go adapter |
| 17 | ... with BBSIM controlledActivation: only-onu only! |
| 18 | ... Set up BBSIM with 'onu=2' (as well as 'pon=2') and 'controlledActivation=only-onu' e.g. with Extra Helm Flags! |
| 19 | ... Run robot with bbsim-kind-2x2.yaml (needed for test case ONU MIB Template Data Test) |
| 20 | ... For test cases Unknown ME/Attribute bbsim-kind.yaml would work too. |
| 21 | ... For Unknown ME set up BBSIM with injectOmciUnknownME=true e.g. with Extra Helm Flags! |
| 22 | ... For Unknown Attribute set up BBSIM with injectOmciUnknownAttributes=true e.g. with Extra Helm Flags! |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 23 | Suite Setup Setup Suite |
| 24 | Suite Teardown Teardown Suite |
| 25 | Test Setup Setup |
| 26 | Test Teardown Teardown |
| 27 | Library Collections |
| 28 | Library String |
| 29 | Library OperatingSystem |
| 30 | Library XML |
| 31 | Library RequestsLibrary |
| 32 | Library ../../libraries/DependencyLibrary.py |
| 33 | Resource ../../libraries/onos.robot |
| 34 | Resource ../../libraries/voltctl.robot |
| 35 | Resource ../../libraries/voltha.robot |
| 36 | Resource ../../libraries/utils.robot |
| 37 | Resource ../../libraries/k8s.robot |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 38 | Resource ../../libraries/onu_utilities.robot |
TorstenThieme | fe7099e | 2021-01-29 08:41:04 +0000 | [diff] [blame] | 39 | Resource ../../libraries/bbsim.robot |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 40 | Resource ../../variables/variables.robot |
| 41 | |
| 42 | *** Variables *** |
TorstenThieme | 2d8327b | 2022-03-15 08:42:27 +0000 | [diff] [blame] | 43 | ${NAMESPACE} voltha |
| 44 | ${INFRA_NAMESPACE} default |
| 45 | ${timeout} 60s |
| 46 | ${of_id} 0 |
| 47 | ${logical_id} 0 |
| 48 | ${has_dataplane} True |
| 49 | ${external_libs} True |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 50 | ${teardown_device} True |
| 51 | ${scripts} ../../scripts |
| 52 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 53 | ${container_log_dir} ${None} |
| 54 | |
| 55 | # flag debugmode is used, if true timeout calculation various, can be passed via the command line too |
| 56 | # example: -v debugmode:True |
| 57 | ${debugmode} False |
| 58 | # logging flag to enable Collect Logs, can be passed via the command line too |
| 59 | # example: -v logging:True |
| 60 | ${logging} False |
| 61 | # if True execution will be paused before clean up |
| 62 | # example: -v pausebeforecleanup:True |
| 63 | ${pausebeforecleanup} False |
TorstenThieme | 89930b9 | 2022-06-16 12:13:51 +0000 | [diff] [blame] | 64 | # Log Level of Helm chart |
| 65 | # example: -v helmloglevel:WARN |
| 66 | ${helmloglevel} DEBUG |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 67 | ${data_dir} ../data |
| 68 | |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 69 | # flag to choose the subscriber provisioning command type in ONOS |
| 70 | # TT often provision a single services for a subscriber (eg: hsia, voip, ...) one after the other. |
| 71 | # if set to True, command used is "volt-add-subscriber-unitag" |
| 72 | # if set to False, comand used is "volt-add-subscriber-access" |
| 73 | ${unitag_sub} False |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 74 | |
| 75 | *** Test Cases *** |
| 76 | ONU MIB Template Data Test |
| 77 | [Documentation] Validates ONU Go adapter storage of MIB Template Data in etcd and checks the usage |
| 78 | ... - setup one ONU |
| 79 | ... - request MIB-Upload-Data by ONU via OMCI |
| 80 | ... - storage MIB-Upload-Data in etcd |
| 81 | ... - store setup duration of ONU |
TorstenThieme | d4f4896 | 2020-12-08 12:17:19 +0000 | [diff] [blame] | 82 | ... - check Template-Data in etcd stored (service/%{NAME}/omci_mibs/go_templates/) |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 83 | ... - setup second ONU |
| 84 | ... - collect setup durationof second ONU |
| 85 | ... - compare both duration |
| 86 | ... - duration of second ONU should be at least 10 times faster than the first one |
| 87 | ... - MIB-Upload-Data should not requested via OMCI by second ONU |
| 88 | ... - MIB-Upload-Data should read from etcd |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 89 | [Tags] functionalOnuGo MibTemplateOnuGo |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 90 | [Setup] Run Keywords Start Logging ONUMibTemplateTest |
| 91 | ... AND Setup |
| 92 | Perform ONU MIB Template Data Test |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame] | 93 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id |
| 94 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | 2d8327b | 2022-03-15 08:42:27 +0000 | [diff] [blame] | 95 | ... AND Teardown Test |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 96 | ... AND Stop Logging ONUMibTemplateTest |
| 97 | |
TorstenThieme | 2d8327b | 2022-03-15 08:42:27 +0000 | [diff] [blame] | 98 | ONU MIB Template Unknown ME Test |
| 99 | [Documentation] Validates ONU Go adapter storage of MIB Template Data in etcd in case of unknown ME |
| 100 | ... - setup one ONU |
| 101 | ... - request MIB-Upload-Data by ONU via OMCI |
| 102 | ... - storage MIB-Upload-Data in etcd |
| 103 | ... - check Template-Data in etcd stored (service/voltha/omci_mibs/go_templates/) |
| 104 | ... - Template-Data in etcd stored should contain "UnknownItuG988ManagedEntity" |
| 105 | [Tags] functionalOnuGo UnknownMeOnuGo |
| 106 | [Setup] Run Keywords Start Logging UnknownMeOnuGo |
| 107 | ... AND Setup |
| 108 | Bring Up ONU |
| 109 | ${MibTemplateData}= Get ONU MIB Template Data ${INFRA_NAMESPACE} |
| 110 | ${MibTemplatePrep}= Prepare ONU Go Adapter ETCD Data For Json ${MibTemplateData} |
| 111 | ${MibTemplateJson}= To Json ${MibTemplatePrep} |
| 112 | Dictionary Should Contain Key ${MibTemplateJson[0]} UnknownItuG988ManagedEntity |
| 113 | ${UnknownME}= Get From Dictionary ${MibTemplateJson[0]} UnknownItuG988ManagedEntity |
| 114 | Dictionary Should Contain Key ${UnknownME} 37 |
| 115 | ${Attributes}= Get From Dictionary ${UnknownME['37']} 1 |
| 116 | ${AttributeMask}= Get From Dictionary ${Attributes} AttributeMask |
| 117 | ${AttributeBytes}= Get From Dictionary ${Attributes} AttributeBytes |
TorstenThieme | 368e9b6 | 2022-03-18 10:33:05 +0000 | [diff] [blame] | 118 | Should be Equal ${AttributeMask} 0x8000 |
| 119 | Should be Equal ${AttributeBytes} 0102030405060708090a0b0c0d0e0f101112131415161718191a |
TorstenThieme | 2d8327b | 2022-03-15 08:42:27 +0000 | [diff] [blame] | 120 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id |
| 121 | ... AND Run Keyword If ${logging} Collect Logs |
| 122 | ... AND Teardown Test |
| 123 | ... AND Stop Logging UnknownMeOnuGo |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 124 | |
TorstenThieme | 368e9b6 | 2022-03-18 10:33:05 +0000 | [diff] [blame] | 125 | ONU MIB Template Unknown Attribute Test |
| 126 | [Documentation] Validates ONU Go adapter storage of MIB Template Data in etcd in case of unknown Attribute |
| 127 | ... - setup one ONU |
| 128 | ... - request MIB-Upload-Data by ONU via OMCI |
| 129 | ... - storage MIB-Upload-Data in etcd |
| 130 | ... - check Template-Data in etcd stored (service/voltha/omci_mibs/go_templates/) |
| 131 | ... - Template-Data in etcd stored should contain "UnknownAttributesManagedEntity" |
| 132 | [Tags] functionalOnuGo UnknownAttributeOnuGo |
| 133 | [Setup] Run Keywords Start Logging UnknownAttributeOnuGo |
| 134 | ... AND Setup |
| 135 | Bring Up ONU |
| 136 | ${MibTemplateData}= Get ONU MIB Template Data ${INFRA_NAMESPACE} |
| 137 | ${MibTemplatePrep}= Prepare ONU Go Adapter ETCD Data For Json ${MibTemplateData} |
| 138 | ${MibTemplateJson}= To Json ${MibTemplatePrep} |
| 139 | Dictionary Should Contain Key ${MibTemplateJson[0]} UnknownAttributesManagedEntity |
| 140 | ${UnknownME}= Get From Dictionary ${MibTemplateJson[0]} UnknownAttributesManagedEntity |
| 141 | Dictionary Should Contain Key ${UnknownME} 257 |
| 142 | ${Attributes}= Get From Dictionary ${UnknownME['257']} 0 |
| 143 | ${AttributeMask}= Get From Dictionary ${Attributes} AttributeMask |
| 144 | ${AttributeBytes}= Get From Dictionary ${Attributes} AttributeBytes |
| 145 | Should be Equal ${AttributeMask} 0x0001 |
| 146 | Should be Equal ${AttributeBytes} 000100010001000000 |
| 147 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id |
| 148 | ... AND Run Keyword If ${logging} Collect Logs |
| 149 | ... AND Teardown Test |
| 150 | ... AND Stop Logging UnknownAttributeOnuGo |
| 151 | |
TorstenThieme | 89930b9 | 2022-06-16 12:13:51 +0000 | [diff] [blame] | 152 | |
| 153 | ONU MIB Template Data Compare OMCI Baseline and Extended Message |
| 154 | [Documentation] Compares ONU Go adapter storage of MIB Template Data in etcd according OMCI message format |
| 155 | ... - setup one ONU with baseline OMCI message (EXTRA_HELM_FLAGS=" --set omccVersion=163) |
| 156 | ... - request MIB-Upload-Data by ONU via OMCI |
| 157 | ... - storage MIB-Upload-Data in etcd |
| 158 | ... - store setup duration of ONU |
| 159 | ... - check Template-Data in etcd stored (service/%{NAME}/omci_mibs/go_templates/) |
| 160 | ... - store Template-Data |
| 161 | ... - delete all devices and etcd/mib data |
| 162 | ... - setup one ONU with extended OMCI message (EXTRA_HELM_FLAGS=" --set omccVersion=180) |
| 163 | ... - request MIB-Upload-Data by ONU via OMCI |
| 164 | ... - storage MIB-Upload-Data in etcd |
| 165 | ... - store setup duration of ONU |
| 166 | ... - check Template-Data in etcd stored (service/%{NAME}/omci_mibs/go_templates/) |
| 167 | ... - compare both duration |
| 168 | ... - duration of extended msg ONU should be at least less than 80% of the baseline one |
| 169 | ... - compare MIB-Data, should be the same |
| 170 | ... ================= !!! Attention!!! ====================== |
| 171 | ... Should be always the last test case in test suite! |
| 172 | ... It changes BBSIM configuration to OMCI extended messages. |
| 173 | ... ================= !!! Attention!!! ====================== |
| 174 | [Tags] functionalOnuGo MibTemplateOmciBaselineVersusExtendedOnuGo |
TorstenThieme | b56633f | 2022-07-06 09:41:04 +0000 | [diff] [blame] | 175 | [Setup] Start Logging MibTemplateOmciBaselineVersusExtendedOnuGo |
TorstenThieme | 89930b9 | 2022-06-16 12:13:51 +0000 | [diff] [blame] | 176 | Perform ONU MIB Template Compare OMCI Baseline and Extended Message |
| 177 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id |
| 178 | ... AND Run Keyword If ${logging} Collect Logs |
| 179 | ... AND Teardown Test |
| 180 | ... AND Stop Logging MibTemplateOmciBaselineVersusExtendedOnuGo |
| 181 | |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 182 | *** Keywords *** |
| 183 | Setup Suite |
| 184 | [Documentation] Set up the test suite |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 185 | Start Logging Setup or Teardown Setup-${SUITE NAME} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 186 | ${LogInfo}= Catenate |
| 187 | ... \r\nPassed arguments: |
| 188 | ... debugmode:${debugmode}, logging:${logging}, pausebeforecleanup:${pausebeforecleanup}, |
| 189 | Log ${LogInfo} console=yes |
| 190 | Common Test Suite Setup |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 191 | # delete etcd MIB Template Data |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 192 | Delete MIB Template Data ${INFRA_NAMESPACE} |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 193 | Run Keyword If ${logging} Collect Logs |
| 194 | Stop Logging Setup or Teardown Setup-${SUITE NAME} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 195 | |
| 196 | Teardown Suite |
| 197 | [Documentation] Replaces the Suite Teardown in utils.robot. |
| 198 | ... Cleans up and checks all ONU ports disabled in ONOS. |
| 199 | ... Furthermore gives the possibility to pause the execution. |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 200 | Start Logging Setup or Teardown Teardown-${SUITE NAME} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 201 | Run Keyword If ${pausebeforecleanup} Import Library Dialogs |
| 202 | Run Keyword If ${pausebeforecleanup} Pause Execution Press OK to continue with clean up! |
| 203 | Run Keyword If ${pausebeforecleanup} Log Teardown will be continued... console=yes |
| 204 | Run Keyword If ${teardown_device} Delete All Devices and Verify |
TorstenThieme | 731a759 | 2021-07-01 14:26:54 +0000 | [diff] [blame] | 205 | 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] | 206 | # delete etcd MIB Template Data (for repeating test) |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 207 | Delete MIB Template Data ${INFRA_NAMESPACE} |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 208 | Run Keyword If ${logging} Collect Logs |
| 209 | Stop Logging Setup or Teardown Teardown-${SUITE NAME} |
TorstenThieme | 440b7c0 | 2020-12-18 15:42:57 +0000 | [diff] [blame] | 210 | Close All ONOS SSH Connections |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 211 | |
TorstenThieme | 2d8327b | 2022-03-15 08:42:27 +0000 | [diff] [blame] | 212 | Teardown Test |
| 213 | [Documentation] Post-test Teardown |
| 214 | Run Keyword If ${pausebeforecleanup} Import Library Dialogs |
| 215 | Run Keyword If ${pausebeforecleanup} Pause Execution Press OK to continue with clean up! |
| 216 | Run Keyword If ${pausebeforecleanup} Log Teardown will be continued... console=yes |
| 217 | Run Keyword If ${teardown_device} Delete All Devices and Verify |
| 218 | # delete etcd MIB Template Data |
| 219 | Delete MIB Template Data ${INFRA_NAMESPACE} |
| 220 | Sleep 5s |
| 221 | |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 222 | Perform ONU MIB Template Data Test |
| 223 | [Documentation] This keyword performs ONU MIB Template Data Test |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 224 | ${firstonu}= Set Variable 0 |
| 225 | ${secondonu}= Set Variable 1 |
| 226 | ${state2test}= Set Variable omci-flows-pushed |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 227 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 228 | # Start first Onu |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 229 | ${src}= Set Variable ${hosts.src[${0}]} |
| 230 | 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] | 231 | ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release bbsim0 |
| 232 | Power On ONU ${NAMESPACE} ${bbsim_pod} ${src['onu']} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 233 | ${timeStart}= Get Current Date |
TorstenThieme | 89930b9 | 2022-06-16 12:13:51 +0000 | [diff] [blame] | 234 | ${firstonustartup}= Get ONU Startup Duration ${state2test} ${firstonu} ${timeStart} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 235 | # check MIB Template data stored in etcd |
| 236 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 3s |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 237 | ... Verify MIB Template Data Available ${INFRA_NAMESPACE} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 238 | # Start second Onu |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 239 | ${src}= Set Variable ${hosts.src[${1}]} |
| 240 | 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] | 241 | ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release bbsim0 |
| 242 | Power On ONU ${NAMESPACE} ${bbsim_pod} ${src['onu']} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 243 | ${timeStart}= Get Current Date |
TorstenThieme | 89930b9 | 2022-06-16 12:13:51 +0000 | [diff] [blame] | 244 | ${secondonustartup}= Get ONU Startup Duration ${state2test} ${secondonu} ${timeStart} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 245 | # compare both durations, second onu should be at least 3 times faster |
| 246 | ${status} Evaluate ${firstonustartup}>=${secondonustartup}*3 |
| 247 | Should Be True ${status} |
| 248 | ... Startup durations (${firstonustartup} and ${secondonustartup}) do not full fill the requirements of 1/10. |
| 249 | |
TorstenThieme | 89930b9 | 2022-06-16 12:13:51 +0000 | [diff] [blame] | 250 | Perform ONU MIB Template Compare OMCI Baseline and Extended Message |
| 251 | [Documentation] This keyword performs ONU MIB Template Data Compare OMCI Baseline and Extended Message |
| 252 | ${firstonu}= Set Variable 0 |
| 253 | ${waittime}= Set Variable 0ms |
| 254 | ${state2test}= Set Variable initial-mib-downloaded |
| 255 | Run Keyword If ${has_dataplane} Clean Up Linux |
TorstenThieme | b56633f | 2022-07-06 09:41:04 +0000 | [diff] [blame] | 256 | ${omcc_version} ${is_omcc_extended}= Get BBSIM OMCC Version ${NAMESPACE} |
| 257 | # Restart BBSIM with OMCI Baseline Message if needed |
| 258 | ${extra_helm_flags} Catenate |
| 259 | ... --set onu=2,pon=2,controlledActivation=only-onu,injectOmciUnknownAttributes=true,injectOmciUnknownMe=true |
| 260 | ... --set omccVersion=163 |
| 261 | Run Keyword If ${is_omcc_extended} Restart BBSIM by Helm Charts ${NAMESPACE} extra_helm_flags=${extra_helm_flags} |
| 262 | Setup |
TorstenThieme | 89930b9 | 2022-06-16 12:13:51 +0000 | [diff] [blame] | 263 | ${src}= Set Variable ${hosts.src[${firstonu}]} |
| 264 | Log \r\nONU ${src['onu']}: startup with MIB upload cycle and storage of template data to etcd. console=yes |
| 265 | ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release bbsim0 |
| 266 | Power On ONU ${NAMESPACE} ${bbsim_pod} ${src['onu']} |
| 267 | ${timeStart}= Get Current Date |
| 268 | ${baselineonustartup}= Get ONU Startup Duration ${state2test} ${firstonu} ${timeStart} ${waittime} |
| 269 | # check MIB Template data stored in etcd |
| 270 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 3s |
| 271 | ... Verify MIB Template Data Available ${INFRA_NAMESPACE} |
| 272 | ${MibTemplateDataBaseline}= Get ONU MIB Template Data ${INFRA_NAMESPACE} |
TorstenThieme | 517b7ce | 2022-12-19 11:56:34 +0000 | [diff] [blame] | 273 | # get ONU OMCI counter statistics |
Guru | 988beba | 2024-11-24 14:55:43 +0530 | [diff] [blame^] | 274 | # Validation is commented due to onu_omci_stats is not supported by getextval |
| 275 | #${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 276 | #${rc} ${OMCI_counter_dict}= Get OMCI counter statistics dictionary ${onu_device_id} |
| 277 | #Run Keyword If ${rc} != 0 FAIL Could not get baseline ONU OMCI counter statistic of ONU ${src['onu']}! |
| 278 | #${BaseTxArFrames}= Get From Dictionary ${OMCI_counter_dict} BaseTxArFrames |
| 279 | #${BaseRxAkFrames}= Get From Dictionary ${OMCI_counter_dict} BaseRxAkFrames |
| 280 | #Should Be Equal As Integers ${BaseTxArFrames} ${BaseRxAkFrames} Number of baseline Rx and Tx frames do not match! |
TorstenThieme | 517b7ce | 2022-12-19 11:56:34 +0000 | [diff] [blame] | 281 | # some additional checks |
Guru | 988beba | 2024-11-24 14:55:43 +0530 | [diff] [blame^] | 282 | #${ExtRxAkFrames}= Get From Dictionary ${OMCI_counter_dict} ExtRxAkFrames |
| 283 | #${ExtRxNoAkFrames}= Get From Dictionary ${OMCI_counter_dict} ExtRxNoAkFrames |
| 284 | #${ExtTxArFrames}= Get From Dictionary ${OMCI_counter_dict} ExtTxArFrames |
| 285 | #${ExtTxNoArFrames}= Get From Dictionary ${OMCI_counter_dict} ExtTxNoArFrames |
| 286 | #${TxOmciCounterRetries}= Get From Dictionary ${OMCI_counter_dict} TxOmciCounterRetries |
| 287 | #${TxOmciCounterTimeouts}= Get From Dictionary ${OMCI_counter_dict} TxOmciCounterTimeouts |
| 288 | #Should Be Equal 0 ${ExtRxAkFrames} ExtRxAkFrames found in baseline OMCI! |
| 289 | #Should Be Equal 0 ${ExtRxNoAkFrames} ExtRxNoAkFrames found in baseline OMCI! |
| 290 | #Should Be Equal 0 ${ExtTxArFrames} ExtTxArFrames found in baseline OMCI! |
| 291 | #Should Be Equal 0 ${ExtTxNoArFrames} ExtTxNoArFrames found in baseline OMCI! |
| 292 | #Should Be Equal 0 ${TxOmciCounterRetries} TxOmciCounterRetries found in baseline OMCI! |
| 293 | #Should Be Equal 0 ${TxOmciCounterTimeouts} TxOmciCounterTimeouts found in baseline OMCI! |
TorstenThieme | 89930b9 | 2022-06-16 12:13:51 +0000 | [diff] [blame] | 294 | Delete All Devices and Verify |
| 295 | Delete MIB Template Data ${INFRA_NAMESPACE} |
| 296 | # Restart BBSIM with OMCI Extended Message |
| 297 | ${extra_helm_flags} Catenate |
| 298 | ... --set onu=2,pon=2,controlledActivation=only-onu,injectOmciUnknownAttributes=true,injectOmciUnknownMe=true |
TorstenThieme | b56633f | 2022-07-06 09:41:04 +0000 | [diff] [blame] | 299 | ${extra_helm_flags}= Run Keyword If ${is_omcc_extended} |
| 300 | ... Catenate ${extra_helm_flags} --set omccVersion=${omcc_version} |
| 301 | ... ELSE Catenate ${extra_helm_flags} --set omccVersion=180 |
| 302 | Restart BBSIM by Helm Charts ${NAMESPACE} extra_helm_flags=${extra_helm_flags} |
TorstenThieme | 89930b9 | 2022-06-16 12:13:51 +0000 | [diff] [blame] | 303 | # Start Onu again with OMCI Extended Message |
| 304 | Setup |
| 305 | ${src}= Set Variable ${hosts.src[${firstonu}]} |
| 306 | Log \r\nONU ${src['onu']}: startup with MIB upload cycle and storage of template data to etcd. console=yes |
| 307 | ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release bbsim0 |
| 308 | Power On ONU ${NAMESPACE} ${bbsim_pod} ${src['onu']} |
| 309 | ${timeStart}= Get Current Date |
| 310 | ${extendedonustartup}= Get ONU Startup Duration ${state2test} ${firstonu} ${timeStart} ${waittime} |
| 311 | # check MIB Template data stored in etcd |
| 312 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 3s |
| 313 | ... Verify MIB Template Data Available ${INFRA_NAMESPACE} |
| 314 | ${MibTemplateDataExtended}= Get ONU MIB Template Data ${INFRA_NAMESPACE} |
| 315 | # Checks: |
| 316 | # - compare durations of MIB download, OMCI extended message duration should be less than %60 of baseline |
| 317 | # - both stored MIB tenmplates in ETCD should be equal |
TorstenThieme | b56633f | 2022-07-06 09:41:04 +0000 | [diff] [blame] | 318 | ${duration_compare}= Evaluate ${baselineonustartup}*0.8 > ${extendedonustartup} |
TorstenThieme | 89930b9 | 2022-06-16 12:13:51 +0000 | [diff] [blame] | 319 | Should Be True ${duration_compare} MIB Template download too slow for OMCI extended message! |
| 320 | # remove "TemplateCreated" e.g. "TemplateCreated":"2022-06-15 11:23:47.306519", |
| 321 | ${remove_regexp} Set Variable (?ms)"TemplateCreated":"[^"]*", |
| 322 | ${MibTemplateDataBaseline}= Remove String Using Regexp ${MibTemplateDataBaseline} ${remove_regexp} |
| 323 | ${MibTemplateDataExtended}= Remove String Using Regexp ${MibTemplateDataExtended} ${remove_regexp} |
| 324 | # Due to VOL-4721 comparison of MIB templates has to be executed without unknown ME! |
| 325 | # After correction of Jira remove the following lines and this comment |
| 326 | ${remove_regexp} Set Variable (?ms)"UnknownItuG988ManagedEntity":[^}]*}}} |
| 327 | ${MibTemplateDataBaseline}= Remove String Using Regexp ${MibTemplateDataBaseline} ${remove_regexp} |
| 328 | ${MibTemplateDataExtended}= Remove String Using Regexp ${MibTemplateDataExtended} ${remove_regexp} |
| 329 | # end of handling for VOL-4721 |
| 330 | Should Be Equal As Strings ${MibTemplateDataBaseline} ${MibTemplateDataExtended} MIB Templates not equal! |
TorstenThieme | 517b7ce | 2022-12-19 11:56:34 +0000 | [diff] [blame] | 331 | # get ONU OMCI counter statistics |
| 332 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 333 | ${rc} ${OMCI_counter_dict}= Get OMCI counter statistics dictionary ${onu_device_id} |
| 334 | Run Keyword If ${rc} != 0 FAIL Could not get extended ONU OMCI counter statistic of ONU ${src['onu']}! |
| 335 | ${ExtTxArFrames}= Get From Dictionary ${OMCI_counter_dict} ExtTxArFrames |
| 336 | ${ExtRxAkFrames}= Get From Dictionary ${OMCI_counter_dict} ExtRxAkFrames |
| 337 | Should Be Equal As Integers ${ExtTxArFrames} ${ExtRxAkFrames} Number of extended Rx and Tx frames do not match! |
| 338 | # check baseline and extended OMCI frames counter |
| 339 | ${TxArFrames_compare}= Evaluate ${BaseTxArFrames}*0.05 > ${ExtTxArFrames} |
| 340 | Should Be True ${TxArFrames_compare} Comparison of TxArFrames failed (${BaseTxArFrames}:${ExtTxArFrames})! |
| 341 | ${RxAkFrames_compare}= Evaluate ${BaseRxAkFrames}*0.05 > ${ExtRxAkFrames} |
| 342 | Should Be True ${RxAkFrames_compare} Comparison of RxAkFrames failed (${BaseRxAkFrames}:${ExtRxAkFrames})! |
| 343 | # some additional checks |
| 344 | ${TxOmciCounterRetries}= Get From Dictionary ${OMCI_counter_dict} TxOmciCounterRetries |
| 345 | ${TxOmciCounterTimeouts}= Get From Dictionary ${OMCI_counter_dict} TxOmciCounterTimeouts |
| 346 | Should Be Equal 0 ${TxOmciCounterRetries} TxOmciCounterRetries found in extended OMCI! |
| 347 | Should Be Equal 0 ${TxOmciCounterTimeouts} TxOmciCounterTimeouts found in extended OMCI! |
TorstenThieme | b56633f | 2022-07-06 09:41:04 +0000 | [diff] [blame] | 348 | # Restart BBSIM with OMCI Message Version read at begin of test |
| 349 | ${extra_helm_flags}= Catenate |
| 350 | ... --set onu=2,pon=2,controlledActivation=only-onu,injectOmciUnknownAttributes=true,injectOmciUnknownMe=true |
| 351 | ... --set omccVersion=${omcc_version} |
| 352 | Run Keyword Unless ${is_omcc_extended} Restart BBSIM by Helm Charts ${NAMESPACE} extra_helm_flags=${extra_helm_flags} |
TorstenThieme | 89930b9 | 2022-06-16 12:13:51 +0000 | [diff] [blame] | 353 | |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 354 | Get ONU Startup Duration |
| 355 | [Documentation] This keyword delivers startup duration of onu |
TorstenThieme | 89930b9 | 2022-06-16 12:13:51 +0000 | [diff] [blame] | 356 | [Arguments] ${state2test} ${onu} ${starttime} ${waittime}=50ms |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 357 | ${src}= Set Variable ${hosts.src[${onu}]} |
TorstenThieme | 66c91a8 | 2020-10-19 13:37:53 +0000 | [diff] [blame] | 358 | ${admin_state} ${oper_status} ${connect_status} ${onu_state_nb} ${onu_state}= |
| 359 | ... Map State ${state2test} |
TorstenThieme | 89930b9 | 2022-06-16 12:13:51 +0000 | [diff] [blame] | 360 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} ${waittime} |
TorstenThieme | 840380b | 2020-10-02 09:31:56 +0000 | [diff] [blame] | 361 | ... Validate Device ${admin_state} ${oper_status} ${connect_status} |
| 362 | ... ${src['onu']} onu=True onu_reason=${onu_state} |
| 363 | ${timeCurrent} = Get Current Date |
| 364 | ${timeTotalMs} = Subtract Date From Date ${timeCurrent} ${startTime} result_format=number |
| 365 | Log ONU ${src['onu']}: reached the state ${onu_state} after ${timeTotalMs} sec. console=yes |
| 366 | [Return] ${timeTotalMs} |
TorstenThieme | 2d8327b | 2022-03-15 08:42:27 +0000 | [diff] [blame] | 367 | |
| 368 | Bring Up ONU |
| 369 | [Documentation] This keyword brings up onu |
| 370 | [Arguments] ${onu}=0 ${state2reach}=omci-flows-pushed |
| 371 | ${src}= Set Variable ${hosts.src[${onu}]} |
| 372 | ${admin_state} ${oper_status} ${connect_status} ${onu_state_nb} ${onu_state}= |
| 373 | ... Map State ${state2reach} |
| 374 | ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release bbsim0 |
| 375 | Power On ONU ${NAMESPACE} ${bbsim_pod} ${src['onu']} |
| 376 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 1s |
| 377 | ... Validate Device ${admin_state} ${oper_status} ${connect_status} |
| 378 | ... ${src['onu']} onu=True onu_reason=${onu_state} |