blob: 92e4424a69cf56d808095110dcbebb4384445f5d [file] [log] [blame]
Matteo Scandoloa80b4732020-09-04 13:51:10 -07001# Copyright 2017-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# onos common functions
15
16*** Settings ***
17Documentation Library for BBSimCtl interactions
18Resource ./k8s.robot
19
20*** Keywords ***
21List ONUs
22 [Documentation] Lists ONUs via BBSimctl
23 [Arguments] ${namespace} ${bbsim_pod_name}
24 ${onus} ${rc}= Exec Pod And Return Output And RC ${namespace} ${bbsim_pod_name}
25 ... bbsimctl onu list
26 Log ${onus}
27 Should Be Equal as Integers ${rc} 0
28
29Restart Auth
30 [Documentation] Restart Authentication on a BBSim ONU
31 [Arguments] ${namespace} ${bbsim_pod_name} ${onu}
32 ${res} ${rc}= Exec Pod And Return Output And RC ${namespace} ${bbsim_pod_name}
33 ... bbsimctl onu auth_restart ${onu}
34 Log ${res}
35 Should Be Equal as Integers ${rc} 0
36
37Restart DHCP
38 [Documentation] Restart Dhcp on a BBSim ONU
39 [Arguments] ${namespace} ${bbsim_pod_name} ${onu}
40 ${res} ${rc}= Exec Pod And Return Output And RC ${namespace} ${bbsim_pod_name}
41 ... bbsimctl onu dhcp_restart ${onu}
42 Log ${res}
43 Should Be Equal as Integers ${rc} 0
44
45List Service
46 [Documentation] Lists Service via BBSimctl
47 [Arguments] ${namespace} ${bbsim_pod_name}
48 ${service} ${rc}= Exec Pod And Return Output And RC ${namespace} ${bbsim_pod_name}
49 ... bbsimctl service list
50 Log ${service}
51 Should Be Equal as Integers ${rc} 0
52
53JoinOrLeave Igmp
54 [Documentation] Joins or Leaves Igmp on a BBSim ONU
55 [Arguments] ${namespace} ${bbsim_pod_name} ${onu} ${task} ${group_address}=224.0.0.22
56 ${res} ${rc}= Exec Pod And Return Output And RC ${namespace} ${bbsim_pod_name}
57 ... bbsimctl onu igmp ${onu} ${task} ${group_address}
58 Log ${res}
59 Should Be Equal as Integers ${rc} 0
TorstenThiemefe7099e2021-01-29 08:41:04 +000060
61Power On ONU
62 [Documentation] This keyword turns on the power for onu device.
63 [Arguments] ${namespace} ${bbsim_pod_name} ${onu}
64 ${result} ${rc}= Exec Pod And Return Output And RC ${namespace} ${bbsim_pod_name}
65 ... bbsimctl onu poweron ${onu}
66 Should Contain ${result} successfully msg=Can not poweron ${onu} values=False
67
68Power Off ONU
69 [Documentation] This keyword turns off the power for onu device.
70 [Arguments] ${namespace} ${bbsim_pod_name} ${onu}
71 ${result} ${rc}= Exec Pod And Return Output And RC ${namespace} ${bbsim_pod_name}
72 ... bbsimctl onu shutdown ${onu}
73 Should Contain ${result} successfully msg=Can not shutdown ${onu} values=False