Refactor HAminorityRestart
- Split into two tests, one that kills ONOS and one that stops the
service
- Check ONOS between brining some ONOS nodes down and up
- Set "gossip" time to be a function of # of nodes
Change-Id: I389164c8225b2e496db433552a7ba5a5a3e5c2bb
diff --git a/TestON/tests/HAclusterRestart/HAclusterRestart.params b/TestON/tests/HAclusterRestart/HAclusterRestart.params
index 4626c39..e28c0f7 100644
--- a/TestON/tests/HAclusterRestart/HAclusterRestart.params
+++ b/TestON/tests/HAclusterRestart/HAclusterRestart.params
@@ -40,7 +40,7 @@
<port7>6653</port7>
</CTRL>
<BACKUP>
- <ENABLED>False</ENABLED>
+ <ENABLED> False </ENABLED>
<TESTONUSER>admin</TESTONUSER>
<TESTONIP>10.128.30.9</TESTONIP>
</BACKUP>
@@ -69,6 +69,7 @@
<timers>
<LinkDiscovery>12</LinkDiscovery>
<SwitchDiscovery>12</SwitchDiscovery>
+ <gossip>5</gossip>
</timers>
<kill>
<switch> s5 </switch>
diff --git a/TestON/tests/HAclusterRestart/HAclusterRestart.py b/TestON/tests/HAclusterRestart/HAclusterRestart.py
index 3e81d3e..1169a7d 100644
--- a/TestON/tests/HAclusterRestart/HAclusterRestart.py
+++ b/TestON/tests/HAclusterRestart/HAclusterRestart.py
@@ -752,14 +752,16 @@
append = True
else:
count += 1
- # FIXME: make this time configurable/calculate based off of number of
- # nodes and gossip rounds
+ gossipPeriod = int( main.params['timers']['gossip'] )
+ maxGossipTime = gossipPeriod * len( main.nodes )
utilities.assert_greater_equals(
- expect=40, actual=gossipTime,
+ expect=maxGossipTime, actual=gossipTime,
onpass="ECM anti-entropy for intents worked within " +
"expected time",
- onfail="Intent ECM anti-entropy took too long" )
- if gossipTime <= 40:
+ onfail="Intent ECM anti-entropy took too long. " +
+ "Expected time:{}, Actual time:{}".format( maxGossipTime,
+ gossipTime ) )
+ if gossipTime <= maxGossipTime:
intentAddResult = True
if not intentAddResult or "key" in pendingMap:
diff --git a/TestON/tests/HAclusterRestart/dependencies/obelisk.py b/TestON/tests/HAclusterRestart/dependencies/obelisk.py
index 4378a9b..d613806 100755
--- a/TestON/tests/HAclusterRestart/dependencies/obelisk.py
+++ b/TestON/tests/HAclusterRestart/dependencies/obelisk.py
@@ -67,4 +67,3 @@
if __name__ == '__main__':
setLogLevel( 'info' )
run()
-