blob: 5b1bb1819972485b37d83a37f6175cc5cad84a63 [file] [log] [blame]
Gilles Depatieb5682f82019-10-31 10:39:45 -04001#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
15*** Settings ***
Zack Williamsa8fe75a2020-01-10 14:25:27 -070016Documentation Test suite that engages a larger number of ONU at the same time to test scale
17... It is compatible with either BBSim or real H/W using a configuration file
Gilles Depatieb5682f82019-10-31 10:39:45 -040018Suite Setup Setup Suite
19Suite Teardown Teardown Suite
20Library Collections
21Library String
22Library OperatingSystem
23Library XML
24Library RequestsLibrary
25Library ../../libraries/DependencyLibrary.py
26Resource ../../libraries/onos.robot
27Resource ../../libraries/voltctl.robot
28Resource ../../libraries/utils.robot
29Resource ../../libraries/k8s.robot
30Resource ../../variables/variables.robot
31
32*** Variables ***
Zack Williamsa8fe75a2020-01-10 14:25:27 -070033${timeout} 60s
Gilles Depatieb5682f82019-10-31 10:39:45 -040034${long_timeout} 420
Zack Williamsa8fe75a2020-01-10 14:25:27 -070035${of_id} 0
36${logical_id} 0
Gilles Depatieb5682f82019-10-31 10:39:45 -040037${has_dataplane} True
38${external_libs} True
39${teardown_device} False
40
41*** Test Cases ***
42Activate Devices OLT/ONU
43 [Documentation] Validate deployment -> Empty Device List
44 ... create and enable device -> Preprovision and Enable
45 ... re-validate deployment -> Active OLT
46 [Tags] active
47 #test for empty device list
David Bainbridgef81cd642019-11-20 00:14:47 +000048 Test Empty Device List
Gilles Depatieb5682f82019-10-31 10:39:45 -040049 #create/preprovision device
50 ${olt_device_id}= Create Device ${olt_ip} ${OLT_PORT}
51 Set Global Variable ${olt_device_id}
52 #validate olt states
Zack Williamsa8fe75a2020-01-10 14:25:27 -070053 Wait Until Keyword Succeeds ${timeout} 5s
Andy Bavier859e03b2020-01-15 10:59:51 -070054 ... Validate OLT Device PREPROVISIONED UNKNOWN UNKNOWN ${EMPTY} ${olt_device_id}
Gilles Depatieb5682f82019-10-31 10:39:45 -040055 #enable device
56 Enable Device ${olt_device_id}
57 #validate olt states
Zack Williamsa8fe75a2020-01-10 14:25:27 -070058 Wait Until Keyword Succeeds ${timeout} 5s
Andy Bavier859e03b2020-01-15 10:59:51 -070059 ... Validate OLT Device ENABLED ACTIVE REACHABLE ${EMPTY} ${olt_device_id}
Gilles Depatieb5682f82019-10-31 10:39:45 -040060
61ONU Discovery
62 [Documentation] Discover lists of ONUS, their Serial Numbers and device id
63 [Tags] active
64 #build onu sn list
65 ${List_ONU_Serial} Create List
66 Set Suite Variable ${List_ONU_Serial}
67 Build ONU SN List ${List_ONU_Serial}
68 Log ${List_ONU_Serial}
69 #validate onu states
Zack Williamsa8fe75a2020-01-10 14:25:27 -070070 Wait Until Keyword Succeeds ${long_timeout} 20s
71 ... Validate ONU Devices ENABLED ACTIVE REACHABLE ${List_ONU_Serial}
Gilles Depatieb5682f82019-10-31 10:39:45 -040072
73Validate Device's Ports and Flows
74 [Documentation] Verify Ports and Flows listed for OLT and ONUs
Zack Williamsa8fe75a2020-01-10 14:25:27 -070075 ... For OLT we validate the port types and numbers and for flows we simply
76 ... verify that their numbers > 0
Gilles Depatieb5682f82019-10-31 10:39:45 -040077 ... For each ONU, we validate the port types and numbers for each and for flows.
78 ... For flows they should be == 0 at this stage
79 [Tags] active
80 #validate olt port types
81 Validate OLT Port Types PON_OLT ETHERNET_NNI
82 #validate olt flows
Andy Bavierac7e5972019-11-14 15:35:48 -070083 Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows
Gilles Depatieb5682f82019-10-31 10:39:45 -040084 #validate onu port types
85 Validate ONU Port Types ${List_ONU_Serial} PON_ONU ETHERNET_UNI
86 #validate onu flows
Zack Williamsa8fe75a2020-01-10 14:25:27 -070087 Wait Until Keyword Succeeds ${timeout} 5s
88 ... Validate ONU Flows ${List_ONU_Serial} ${num_onu_flows}
Gilles Depatieb5682f82019-10-31 10:39:45 -040089
90Validate Logical Device
91 [Documentation] Verify that logical device exists and then verify its ports and flows
92 [Tags] active
93 #Verify logical device exists
94 ${logical_device_id}= Validate Logical Device
95 #Verify logical device ports
96 Validate Logical Device Ports ${logical_device_id}
97 #Verify logical device flows
98 Validate Logical Device Flows ${logical_device_id}
99
100Validate Peer Devices
101 [Documentation] Verify that peer lists matches up between that of ${olt_device_id}
102 ... and individual ONU device ids
103 [Tags] active
104 #Retrieve peer list from OLT
105 ${olt_peer_list}= Create List
106 Retrieve Peer List From OLT ${olt_peer_list}
107 Log ${olt_peer_list}
108 #Validate OLT peer id list
109 Validate OLT Peer Id List ${olt_peer_list}
110 #Validate ONU peer ids
111 Validate ONU Peer Id ${olt_device_id} ${List_ONU_Serial}
112
113*** Keywords ***
114Setup Suite
Andy Bavier88cd9f62019-11-26 16:22:33 -0700115 [Documentation] Set up the test suite
116 Common Test Suite Setup
Gilles Depatieb5682f82019-10-31 10:39:45 -0400117
118Teardown Suite
119 [Documentation] Clean up devices if desired
120 ... kills processes and cleans up interfaces on src+dst servers
121 Run Keyword If ${external_libs} Get ONOS Status ${k8s_node_ip}
122 Run Keyword If ${has_dataplane} Clean Up Linux
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700123 Run Keyword If ${external_libs}
124 ... Log Kubernetes Containers Logs Since Time ${datetime} ${container_list}
Gilles Depatieb5682f82019-10-31 10:39:45 -0400125 Run Keyword If ${teardown_device} Delete Device and Verify
David Bainbridgef81cd642019-11-20 00:14:47 +0000126 Run Keyword If ${teardown_device} Test Empty Device List
Gilles Depatieb5682f82019-10-31 10:39:45 -0400127 Run Keyword If ${teardown_device} Execute ONOS CLI Command ${k8s_node_ip} ${ONOS_SSH_PORT}
128 ... device-remove ${of_id}
129
130Clean Up Linux
131 [Documentation] Kill processes and clean up interfaces on src+dst servers
132 FOR ${I} IN RANGE 0 ${num_onus}
133 ${src}= Set Variable ${hosts.src[${I}]}
134 ${dst}= Set Variable ${hosts.dst[${I}]}
135 Run Keyword And Ignore Error Kill Linux Process [w]pa_supplicant ${src['ip']}
136 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
137 Run Keyword And Ignore Error Kill Linux Process [d]hclient ${src['ip']}
138 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
139 Run Keyword If '${dst['ip']}' != '${None}' Run Keyword And Ignore Error
140 ... Kill Linux Process [d]hcpd ${dst['ip']} ${dst['user']}
141 ... ${dst['pass']} ${dst['container_type']} ${dst['container_name']}
142 Delete IP Addresses from Interface on Remote Host ${src['dp_iface_name']} ${src['ip']}
143 ... ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
144 Run Keyword If '${dst['ip']}' != '${None}' Delete Interface on Remote Host
145 ... ${dst['dp_iface_name']}.${src['s_tag']} ${dst['ip']} ${dst['user']} ${dst['pass']}
146 ... ${dst['container_type']} ${dst['container_name']}
147 END
148
149Delete Device and Verify
150 [Documentation] Disable -> Delete devices via voltctl and verify its removed
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700151 ${rc} ${output}= Run and Return Rc and Output
152 ... ${VOLTCTL_CONFIG}; voltctl device disable ${olt_device_id}
Gilles Depatieb5682f82019-10-31 10:39:45 -0400153 Should Be Equal As Integers ${rc} 0
Zack Williamsa8fe75a2020-01-10 14:25:27 -0700154 Wait Until Keyword Succeeds ${timeout} 5s
155 ... Validate OLT Device DISABLED UNKNOWN REACHABLE ${olt_serial_number}
156 ${rc} ${output}= Run and Return Rc and Output
157 ... ${VOLTCTL_CONFIG}; voltctl device delete ${olt_device_id}
Gilles Depatieb5682f82019-10-31 10:39:45 -0400158 Should Be Equal As Integers ${rc} 0
David Bainbridgef81cd642019-11-20 00:14:47 +0000159 Wait Until Keyword Succeeds ${timeout} 5s Validate Device Removed ${olt_device_id}