[VOL-3904] Added TC for OLT Grpc Channel Disconnection
Change-Id: I146c161b18cb92a4ea9759053a679511390b15cb
diff --git a/libraries/bbsim.robot b/libraries/bbsim.robot
index 3ba7bd1..ffcad0d 100755
--- a/libraries/bbsim.robot
+++ b/libraries/bbsim.robot
@@ -90,3 +90,11 @@
@{onuList}= Split To Lines ${onus}
Should Be Equal as Integers ${rc} 0
[Return] ${onuList}
+
+Restart Grpc Server
+ [Documentation] Restart Grpc Server on a BBSim OLT
+ [Arguments] ${namespace} ${bbsim_pod_name} ${delay}
+ ${res} ${rc}= Exec Pod And Return Output And RC ${namespace} ${bbsim_pod_name}
+ ... bbsimctl olt restartServer ${delay}
+ Log ${res}
+ Should Be Equal as Integers ${rc} 0
diff --git a/tests/functional/Voltha_FailureScenarios.robot b/tests/functional/Voltha_FailureScenarios.robot
index 4ca307e..4325076 100644
--- a/tests/functional/Voltha_FailureScenarios.robot
+++ b/tests/functional/Voltha_FailureScenarios.robot
@@ -31,6 +31,7 @@
Resource ../../libraries/k8s.robot
Resource ../../variables/variables.robot
Resource ../../libraries/power_switch.robot
+Resource ../../libraries/bbsim.robot
*** Variables ***
${POD_NAME} flex-ocp-cord
@@ -690,6 +691,29 @@
... Validate Subscriber DHCP Allocation ${ONOS_SSH_IP} ${ONOS_SSH_PORT} ${onu_port}
END
+Verify OLT Grpc Disconnection
+ [Documentation] Restarts OLT Grpc Server and verifies everything works as before without any system disruption.
+ [Tags] functional VOL-3904 restartGrpcServer bbsim
+ [Setup] Start Logging restartGrpcServer
+ [Teardown] Run Keywords Collect Logs
+ ... AND Stop Logging restartGrpcServer
+ Delete All Devices And Verify
+ Setup
+ Run Keyword If ${has_dataplane} Clean Up Linux
+ Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
+ FOR ${J} IN RANGE 0 ${num_olts}
+ ${bbsim_rel}= Catenate SEPARATOR= bbsim ${J}
+ ${bbsim_pod}= Get Pod Name By Label ${NAMESPACE} release ${bbsim_rel}
+ Restart Grpc Server ${NAMESPACE} ${bbsim_pod} 5
+ END
+ # Repeat sanity test without subscriber changes
+ Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test True
+ # Additional Verification
+ Wait Until Keyword Succeeds ${timeout} 2s Delete All Devices and Verify
+ Setup
+ Run Keyword If ${has_dataplane} Clean Up Linux
+ Wait Until Keyword Succeeds ${timeout} 2s Perform Sanity Test
+
Verify ONU Soft Reboot
[Documentation] Test soft reboot of the ONU using voltctl command
[Tags] VOL-1957 ONUSoftReboot functional notready