ONOS Node rolling restart test
- Kill ONOS k8s pods one at a time, while cordoning off the k8s node to
prevent restarts while verifications are happening
- While a node is down, check topology and ping between all hosts
- Uncordon the k8s node to restart the onos k8s pod
Change-Id: I871704068b633721cf79eb747a7c294575415e54
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index bafa284..8e6a90a 100755
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -495,7 +495,21 @@
self.Prompt(),
pexpect.TIMEOUT ] )
response = self.handle.before
- if i == 1:
+ if i == 1: # Not in ONOS CLI
+ # FIXME: This isn't really the correct place for this, but it works for now
+ # Check if port-forward session is still up first
+ if hasattr( main, "Cluster"):
+ ctrl = None
+ for c in main.Cluster.controllers:
+ if c.CLI is self:
+ ctrl = c
+ break
+ if not ctrl:
+ main.log.warn( self.name + ": Could not find this node in Cluster. Can't check port-forward status" )
+ elif ctrl.k8s:
+ ctrl.k8s.checkPortForward( ctrl.k8s.podName,
+ kubeconfig=ctrl.k8s.kubeConfig,
+ namespace=main.params[ 'kubernetes' ][ 'namespace' ] )
main.log.error( self.name + ": onos cli session closed. " )
if self.onosIp:
main.log.warn( "Trying to reconnect " + self.onosIp )