Joey Armstrong | b87031c | 2022-12-17 22:03:24 -0500 | [diff] [blame] | 1 | # Copyright 2021-2022 Open Networking Foundation (ONF) and the ONF Contributors |
TorstenThieme | 1c1f5fa | 2021-06-18 13:40:30 +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 | # 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 |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame] | 33 | Resource ../../libraries/onu_utilities.robot |
TorstenThieme | 1c1f5fa | 2021-06-18 13:40:30 +0000 | [diff] [blame] | 34 | Resource ../../variables/variables.robot |
| 35 | Resource ../../libraries/power_switch.robot |
| 36 | |
| 37 | *** Variables *** |
Hardik Windlass | 4288c6a | 2021-09-28 07:22:06 +0000 | [diff] [blame] | 38 | ${NAMESPACE} voltha |
| 39 | ${INFRA_NAMESPACE} default |
TorstenThieme | 1c1f5fa | 2021-06-18 13:40:30 +0000 | [diff] [blame] | 40 | ${timeout} 60s |
| 41 | ${of_id} 0 |
| 42 | ${logical_id} 0 |
| 43 | ${has_dataplane} True |
| 44 | ${external_libs} True |
| 45 | ${teardown_device} True |
| 46 | ${scripts} ../../scripts |
| 47 | # Per-test logging on failure is turned off by default; set this variable to enable |
| 48 | ${container_log_dir} ${None} |
| 49 | # determines the environment workflow: DT, TT or ATT (default) |
| 50 | # example: -v workflow:DT |
| 51 | ${workflow} ATT |
| 52 | # logging flag to enable Collect Logs, can be passed via the command line too |
| 53 | # example: -v logging:True |
| 54 | ${logging} False |
| 55 | ${data_dir} ../data |
| 56 | |
Hardik Windlass | b1bda36 | 2021-11-24 11:54:36 +0000 | [diff] [blame] | 57 | # flag to choose the subscriber provisioning command type in ONOS |
| 58 | # TT often provision a single services for a subscriber (eg: hsia, voip, ...) one after the other. |
| 59 | # if set to True, command used is "volt-add-subscriber-unitag" |
| 60 | # if set to False, comand used is "volt-add-subscriber-access" |
| 61 | ${unitag_sub} False |
| 62 | |
TorstenThieme | 1c1f5fa | 2021-06-18 13:40:30 +0000 | [diff] [blame] | 63 | *** Test Cases *** |
| 64 | ANI-G Test |
| 65 | [Documentation] Validates ANI-G output of ONU device(s): |
| 66 | [Tags] functionalOnuGo AniGTest |
| 67 | [Setup] Start Logging AniGTest |
| 68 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 69 | ${src}= Set Variable ${hosts.src[${I}]} |
| 70 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 71 | ${voltctl_commad} = Catenate SEPARATOR= |
| 72 | ... voltctl device getextval onu_pon_optical_info ${onu_device_id} |
| 73 | ${rc} ${output}= Run and Return Rc and Output ${voltctl_commad} |
| 74 | Should Be Equal As Integers ${rc} 0 |
| 75 | Should Contain ${output} POWER_FEED_VOLTAGE__VOLTS: |
| 76 | Should Contain ${output} 3.26 |
| 77 | Should Contain ${output} RECEIVED_OPTICAL_POWER__dBm: |
| 78 | Should Contain ${output} MEAN_OPTICAL_LAUNCH_POWER__dBm: |
| 79 | Should Contain ${output} LASER_BIAS_CURRENT__mA: |
| 80 | Should Contain ${output} TEMPERATURE__Celsius: |
| 81 | END |
TorstenThieme | 373adfe | 2021-12-16 13:03:04 +0000 | [diff] [blame] | 82 | [Teardown] Run Keywords Printout ONU Serial Number and Device Id |
| 83 | ... AND Run Keyword If ${logging} Collect Logs |
TorstenThieme | 1c1f5fa | 2021-06-18 13:40:30 +0000 | [diff] [blame] | 84 | ... AND Stop Logging SanityTestOnuGo |
| 85 | |
| 86 | *** Keywords *** |
| 87 | Setup Suite |
| 88 | [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] | 89 | Start Logging Setup or Teardown Setup-${SUITE NAME} |
TorstenThieme | 1c1f5fa | 2021-06-18 13:40:30 +0000 | [diff] [blame] | 90 | Common Test Suite Setup |
| 91 | ${switch_type}= Get Variable Value ${web_power_switch.type} |
| 92 | Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type} |
| 93 | Setup |
| 94 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 95 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT |
| 96 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT |
| 97 | ... ELSE Perform Sanity Test |
Andrea Campanella | 82add37 | 2021-11-05 12:01:15 +0100 | [diff] [blame] | 98 | Run Keyword If ${logging} Collect Logs |
| 99 | Stop Logging Setup or Teardown Setup-${SUITE NAME} |