reconcile tests tt workflow for all service types
This patch contains two suggestions to test open-onu-go-adapter reconcile handling with tt workflow.
Tests of Voltha_ONUReconcileTests.robot already run in pipeline with BBSim but without mcast service.
Now mcast service will be checked by sanity test too, but only in case of real HW.
Test of Voltha_TT_FailureScenarios.robot is similar to the DT test (see Voltha_DT_FailureScenarios.robot).
Both variants should work on real HW, which is not yet tested!!!
Maybe both variants find a way to corresponding pipelines and get alive:-)
Initiated by a request by Ozge last wednesday's meeting (2021/02/24).
Change-Id: I02400c3888483813f63826241034751cb6a46603
diff --git a/Makefile b/Makefile
index 988b88a..569f207 100755
--- a/Makefile
+++ b/Makefile
@@ -288,6 +288,11 @@
bbsim-failurescenarios-dt: ROBOT_CONFIG_FILE := $(ROBOT_SANITY_DT_SINGLE_PON_FILE)
bbsim-failurescenarios-dt: voltha-dt-test
+bbsim-failurescenarios-tt: ROBOT_MISC_ARGS += -X $(ROBOT_DEBUG_LOG_OPT)
+bbsim-failurescenarios-tt: ROBOT_FILE := Voltha_TT_FailureScenarios.robot
+bbsim-failurescenarios-tt: ROBOT_CONFIG_FILE := $(ROBOT_SANITY_TT_SINGLE_PON_FILE)
+bbsim-failurescenarios-tt: voltha-tt-test
+
voltha-test: ROBOT_MISC_ARGS += -e notready
voltha-test: vst_venv
diff --git a/libraries/utils.robot b/libraries/utils.robot
index f9f8df0..f19d035 100755
--- a/libraries/utils.robot
+++ b/libraries/utils.robot
@@ -384,7 +384,8 @@
... In all other (common) cases flag has to be set False (default).
[Arguments] ${supress_add_subscriber}=False
Perform Sanity Test TT ${supress_add_subscriber}
- Perform Sanity Test TT MCAST ${supress_add_subscriber}
+ # run of mcast sanity test is currently limited for real HW
+ Run Keyword If ${has_dataplane} Perform Sanity Test TT MCAST ${supress_add_subscriber}
Perform Sanity Test TT
[Documentation] This keyword performs Sanity Test Procedure for TT Workflow
diff --git a/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot b/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot
index 9b3c80a..441dc6b 100755
--- a/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot
+++ b/tests/openonu-go-adapter/Voltha_ONUReconcileTests.robot
@@ -265,7 +265,7 @@
Run Keyword If ${usekill2restart} Kill And Check Onu Adaptor ${namespace}
... ELSE Restart And Check Onu Adaptor ${namespace}
Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT
- ... ELSE IF "${workflow}"=="TT" Perform Sanity Test TT
+ ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT
... ELSE Perform Sanity Test
Do Reconcile For Disabled Onu Device
@@ -290,7 +290,7 @@
Enable Device ${olt_device_id}
END
Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT
- ... ELSE IF "${workflow}"=="TT" Perform Sanity Test TT
+ ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT
... ELSE Perform Sanity Test
Disable Onu Device
${alternativeonustates}= Create List omci-flows-deleted
@@ -305,7 +305,7 @@
Wait for all ONU Ports in ONOS Disabled ${onos_ssh_connection}
Enable Onu Device
Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT ${suppressaddsubscriber}
- ... ELSE IF "${workflow}"=="TT" Perform Sanity Test TT ${suppressaddsubscriber}
+ ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT ${suppressaddsubscriber}
... ELSE Perform Sanity Test ${suppressaddsubscriber}
Do Reconcile In Omci-Flows-Pushed
@@ -329,12 +329,12 @@
Enable Device ${olt_device_id}
END
Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT
- ... ELSE IF "${workflow}"=="TT" Perform Sanity Test TT
+ ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT
... ELSE Perform Sanity Test
Run Keyword If ${usekill2restart} Kill And Check Onu Adaptor ${namespace}
... ELSE Restart And Check Onu Adaptor ${namespace}
Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT ${suppressaddsubscriber}
- ... ELSE IF "${workflow}"=="TT" Perform Sanity Test TT ${suppressaddsubscriber}
+ ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT ${suppressaddsubscriber}
... ELSE Perform Sanity Test ${suppressaddsubscriber}
Disable Onu Device
${alternativeonustates}= Create List omci-flows-deleted
@@ -344,5 +344,5 @@
Wait for all ONU Ports in ONOS Disabled ${onos_ssh_connection}
Enable Onu Device
Run Keyword If "${workflow}"=="DT" Perform Sanity Test DT ${suppressaddsubscriber}
- ... ELSE IF "${workflow}"=="TT" Perform Sanity Test TT ${suppressaddsubscriber}
+ ... ELSE IF "${workflow}"=="TT" Perform Sanity Tests TT ${suppressaddsubscriber}
... ELSE Perform Sanity Test ${suppressaddsubscriber}
diff --git a/tests/tt-workflow/Voltha_TT_FailureScenarios.robot b/tests/tt-workflow/Voltha_TT_FailureScenarios.robot
new file mode 100755
index 0000000..88d80bd
--- /dev/null
+++ b/tests/tt-workflow/Voltha_TT_FailureScenarios.robot
@@ -0,0 +1,101 @@
+# Copyright 2021 - present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# FIXME Can we use the same test against BBSim and Hardware?
+
+*** Settings ***
+Documentation Test various functional end-to-end scenarios for TT workflow
+Suite Setup Setup Suite
+Test Setup Setup
+Test Teardown Teardown
+Suite Teardown Teardown Suite
+Library Collections
+Library String
+Library OperatingSystem
+Library XML
+Library RequestsLibrary
+Library ../../libraries/DependencyLibrary.py
+Resource ../../libraries/onos.robot
+Resource ../../libraries/voltctl.robot
+Resource ../../libraries/voltha.robot
+Resource ../../libraries/utils.robot
+Resource ../../libraries/k8s.robot
+Resource ../../variables/variables.robot
+Resource ../../libraries/power_switch.robot
+
+*** Variables ***
+${POD_NAME} flex-ocp-cord
+${KUBERNETES_CONF} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
+${KUBERNETES_CONFIGS_DIR} ~/pod-configs/kubernetes-configs
+#${KUBERNETES_CONFIGS_DIR} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.conf
+${KUBERNETES_YAML} ${KUBERNETES_CONFIGS_DIR}/${POD_NAME}.yml
+${HELM_CHARTS_DIR} ~/helm-charts
+${VOLTHA_POD_NUM} 8
+${NAMESPACE} voltha
+# For below variable value, using deployment name as using grep for
+# parsing radius pod name, we can also use full radius pod name
+${RESTART_POD_NAME} radius
+${timeout} 60s
+${of_id} 0
+${logical_id} 0
+${has_dataplane} True
+${teardown_device} False
+${scripts} ../../scripts
+
+# Per-test logging on failure is turned off by default; set this variable to enable
+${container_log_dir} ${None}
+
+${suppressaddsubscriber} True
+
+*** Test Cases ***
+Verify restart openonu-adapter container after subscriber provisioning for TT
+ [Documentation] Restart openonu-adapter container after VOLTHA is operational.
+ ... Prerequisite : ONUs are authenticated and pingable.
+ [Tags] functional Restart-OpenOnu-TT
+ [Setup] Start Logging Restart-OpenOnu-TT
+ [Teardown] Run Keywords Collect Logs
+ ... AND Stop Logging Restart-OpenOnu-TT
+ ... AND Delete All Devices and Verify
+ # Add OLT device
+ Setup
+ # Performing Sanity Test to make sure subscribers are all DHCP and pingable
+ Run Keyword If ${has_dataplane} Clean Up Linux
+ Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT
+ ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
+ Log ${podStatusOutput}
+ ${countBeforeRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
+ ${podName} Set Variable adapter-open-onu
+ Wait Until Keyword Succeeds ${timeout} 15s Delete K8s Pods By Label ${NAMESPACE} app ${podName}
+ Sleep 5s
+ Wait Until Keyword Succeeds ${timeout} 2s Validate Pods Status By Label ${NAMESPACE}
+ ... app ${podName} Running
+ Wait Until Keyword Succeeds ${timeout} 3s Pods Are Ready By Label ${NAMESPACE} app ${podName}
+ Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Tests TT ${suppressaddsubscriber}
+ ${podStatusOutput}= Run kubectl get pods -n ${NAMESPACE}
+ Log ${podStatusOutput}
+ ${countAfterRestart}= Run kubectl get pods -n ${NAMESPACE} | grep Running | wc -l
+ Should Be Equal As Strings ${countAfterRestart} ${countBeforeRestart}
+ Log to console Pod ${podName} restarted and sanity checks passed successfully
+
+
+*** Keywords ***
+Setup Suite
+ [Documentation] Set up the test suite
+ Common Test Suite Setup
+ ${switch_type}= Get Variable Value ${web_power_switch.type}
+ Run Keyword If "${switch_type}"!="" Set Global Variable ${powerswitch_type} ${switch_type}
+
+
+Teardown Suite
+ [Documentation] Tear down steps for the suite
+ Run Keyword If ${has_dataplane} Clean Up Linux