blob: 9210034995768bc442139230847b6094ca698805 [file] [log] [blame]
Hardik Windlassa3d04b92020-02-17 15:06:05 +00001# 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# FIXME Can we use the same test against BBSim and Hardware?
15
16*** Settings ***
17Documentation Test various end-to-end scenarios
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
34
35*** Variables ***
36${POD_NAME} flex-ocp-cord
37${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
38${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs
39#${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
40${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
41${HELM_CHARTS_DIR} ~/helm-charts
42${VOLTHA_POD_NUM} 8
43${NAMESPACE} voltha
44# For below variable value, using deployment name as using grep for
45# parsing radius pod name, we can also use full radius pod name
46${RESTART_POD_NAME} radius
47${timeout} 60s
48${of_id} 0
49${logical_id} 0
50${has_dataplane} True
51${external_libs} True
52${teardown_device} False
53${scripts} ../../scripts
54
55# Per-test logging on failure is turned off by default; set this variable to enable
56${container_log_dir} ${None}
57
58*** Test Cases ***
59Sanity E2E Test for OLT/ONU on POD for DT
60 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
61 ... Validate successful DHCP/E2E ping (no EAPOL and DHCP flows) for the tech profile that is used
62 ... Traffic sent with same vlan from different RGs,
63 ... should reach the NNI port on the OLT with the expected double tagged vlan ids
64 ... Inner vlans from the RG should not change
65 [Tags] sanityDt bbsim test1
66 [Setup] Run Keywords Announce Message START TEST SanityTestDt
67 ... AND Start Logging SanityTestDt
68 ... AND Setup
69 [Teardown] Run Keywords Collect Logs
70 ... AND Stop Logging SanityTestDt
71 ... AND Announce Message END TEST SanityTestDt
72 Run Keyword If ${has_dataplane} Clean Up Linux
73 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
74
Hardik Windlass35706ba2020-02-20 08:16:42 +000075Test Subscriber Delete and Add for DT
76 [Documentation] Validates E2E Ping Connectivity and object states for the given scenario:
77 ... Assuming that all the ONUs are DHCP/pingable (i.e. assuming test1 was executed)
78 ... Delete a subscriber and validate that the pings do not succeed and state is purged
79 ... Disable and Enable the ONU (This is to replicate the existing DT behaviour)
80 ... Re-add the subscriber, and validate that the flows are present and pings are successful
81 [Tags] functionalDt SubAddDeleteDt bbsim released
82 [Setup] Run Keywords Announce Message START TEST SubAddDeleteDt
83 ... AND Start Logging SubAddDeleteDt
84 [Teardown] Run Keywords Collect Logs
85 ... AND Stop Logging SubAddDeleteDt
86 ... AND Announce Message END TEST SubAddDeleteDt
87 FOR ${I} IN RANGE 0 ${num_onus}
88 ${src}= Set Variable ${hosts.src[${I}]}
89 ${dst}= Set Variable ${hosts.dst[${I}]}
90 ${onu_device_id}= Get Device ID From SN ${src['onu']}
91 ${onu_port}= Wait Until Keyword Succeeds ${timeout} 2s Get ONU Port in ONOS ${src['onu']}
92 ... ${of_id}
93 # Remove Subscriber Access
94 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
95 ... ${ONOS_SSH_PORT} volt-remove-subscriber-access ${of_id} ${onu_port}
96 Sleep 10s
97 # TODO: Yet to Verify on the Physical POD
98 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
99 ... Wait Until Keyword Succeeds 60s 2s
100 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
101 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
102 # Verify VOLTHA flows for OLT equals twice the number of ONUS (minus ONU under test) + 1 for LLDP
103 ${olt_flows}= Evaluate 2 * ( ${num_onus} - 1 ) + 1
104 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
105 # Verify VOLTHA flows for ONU under test is Zero
106 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate Device Flows
107 ... ${onu_device_id} 0
108 # Disable and Re-Enable the ONU (To replicate DT current workflow)
109 # TODO: Delete and Auto-Discovery Add of ONU (not yet supported)
110 Disable Device ${onu_device_id}
111 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
112 ... Validate Device DISABLED UNKNOWN
113 ... REACHABLE ${src['onu']}
114 Enable Device ${onu_device_id}
115 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
116 ... Validate Device ENABLED ACTIVE
117 ... REACHABLE ${src['onu']}
118 # Add Subscriber Access
119 Wait Until Keyword Succeeds ${timeout} 2s Execute ONOS CLI Command ${k8s_node_ip}
120 ... ${ONOS_SSH_PORT} volt-add-subscriber-access ${of_id} ${onu_port}
121 Sleep 10s
122 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s
123 ... Validate Device ENABLED ACTIVE
124 ... REACHABLE ${src['onu']} onu=True onu_reason=omci-flows-pushed
125 # TODO: Yet to Verify on the Physical POD
126 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
127 ... Wait Until Keyword Succeeds 60s 2s
128 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
129 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
130 Run Keyword and Ignore Error Get Device Output from Voltha ${onu_device_id}
131 Run Keyword and Ignore Error Collect Logs
132 END
133 # Verify VOLTHA Flows (TODO: Add verification for ONOS Flows)
134 # Number of per OLT Flows equals Twice the Number of Active ONUs (each for downstream and upstream) + 1 for LLDP
135 ${olt_flows}= Evaluate 2 * ${num_onus} + 1
136 # Number of per ONU Flows equals 2 (one each for downstream and upstream)
137 ${onu_flows}= Set Variable 2
138 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate OLT Flows ${olt_flows}
139 ${List_ONU_Serial} Create List
140 Set Suite Variable ${List_ONU_Serial}
141 Build ONU SN List ${List_ONU_Serial}
142 Log ${List_ONU_Serial}
143 Run Keyword Wait Until Keyword Succeeds ${timeout} 5s Validate ONU Flows
144 ... ${List_ONU_Serial} ${onu_flows}
145
Hardik Windlassa3d04b92020-02-17 15:06:05 +0000146*** Keywords ***
147Setup Suite
148 [Documentation] Set up the test suite
149 Common Test Suite Setup
150
151Clear All Devices Then Create New Device
152 [Documentation] Remove any devices from VOLTHA and ONOS
153 # Remove all devices from voltha and nos
154 Delete All Devices and Verify
155 # Execute normal test Setup Keyword
156 Setup
157