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 | |
| 56 | *** Test Cases *** |
| 57 | ANI-G Test |
| 58 | [Documentation] Validates ANI-G output of ONU device(s): |
| 59 | [Tags] functionalOnuGo AniGTest |
| 60 | [Setup] Start Logging AniGTest |
| 61 | FOR ${I} IN RANGE 0 ${num_all_onus} |
| 62 | ${src}= Set Variable ${hosts.src[${I}]} |
| 63 | ${onu_device_id}= Get Device ID From SN ${src['onu']} |
| 64 | ${voltctl_commad} = Catenate SEPARATOR= |
| 65 | ... voltctl device getextval onu_pon_optical_info ${onu_device_id} |
| 66 | ${rc} ${output}= Run and Return Rc and Output ${voltctl_commad} |
| 67 | Should Be Equal As Integers ${rc} 0 |
| 68 | Should Contain ${output} POWER_FEED_VOLTAGE__VOLTS: |
| 69 | Should Contain ${output} 3.26 |
| 70 | Should Contain ${output} RECEIVED_OPTICAL_POWER__dBm: |
| 71 | Should Contain ${output} MEAN_OPTICAL_LAUNCH_POWER__dBm: |
| 72 | Should Contain ${output} LASER_BIAS_CURRENT__mA: |
| 73 | Should Contain ${output} TEMPERATURE__Celsius: |
| 74 | END |
| 75 | [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs |
| 76 | ... AND Stop Logging SanityTestOnuGo |
| 77 | |
| 78 | *** Keywords *** |
| 79 | Setup Suite |
| 80 | [Documentation] Set up the test suite inclusive enable device and sanity test of given workflow |
| 81 | Common Test Suite Setup |
| 82 | ${switch_type}= Get Variable Value ${web_power_switch.type} |
| 83 | Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type} |
| 84 | Setup |
| 85 | Run Keyword If ${has_dataplane} Clean Up Linux |
| 86 | Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT |
| 87 | ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT |
| 88 | ... ELSE Perform Sanity Test |