blob: 8961c34a894f598268088379564d87782f6845c8 [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
Hardik Windlassb1bda362021-11-24 11:54:36 +000056# flag to choose the subscriber provisioning command type in ONOS
57# TT often provision a single services for a subscriber (eg: hsia, voip, ...) one after the other.
58# if set to True, command used is "volt-add-subscriber-unitag"
59# if set to False, comand used is "volt-add-subscriber-access"
60${unitag_sub} False
61
TorstenThieme1c1f5fa2021-06-18 13:40:30 +000062*** Test Cases ***
63ANI-G Test
64 [Documentation] Validates ANI-G output of ONU device(s):
65 [Tags] functionalOnuGo AniGTest
66 [Setup] Start Logging AniGTest
67 FOR ${I} IN RANGE 0 ${num_all_onus}
68 ${src}= Set Variable ${hosts.src[${I}]}
69 ${onu_device_id}= Get Device ID From SN ${src['onu']}
70 ${voltctl_commad} = Catenate SEPARATOR=
71 ... voltctl device getextval onu_pon_optical_info ${onu_device_id}
72 ${rc} ${output}= Run and Return Rc and Output ${voltctl_commad}
73 Should Be Equal As Integers ${rc} 0
74 Should Contain ${output} POWER_FEED_VOLTAGE__VOLTS:
75 Should Contain ${output} 3.26
76 Should Contain ${output} RECEIVED_OPTICAL_POWER__dBm:
77 Should Contain ${output} MEAN_OPTICAL_LAUNCH_POWER__dBm:
78 Should Contain ${output} LASER_BIAS_CURRENT__mA:
79 Should Contain ${output} TEMPERATURE__Celsius:
80 END
81 [Teardown] Run Keywords Run Keyword If ${logging} Collect Logs
82 ... AND Stop Logging SanityTestOnuGo
83
84*** Keywords ***
85Setup Suite
86 [Documentation] Set up the test suite inclusive enable device and sanity test of given workflow
Andrea Campanella82add372021-11-05 12:01:15 +010087 Start Logging Setup or Teardown Setup-${SUITE NAME}
TorstenThieme1c1f5fa2021-06-18 13:40:30 +000088 Common Test Suite Setup
89 ${switch_type}= Get Variable Value ${web_power_switch.type}
90 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
91 Setup
92 Run Keyword If ${has_dataplane} Clean Up Linux
93 Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT
94 ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT
95 ... ELSE Perform Sanity Test
Andrea Campanella82add372021-11-05 12:01:15 +010096 Run Keyword If ${logging} Collect Logs
97 Stop Logging Setup or Teardown Setup-${SUITE NAME}