TorstenThieme | 53450ff | 2021-05-11 09:44:33 +0000 | [diff] [blame] | 1 | # Copyright 2021 - 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 Negative test states of ONU Go adapter with ATT workflows only (not for DT/TT workflow!) |
| 17 | Suite Setup Setup Suite |
| 18 | Suite Teardown Teardown Suite |
| 19 | Test Setup Setup |
| 20 | Test Teardown Teardown |
| 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 ../../libraries/onu_utilities.robot |
| 33 | Resource ../../libraries/bbsim.robot |
| 34 | Resource ../../variables/variables.robot |
| 35 | |
| 36 | *** Variables *** |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 37 | ${NAMESPACE} voltha |
| 38 | ${INFRA_NAMESPACE} default |
TorstenThieme | 53450ff | 2021-05-11 09:44:33 +0000 | [diff] [blame] | 39 | ${timeout} 300s |
| 40 | ${of_id} 0 |
| 41 | ${logical_id} 0 |
| 42 | ${has_dataplane} True |
| 43 | ${external_libs} True |
| 44 | ${teardown_device} True |
| 45 | ${scripts} ../../scripts |
| 46 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 47 | ${container_log_dir} ${None} |
| 48 | # KV Store Prefix |
| 49 | # example: -v kvstoreprefix:voltha_voltha |
| 50 | ${kvstoreprefix} voltha_voltha |
| 51 | # used tech profile, can be passed via the command line too, valid values: default (=1T1GEM), 1T4GEM, 1T8GEM |
| 52 | # example: -v techprofile:1T4GEM |
| 53 | ${techprofile} default |
| 54 | # flag debugmode is used, if true timeout calculation various, can be passed via the command line too |
| 55 | # example: -v debugmode:True |
| 56 | ${debugmode} False |
| 57 | # logging flag to enable Collect Logs, can be passed via the command line too |
| 58 | # example: -v logging:True |
| 59 | ${logging} False |
| 60 | # if True execution will be paused before clean up, only use in case of manual testing, do not use in ci pipeline! |
| 61 | # example: -v pausebeforecleanup:True |
| 62 | ${pausebeforecleanup} False |
| 63 | # if True some outputs to console are done during running tests e.g. long duration flow test |
| 64 | # example: -v print2console:True |
| 65 | ${print2console} False |
| 66 | ${data_dir} ../data |
| 67 | |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 68 | # flag to choose the subscriber provisioning command type in ONOS |
| 69 | # TT often provision a single services for a subscriber (eg: hsia, voip, ...) one after the other. |
| 70 | # if set to True, command used is "volt-add-subscriber-unitag" |
| 71 | # if set to False, comand used is "volt-add-subscriber-access" |
| 72 | ${unitag_sub} False |
TorstenThieme | 53450ff | 2021-05-11 09:44:33 +0000 | [diff] [blame] | 73 | |
| 74 | *** Test Cases *** |
| 75 | ONU Negative State Test |
| 76 | [Documentation] Validates the ONU Go adapter states will never leave starting-openomci |
| 77 | ... Due to a 'omci-response-rate' lower than 8 more OMCI messages will be through away by BBSIM than |
| 78 | ... repeated by openonu-go-adapter. So ONU will never leave starting-openomci state. |
| 79 | ... Timeout has to set at least to 300s (or more) |
| 80 | [Tags] NegativeStateTestOnuGo |
| 81 | [Setup] Run Keywords Start Logging ONUNegativeStateTest |
| 82 | ... AND Setup |
| 83 | # Suite Variable will be overwritten by Teardown of Current State Test All Onus |
| 84 | Set Suite Variable ${StateTestAllONUs} True |
| 85 | ${seconds}= Convert Time ${timeout} |
| 86 | ${seconds}= Convert To String ${seconds} |
| 87 | ${seconds}= Get Substring ${seconds} 0 -2 |
| 88 | FOR ${I} IN RANGE ${seconds} |
| 89 | Sleep 1s |
| 90 | Current State Test All Onus starting-openomci timeout=1x |
| 91 | Exit For Loop If not ${StateTestAllONUs} |
| 92 | END |
| 93 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 94 | ... AND Stop Logging ONUStateTest |
| 95 | |
| 96 | |
| 97 | *** Keywords *** |
| 98 | Setup Suite |
| 99 | [Documentation] Set up the test suite |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 100 | Start Logging Setup or Teardown Setup-${SUITE NAME} |
TorstenThieme | 53450ff | 2021-05-11 09:44:33 +0000 | [diff] [blame] | 101 | ${LogInfo}= Catenate |
| 102 | ... \r\nPassed arguments: |
| 103 | ... techprofile:${techprofile}, |
| 104 | ... debugmode:${debugmode}, logging:${logging}, pausebeforecleanup:${pausebeforecleanup}, |
| 105 | ... print2console:${print2console} |
| 106 | Log ${LogInfo} console=yes |
| 107 | Common Test Suite Setup |
| 108 | ${techprofile}= Set Variable If "${techprofile}"=="1T1GEM" default ${techprofile} |
| 109 | Set Suite Variable ${techprofile} |
| 110 | Run Keyword If "${techprofile}"=="default" Log To Console \nTechProfile:default (1T1GEM) |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 111 | ... ELSE IF "${techprofile}"=="1T4GEM" Set Tech Profile 1T4GEM ${INFRA_NAMESPACE} |
| 112 | ... ELSE IF "${techprofile}"=="1T8GEM" Set Tech Profile 1T8GEM ${INFRA_NAMESPACE} |
TorstenThieme | 53450ff | 2021-05-11 09:44:33 +0000 | [diff] [blame] | 113 | ... ELSE Fail The TechProfile (${techprofile}) is not valid! |
TorstenThieme | 53450ff | 2021-05-11 09:44:33 +0000 | [diff] [blame] | 114 | # delete etcd MIB Template Data |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 115 | Delete MIB Template Data ${INFRA_NAMESPACE} |
TorstenThieme | 53450ff | 2021-05-11 09:44:33 +0000 | [diff] [blame] | 116 | # delete etcd onu data |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 117 | Delete ONU Go Adapter ETCD Data namespace=${INFRA_NAMESPACE} validate=True |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 118 | Run Keyword If ${logging} Collect Logs |
| 119 | Stop Logging Setup or Teardown Setup-${SUITE NAME} |
TorstenThieme | 53450ff | 2021-05-11 09:44:33 +0000 | [diff] [blame] | 120 | |
| 121 | Teardown Suite |
| 122 | [Documentation] Replaces the Suite Teardown in utils.robot. |
| 123 | ... Cleans up and checks all ONU ports disabled in ONOS. |
| 124 | ... Furthermore gives the possibility to pause the execution. |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 125 | Start Logging Setup or Teardown Teardown-${SUITE NAME} |
TorstenThieme | 53450ff | 2021-05-11 09:44:33 +0000 | [diff] [blame] | 126 | Run Keyword If ${pausebeforecleanup} Import Library Dialogs |
| 127 | Run Keyword If ${pausebeforecleanup} Pause Execution Press OK to continue with clean up! |
| 128 | Run Keyword If ${pausebeforecleanup} Log Teardown will be continued... console=yes |
| 129 | Run Keyword If ${teardown_device} Delete All Devices and Verify |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 130 | Wait Until Keyword Succeeds ${timeout} 1s Validate Onu Data In Etcd ${INFRA_NAMESPACE} 0 ${kvstoreprefix} |
| 131 | ... without_pm_data=False |
TorstenThieme | 731a759 | 2021-07-01 14:26:54 +0000 | [diff] [blame] | 132 | Wait for Ports in ONOS for all OLTs ${ONOS_SSH_IP} ${ONOS_SSH_PORT} 0 BBSM ${timeout} |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 133 | Run Keyword If ${logging} Collect Logs |
| 134 | Stop Logging Setup or Teardown Teardown-${SUITE NAME} |
TorstenThieme | 53450ff | 2021-05-11 09:44:33 +0000 | [diff] [blame] | 135 | Close All ONOS SSH Connections |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 136 | Remove Tech Profile ${INFRA_NAMESPACE} |