Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 1 | # 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 Chiu | 87edb1f | 2020-01-28 00:10:58 +0000 | [diff] [blame] | 17 | Documentation Test various failure scenarios |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 18 | Suite Setup Common Test Suite Setup |
| 19 | Test Setup Setup |
| 20 | Test Teardown Teardown |
| 21 | #Suite Teardown Teardown Suite |
| 22 | Library Collections |
| 23 | Library String |
| 24 | Library OperatingSystem |
| 25 | Library XML |
| 26 | Library RequestsLibrary |
| 27 | Library ../../libraries/DependencyLibrary.py |
| 28 | Resource ../../libraries/onos.robot |
| 29 | Resource ../../libraries/voltctl.robot |
| 30 | Resource ../../libraries/voltha.robot |
| 31 | Resource ../../libraries/utils.robot |
| 32 | Resource ../../libraries/k8s.robot |
| 33 | Resource ../../variables/variables.robot |
HungWei Chiu | 87edb1f | 2020-01-28 00:10:58 +0000 | [diff] [blame] | 34 | Resource ../../libraries/power_switch.robot |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 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 |
Suchitra Vemuri | 109feb1 | 2020-01-23 16:25:02 -0800 | [diff] [blame] | 51 | ${has_dataplane} True |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 52 | ${external_libs} True |
| 53 | ${teardown_device} False |
| 54 | ${scripts} ../../scripts |
| 55 | |
| 56 | *** Test Cases *** |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 57 | Verify 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 Vemuri | d151c33 | 2020-01-28 17:48:45 -0800 | [diff] [blame] | 61 | [Tags] functional VOL-2409 ofagentRestart notready |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 62 | [Setup] NONE |
| 63 | [Teardown] NONE |
| 64 | ${waitforRestart} Set Variable 120s |
| 65 | ${podStatusOutput}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE} |
| 66 | Log ${podStatusOutput} |
| 67 | ${countBforRestart}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 68 | Restart Pod ${NAMESPACE} ofagent |
| 69 | Sleep 60s |
| 70 | Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ofagent ${NAMESPACE} |
| 71 | ... Running |
| 72 | Repeat Sanity Test |
| 73 | ${podStatusOutput}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE} |
| 74 | Log ${podStatusOutput} |
| 75 | ${countAfterRestart}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 76 | Should Be Equal As Strings ${countAfterRestart} ${countBforRestart} |
| 77 | Run Keyword and Ignore Error Collect Logs |
| 78 | |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 79 | Verify restart any container after VOLTHA is operational |
| 80 | [Documentation] Restart any container after VOLTHA is operational. |
| 81 | ... Prerequisite : ONUs are authenticated and pingable. |
Suchitra Vemuri | 109feb1 | 2020-01-23 16:25:02 -0800 | [diff] [blame] | 82 | [Tags] functional VOL-1958 RestartPods |
Gayathri.Selvan | 283a63c | 2020-01-23 04:09:18 +0000 | [diff] [blame] | 83 | [Setup] NONE |
| 84 | [Teardown] NONE |
| 85 | ${waitforRestart} Set Variable 120s |
| 86 | ${podStatusOutput}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE} |
| 87 | Log ${podStatusOutput} |
| 88 | ${countBforRestart}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 89 | ${podName} Set Variable adapter-open-olt |
| 90 | Restart Pod ${NAMESPACE} ${podName} |
| 91 | Wait Until Keyword Succeeds ${waitforRestart} 2s Validate Pod Status ${podName} ${NAMESPACE} |
| 92 | ... Running |
| 93 | Repeat Sanity Test |
| 94 | ${podStatusOutput}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE} |
| 95 | Log ${podStatusOutput} |
| 96 | ${countAfterRestart}= Run ${KUBECTL_CONFIG};kubectl get pods -n ${NAMESPACE} | grep Running | wc -l |
| 97 | Should Be Equal As Strings ${countAfterRestart} ${countBforRestart} |
| 98 | Log to console Pod ${podName} restarted and sanity checks passed successfully |
Gayathri.Selvan | b6a2b54 | 2020-01-24 07:24:23 +0000 | [diff] [blame] | 99 | |
HungWei Chiu | 87edb1f | 2020-01-28 00:10:58 +0000 | [diff] [blame] | 100 | Verify ONU after rebooting physically |
| 101 | [Documentation] Test the ONU funcaionality by physically turning on/off ONU. |
| 102 | ... Prerequisite : Subscriber are authenticated/DHCP/pingable state |
| 103 | [Tags] functional VOL-2488 PowerSwitch notready |
| 104 | [Setup] NONE |
| 105 | [Teardown] NONE |
| 106 | Power Switch Connection Suite ${web_power_switch.ip} ${web_power_switch.user} ${web_power_switch.password} |
| 107 | FOR ${I} IN RANGE 0 ${num_onus} |
| 108 | ${src}= Set Variable ${hosts.src[${I}]} |
| 109 | ${dst}= Set Variable ${hosts.dst[${I}]} |
| 110 | Disable Switch Outlet ${src['power_switch_port']} |
| 111 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 112 | ... Wait Until Keyword Succeeds 60s 2s |
| 113 | ... Check Ping False ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 114 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 115 | |
hwchiu | b7139c1 | 2020-01-28 21:51:28 +0000 | [diff] [blame] | 116 | Enable Switch Outlet ${src['power_switch_port']} |
HungWei Chiu | 87edb1f | 2020-01-28 00:10:58 +0000 | [diff] [blame] | 117 | Run Keyword And Continue On Failure Wait Until Keyword Succeeds ${timeout} 5s Validate Device |
| 118 | ... ENABLED ACTIVE REACHABLE ${src['onu']} |
HungWei Chiu | 87edb1f | 2020-01-28 00:10:58 +0000 | [diff] [blame] | 119 | Run Keyword If ${has_dataplane} Run Keyword And Continue On Failure |
| 120 | ... Wait Until Keyword Succeeds 60s 2s |
| 121 | ... Check Ping True ${dst['dp_iface_ip_qinq']} ${src['dp_iface_name']} |
| 122 | ... ${src['ip']} ${src['user']} ${src['pass']} ${src['container_type']} ${src['container_name']} |
| 123 | END |