TorstenThieme | 1c1f5fa | 2021-06-18 13:40:30 +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 | # FIXME Can we use the same test against BBSim and Hardware? |
| 15 | |
| 16 | *** Settings *** |
| 17 | Documentation Test of open ONU go adapter OMCI Get |
| 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 *** |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 37 | ${NAMESPACE} voltha |
| 38 | ${INFRA_NAMESPACE} default |
TorstenThieme | 1c1f5fa | 2021-06-18 13:40:30 +0000 | [diff] [blame] | 39 | ${timeout} 60s |
| 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 | # determines the environment workflow: DT, TT or ATT (default) |
| 49 | # example: -v workflow:DT |
| 50 | ${workflow} ATT |
| 51 | # logging flag to enable Collect Logs, can be passed via the command line too |
| 52 | # example: -v logging:True |
| 53 | ${logging} False |
| 54 | ${data_dir} ../data |
| 55 | |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 56 | # flag to choose the subscriber provisioning command type in ONOS |
| 57 | # TT often provision a single services for a subscriber (eg: hsia, voip, ...) one after the other. |
| 58 | # if set to True, command used is "volt-add-subscriber-unitag" |
| 59 | # if set to False, comand used is "volt-add-subscriber-access" |
| 60 | ${unitag_sub} False |
| 61 | |
TorstenThieme | 1c1f5fa | 2021-06-18 13:40:30 +0000 | [diff] [blame] | 62 | *** Test Cases *** |
| 63 | ANI-G Test |
| 64 | [Documentation] Validates ANI-G output of ONU device(s): |
| 65 | [Tags] functionalOnuGo AniGTest |
| 66 | [Setup] Start Logging AniGTest |
| 67 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 68 | ${src}= Set Variable ${hosts.src[${I}]} |
| 69 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 70 | ${voltctl_commad} = Catenate SEPARATOR= |
| 71 | ... voltctl device getextval onu_pon_optical_info ${onu_device_id} |
| 72 | ${rc} ${output}= Run and Return Rc and Output ${voltctl_commad} |
| 73 | Should Be Equal As Integers ${rc} 0 |
| 74 | Should Contain ${output} POWER_FEED_VOLTAGE__VOLTS: |
| 75 | Should Contain ${output} 3.26 |
| 76 | Should Contain ${output} RECEIVED_OPTICAL_POWER__dBm: |
| 77 | Should Contain ${output} MEAN_OPTICAL_LAUNCH_POWER__dBm: |
| 78 | Should Contain ${output} LASER_BIAS_CURRENT__mA: |
| 79 | Should Contain ${output} TEMPERATURE__Celsius: |
| 80 | END |
| 81 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 82 | ... AND Stop Logging SanityTestOnuGo |
| 83 | |
| 84 | *** Keywords *** |
| 85 | Setup Suite |
| 86 | [Documentation] Set up the test suite inclusive enable device and sanity test of given workflow |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 87 | Start Logging Setup or Teardown Setup-${SUITE NAME} |
TorstenThieme | 1c1f5fa | 2021-06-18 13:40:30 +0000 | [diff] [blame] | 88 | Common Test Suite Setup |
| 89 | ${switch_type}= Get Variable Value ${web_power_switch.type} |
| 90 | Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type} |
| 91 | Setup |
| 92 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 93 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT |
| 94 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT |
| 95 | ... ELSE Perform Sanity Test |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 96 | Run Keyword If ${logging} Collect Logs |
| 97 | Stop Logging Setup or Teardown Setup-${SUITE NAME} |