blob: c77ba4b342a90b57f22c00f13995ee1aef2513f5 [file] [log] [blame]
Andrea Campanella4c404632020-08-26 14:41:36 +02001# Copyright 2020 - 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 ONOS high avaliablity tests
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_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
41${HELM_CHARTS_DIR} ~/helm-charts
42${VOLTHA_POD_NUM} 8
43${NAMESPACE} default
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${teardown_device} True
Andrea Campanella962fe832020-09-21 10:41:47 +020052${numOfOnos} 1
Andrea Campanella4c404632020-08-26 14:41:36 +020053${scripts} ../../scripts
54${workflow} ATT
55
56# Per-test logging on failure is turned off by default; set this variable to enable
57${container_log_dir} ${None}
58
59*** Test Cases ***
60Verify restart ONOS instace master of device after subscriber is provisioned
61 [Documentation] Restat ONOS instance master of a given device and check that during restart and after the
62 ... subscriuber still has dataplane traffic.
63 ... Prerequisite : ONUs are authenticated and pingable, thus setup and sanity is performed.
64 [Tags] onosHa VOL-3436 onosMasterRestart
Suchitra Vemuri8130be82020-09-15 16:47:58 -070065 [Setup] Start Logging onosMasterRestart
Andrea Campanella4c404632020-08-26 14:41:36 +020066 [Teardown] Run Keywords Collect Logs
67 ... AND Stop Logging onosMasterRestart
Andrea Campanella962fe832020-09-21 10:41:47 +020068 ${numOfOnos}= Wait Until Keyword Succeeds 20s 5s Get Number of Running Pods Number By Label default
69 ... app onos-onos-classic
70 Pass Execution If ${numOfOnos} == 1 Skipping test: just one instance of ONOS
Suchitra Vemuri94f045c2020-09-14 15:56:25 -070071 Delete All Devices and Verify
72 Setup
Andrea Campanella4c404632020-08-26 14:41:36 +020073 Run Keyword If ${has_dataplane} Clean Up Linux
74 Run Keyword If '${workflow}' == 'ATT' Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
75 Run Keyword If '${workflow}' == 'DT' Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test DT
Suchitra Vemurif8462be2020-11-05 13:38:42 -080076 FOR ${I} IN RANGE 0 ${olt_count}
77 ${olt_user}= Get From Dictionary ${list_olts}[${I}] user
78 ${olt_pass}= Get From Dictionary ${list_olts}[${I}] pass
79 ${olt_ssh_ip}= Get From Dictionary ${list_olts}[${I}] sship
80 ${olt_serial_number}= Get From Dictionary ${list_olts}[${I}] sn
81 ${olt_device_id}= Get OLTDeviceID From OLT List ${olt_serial_number}
82 ${of_id}= Wait Until Keyword Succeeds 360s 15s Validate OLT Device in ONOS ${olt_serial_number}
83 ${node_id}= Wait Until Keyword Succeeds 20s 5s Get Master Instace in ONOS ${of_id}
84 ${podName} Set Variable ${node_id}
85 Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Name ${NAMESPACE} ${podName}
86 Sleep 60s
87 Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Name ${NAMESPACE}
88 ... ${podName} Running
Andrea Campanellad6226c62020-11-27 11:44:33 +010089 # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
90 Run Keyword If ${has_dataplane} Clean Up Linux
91 ${of_id}= Wait Until Keyword Succeeds ${timeout} 15s Validate OLT Device in ONOS
92 ... ${olt_serial_number}
93 Set Global Variable ${of_id}
94 ${nni_port}= Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 2s
95 ... Get NNI Port in ONOS ${of_id}
96 Set Global Variable ${nni_port}
97 ${num_onus}= Set Variable ${list_olts}[${I}][onucount]
98 Run Keyword If '${workflow}' == 'ATT' Wait Until Keyword Succeeds ${timeout} 2s
99 ... Perform Sanity Test Per OLT ${of_id} ${nni_port} ${olt_serial_number} ${num_onus}
100 Run Keyword If '${workflow}' == 'DT' Wait Until Keyword Succeeds ${timeout} 2s
101 ... Perform Sanity Test DT Per OLT ${of_id} ${nni_port} ${olt_serial_number} ${num_onus}
Suchitra Vemurif8462be2020-11-05 13:38:42 -0800102 END
Andrea Campanella4c404632020-08-26 14:41:36 +0200103 Log to console Pod ${podName} deleted and sanity checks passed successfully
104
105*** Keywords ***
106Setup Suite
107 [Documentation] Set up the test suite
Suchitra Vemuri94f045c2020-09-14 15:56:25 -0700108 Common Test Suite Setup