blob: 0a3e3051bb7f9c30928c20164d5f6e7fc5701fdf [file] [log] [blame]
Gayathri.Selvan283a63c2020-01-23 04:09:18 +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 ***
HungWei Chiu87edb1f2020-01-28 00:10:58 +000017Documentation Test various failure scenarios
Gayathri.Selvan283a63c2020-01-23 04:09:18 +000018Suite Setup Common Test Suite Setup
19Test Setup Setup
20Test Teardown Teardown
21#Suite 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
HungWei Chiu87edb1f2020-01-28 00:10:58 +000034Resource ../../libraries/power_switch.robot
Gayathri.Selvan283a63c2020-01-23 04:09:18 +000035
36*** Variables ***
37${POD_NAME} flex-ocp-cord
38${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
39${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs
40#${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
41${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
42${HELM_CHARTS_DIR} ~/helm-charts
43${VOLTHA_POD_NUM} 8
44${NAMESPACE} voltha
45# For below variable value, using deployment name as using grep for
46# parsing radius pod name, we can also use full radius pod name
47${RESTART_POD_NAME} radius
48${timeout} 60s
49${of_id} 0
50${logical_id} 0
Suchitra Vemuri109feb12020-01-23 16:25:02 -080051${has_dataplane} True
Gayathri.Selvan283a63c2020-01-23 04:09:18 +000052${external_libs} True
53${teardown_device} False
54${scripts} ../../scripts
55
56*** Test Cases ***
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +000057Verify restart ofagent container after VOLTHA is operational
58 [Documentation] Restart ofagent container after VOLTHA is operational.
59 ... Please note this test case should be run before the restart of other containers.
60 ... Prerequisite : ONUs are authenticated and pingable.
Suchitra Vemurid151c332020-01-28 17:48:45 -080061 [Tags] functional VOL-2409 ofagentRestart notready
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +000062 [Setup] NONE
63 [Teardown] NONE
Suchitra Vemurib661bf32020-01-30 22:46:14 -080064 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
65 Run Keyword If ${has_dataplane} Clean Up Linux
66 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +000067 ${waitforRestart} Set Variable 120s
68 ${podStatusOutput}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE}
69 Log ${podStatusOutput}
70 ${countBforRestart}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
71 Restart Pod ${NAMESPACE} ofagent
72 Sleep 60s
73 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE}
74 ... Running
75 Repeat Sanity Test
76 ${podStatusOutput}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE}
77 Log ${podStatusOutput}
78 ${countAfterRestart}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
79 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
80 Run Keyword and Ignore Error Collect Logs
81
Suchitra Vemuric4203692020-01-30 20:29:46 -080082Verify restart openolt-adapter container after VOLTHA is operational
83 [Documentation] Restart openolt-adapter container after VOLTHA is operational.
Gayathri.Selvan283a63c2020-01-23 04:09:18 +000084 ... Prerequisite : ONUs are authenticated and pingable.
Suchitra Vemuri109feb12020-01-23 16:25:02 -080085 [Tags] functional VOL-1958 RestartPods
Gayathri.Selvan283a63c2020-01-23 04:09:18 +000086 [Setup] NONE
87 [Teardown] NONE
88 ${waitforRestart} Set Variable 120s
89 ${podStatusOutput}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE}
90 Log ${podStatusOutput}
91 ${countBforRestart}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
92 ${podName} Set Variable adapter-open-olt
93 Restart Pod ${NAMESPACE} ${podName}
94 Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ${podName} ${NAMESPACE}
95 ... Running
96 Repeat Sanity Test
97 ${podStatusOutput}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE}
98 Log ${podStatusOutput}
99 ${countAfterRestart}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
100 Should Be Equal As Strings ${countAfterRestart} ${countBforRestart}
101 Log to console Pod ${podName} restarted and sanity checks passed successfully
Gayathri.Selvanb6a2b542020-01-24 07:24:23 +0000102
HungWei Chiu87edb1f2020-01-28 00:10:58 +0000103Verify ONU after rebooting physically
104 [Documentation] Test the ONU funcaionality by physically turning on/off ONU.
105 ... Prerequisite : Subscriber are authenticated/DHCP/pingable state
106 [Tags] functional VOL-2488 PowerSwitch notready
107 [Setup] NONE
108 [Teardown] NONE
109 Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password}
110 FOR ${I} IN RANGE 0 ${num_onus}
111 ${src}= Set Variable ${hosts.src[${I}]}
112 ${dst}= Set Variable ${hosts.dst[${I}]}
113 Disable Switch Outlet ${src['power_switch_port']}
114 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
115 ... Wait Until Keyword Succeeds 60s 2s
116 ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
117 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
118
hwchiub7139c12020-01-28 21:51:28 +0000119 Enable Switch Outlet ${src['power_switch_port']}
HungWei Chiu87edb1f2020-01-28 00:10:58 +0000120 Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device
121 ... ENABLED ACTIVE REACHABLE ${src['onu']}
HungWei Chiu87edb1f2020-01-28 00:10:58 +0000122 Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure
123 ... Wait Until Keyword Succeeds 60s 2s
124 ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']}
125 ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']}
126 END
Gayathri.Selvanf68ea4b2020-02-03 07:36:39 +0000127
128ONU Reboot
129 [Documentation] Reboot ONU and verify that ONU comes up properly
130 [Tags] VOL-1957 RebootONU notready
131 [Setup] NONE
132 FOR ${I} IN RANGE 0 ${num_onus}
133 ${src}= Set Variable ${hosts.src[${I}]}
134 ${dst}= Set Variable ${hosts.dst[${I}]}
135 ${onu_device_id}= Get Device ID From SN ${src['onu']}
136 Reboot ONU ${onu_device_id} ${src} ${dst}
137 Verify ping is succesful except for given device ${num_onus} ${onu_device_id}
138 Run Keyword If ${has_dataplane} Clean Up Linux
139 #Check after reboot that ONUs are active, authenticated/DHCP/pingable
140 Perform Sanity Test
141 END
142