blob: 88d80bda2afadafc5b57ab5104ffb91c9ccd7efc [file] [log] [blame]
TorstenThieme136ebf72021-02-26 14:27:07 +00001# Copyright 2021 - 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 functional end-to-end scenarios for TT workflow
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
34Resource ../../libraries/power_switch.robot
35
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
51${has_dataplane} 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${suppressaddsubscriber} True
59
60*** Test Cases ***
61Verify restart openonu-adapter container after subscriber provisioning for TT
62 [Documentation] Restart openonu-adapter container after VOLTHA is operational.
63 ... Prerequisite : ONUs are authenticated and pingable.
64 [Tags] functional Restart-OpenOnu-TT
65 [Setup] Start Logging Restart-OpenOnu-TT
66 [Teardown] Run Keywords Collect Logs
67 ... AND Stop Logging Restart-OpenOnu-TT
68 ... AND Delete All Devices and Verify
69 # Add OLT device
70 Setup
71 # Performing Sanity Test to make sure subscribers are all DHCP and pingable
72 Run Keyword If ${has_dataplane} Clean Up Linux
73 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
74 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
75 Log ${podStatusOutput}
76 ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
77 ${podName} Set Variable adapter-open-onu
78 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
79 Sleep 5s
80 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
81 ... app ${podName} Running
82 Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
83 Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT ${suppressaddsubscriber}
84 ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
85 Log ${podStatusOutput}
86 ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
87 Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart}
88 Log to console Pod ${podName} restarted and sanity checks passed successfully
89
90
91*** Keywords ***
92Setup Suite
93 [Documentation] Set up the test suite
94 Common Test Suite Setup
95 ${switch_type}= Get Variable Value ${web_power_switch.type}
96 Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
97
98
99Teardown Suite
100 [Documentation] Tear down steps for the suite
101 Run Keyword If ${has_dataplane} Clean Up Linux