blob: 94849856d91adabef723cba758f230e64abc967c [file] [log] [blame]
Joey Armstrongb87031c2022-12-17 22:03:24 -05001# Copyright 2021-2022 Open Networking Foundation (ONF) and the ONF Contributors
TorstenThieme1c1f5fa2021-06-18 13:40:30 +00002#
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
TorstenThieme373adfe2021-12-16 13:03:04 +000033Resource ../../libraries/onu_utilities.robot
TorstenThieme1c1f5fa2021-06-18 13:40:30 +000034Resource ../../variables/variables.robot
35Resource ../../libraries/power_switch.robot
36
37*** Variables ***
Hardik Windlass4288c6a2021-09-28 07:22:06 +000038${NAMESPACE} voltha
39${INFRA_NAMESPACE} default
TorstenThieme1c1f5fa2021-06-18 13:40:30 +000040${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 Windlassb1bda362021-11-24 11:54:36 +000057# 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
TorstenThieme1c1f5fa2021-06-18 13:40:30 +000063*** Test Cases ***
64ANI-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
TorstenThieme373adfe2021-12-16 13:03:04 +000082 [Teardown] Run Keywords Printout ONU Serial Number and Device Id
83 ... AND Run Keyword If ${logging} Collect Logs
TorstenThieme1c1f5fa2021-06-18 13:40:30 +000084 ... AND Stop Logging SanityTestOnuGo
85
86*** Keywords ***
87Setup Suite
88 [Documentation] Set up the test suite inclusive enable device and sanity test of given workflow
Andrea Campanella82add372021-11-05 12:01:15 +010089 Start Logging Setup or Teardown Setup-${SUITE NAME}
TorstenThieme1c1f5fa2021-06-18 13:40:30 +000090 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 Campanella82add372021-11-05 12:01:15 +010098 Run Keyword If ${logging} Collect Logs
99 Stop Logging Setup or Teardown Setup-${SUITE NAME}