blob: e401f1170efc449033821977034df5f94871889b [file] [log] [blame]
TorstenThieme1c1f5fa2021-06-18 13:40:30 +00001# 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 ***
17Documentation Test of open ONU go adapter OMCI Get
18Suite Setup Setup Suite
19Test Setup Setup
20Test Teardown Teardown
21Suite Teardown Teardown Suite
22Library Collections
23Library String
24Library OperatingSystem
25Library XML
26Library RequestsLibrary
27Library ../../libraries/DependencyLibrary.py
28Resource ../../libraries/onos.robot
29Resource ../../libraries/voltctl.robot
30Resource ../../libraries/voltha.robot
31Resource ../../libraries/utils.robot
32Resource ../../libraries/k8s.robot
33Resource ../../variables/variables.robot
34Resource ../../libraries/power_switch.robot
35
36*** Variables ***
Hardik Windlass4288c6a2021-09-28 07:22:06 +000037${NAMESPACE} voltha
38${INFRA_NAMESPACE} default
TorstenThieme1c1f5fa2021-06-18 13:40:30 +000039${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 ***
57ANI-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 ***
79Setup 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