blob: 4c4953acd8225daed5f83a07f4d782ccce63d6c3 [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 ***
37${namespace} voltha
38${timeout} 60s
39${of_id} 0
40${logical_id} 0
41${has_dataplane} True
42${external_libs} True
43${teardown_device} True
44${scripts} ../../scripts
45# Per-test logging on failure is turned off by default; set this variable to enable
46${container_log_dir} ${None}
47# determines the environment workflow: DT, TT or ATT (default)
48# example: -v workflow:DT
49${workflow} ATT
50# logging flag to enable Collect Logs, can be passed via the command line too
51# example: -v logging:True
52${logging} False
53${data_dir} ../data
54
55*** Test Cases ***
56ANI-G Test
57 [Documentation] Validates ANI-G output of ONU device(s):
58 [Tags] functionalOnuGo AniGTest
59 [Setup] Start Logging AniGTest
60 FOR ${I} IN RANGE 0 ${num_all_onus}
61 ${src}= Set Variable ${hosts.src[${I}]}
62 ${onu_device_id}= Get Device ID From SN ${src['onu']}
63 ${voltctl_commad} = Catenate SEPARATOR=
64 ... voltctl device getextval onu_pon_optical_info ${onu_device_id}
65 ${rc} ${output}= Run and Return Rc and Output ${voltctl_commad}
66 Should Be Equal As Integers ${rc} 0
67 Should Contain ${output} POWER_FEED_VOLTAGE__VOLTS:
68 Should Contain ${output} 3.26
69 Should Contain ${output} RECEIVED_OPTICAL_POWER__dBm:
70 Should Contain ${output} MEAN_OPTICAL_LAUNCH_POWER__dBm:
71 Should Contain ${output} LASER_BIAS_CURRENT__mA:
72 Should Contain ${output} TEMPERATURE__Celsius:
73 END
74 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
75 ... AND Stop Logging SanityTestOnuGo
76
77*** Keywords ***
78Setup Suite
79 [Documentation] Set up the test suite inclusive enable device and sanity test of given workflow
80 Common Test Suite Setup
81 ${switch_type}= Get Variable Value ${web_power_switch.type}
82 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
83 Setup
84 Run Keyword If ${has_dataplane} Clean Up Linux
85 Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT
86 ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT
87 ... ELSE Perform Sanity Test