blob: db827fb6ac0e2f61d7b45750b31a4f3513ebb169 [file] [log] [blame]
Kailash4200e572018-12-11 14:50:46 -08001# 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 ***
16Documentation Test various E2E conditions for seba-in-a-box
17Suite Setup Setup
18Suite Teardown Teardown
19Library Collections
20Library String
21Library OperatingSystem
22Library XML
23Library RequestsLibrary
24Library ../../Framework/utils/utils.py
25Resource ../../Framework/utils/utils.robot
26Library ../../Framework/restApi.py
27Resource ../../Framework/Subscriber.robot
28Resource ../../Framework/ATTWorkFlowDriver.robot
29Resource ../../Framework/Kubernetes.robot
30Resource ../../Framework/ONU.robot
31Resource ../../Framework/DHCP.robot
32Variables ../../Properties/RestApiProperties.py
33
34*** Variables ***
Kailashe81e4722019-01-22 13:00:31 -080035${number_of_onus} 16
Kailash4200e572018-12-11 14:50:46 -080036
37*** Test Cases ***
38ONUs Discovered
39 [Documentation] Validates All ONU Devices are discovered and retrieve SNs
40 [Tags] onudiscovery
Kailashe81e4722019-01-22 13:00:31 -080041 Wait Until Keyword Succeeds 120s 5s Validate Number of ONU Devices ${number_of_onus}
Kailash4200e572018-12-11 14:50:46 -080042
43Validate ONU States
44 [Documentation] Validates All ONU Device states are "enabled" and "active"
45 [Tags] onustates
46 : FOR ${onu} IN @{serial_numbers}
Kailash02acdf62019-01-22 14:17:27 -080047 \ Wait Until Keyword Succeeds 120s 5s Validate ONU States ACTIVE ENABLED ${onu}
Kailash4200e572018-12-11 14:50:46 -080048
49Validate ATT WF Driver SIs
50 [Documentation] Validates all service instances per onu devices become "approved" and "dhcpdiscovered"
51 [Tags] serviceinstances
52 : FOR ${onu} IN @{serial_numbers}
53 \ Wait Until Keyword Succeeds 120s 2s Validate ATT Workflow Driver SI ENABLED APPROVED ${onu}
Kailash02acdf62019-01-22 14:17:27 -080054 \ Wait Until Keyword Succeeds 120s 2s Validate ATT Workflow Driver SI DHCP State DHCPACK ${onu}
Kailash4200e572018-12-11 14:50:46 -080055
56*** Keywords ***
57Setup
58 ${auth} = Create List ${XOS_USER} ${XOS_PASSWD}
59 ${HEADERS} Create Dictionary Content-Type=application/json
Kailash379630d2019-01-23 10:38:53 -080060 Create Session ${server_ip} http://%{SERVER_IP}:%{SERVER_PORT} auth=${AUTH} headers=${HEADERS}
Kailash4200e572018-12-11 14:50:46 -080061
62Teardown
63 Delete All Sessions
64
65Validate Number of ONU Devices
66 [Arguments] ${expected_onus}
67 ${resp}= CORD Get ${ONU_DEVICE}
68 ${jsondata}= To Json ${resp.content}
69 Log ${jsondata}
70 ${length}= Get Length ${jsondata['items']}
71 @{serial_numbers}= Create List
72 : FOR ${INDEX} IN RANGE 0 ${length}
73 \ ${value}= Get From List ${jsondata['items']} ${INDEX}
74 \ ${sn}= Get From Dictionary ${value} serial_number
75 \ ${contains}= Evaluate "BBSM" in """${sn}"""
76 \ Run Keyword if '${contains}' == 'True' Append To List ${serial_numbers} ${sn}
77 Set Suite Variable ${serial_numbers}
78 ${length_of_bbsim_onus}= Get Length ${serial_numbers}
Kailash02acdf62019-01-22 14:17:27 -080079 Should Be Equal as Integers ${length_of_bbsim_onus} ${expected_onus}