Update HA ZK test
diff --git a/TestON/tests/HATestZK/HATestZK.py b/TestON/tests/HATestZK/HATestZK.py
index 303cce0..8860070 100644
--- a/TestON/tests/HATestZK/HATestZK.py
+++ b/TestON/tests/HATestZK/HATestZK.py
@@ -1,4 +1,9 @@
+'''
+Description: This case is to ensure that in the event of Zookeeper failures (including the leader node)
+the cluster should continue to function properly by the passing of Zookeeper functionality to the
+remaining nodes. In this test, a quorum of the Zookeeper instances must be kept alive.
+'''
class HATestZK:
global topology
@@ -250,6 +255,25 @@
main.Mininet2.pingLong(src=main.params['PING']['source9'],target=main.params['PING']['target9'],pingTime=500)
main.Mininet2.pingLong(src=main.params['PING']['source10'],target=main.params['PING']['target10'],pingTime=500)
+ main.step("Create TestONTopology object")
+ ctrls = []
+ count = 1
+ while True:
+ temp = ()
+ if ('ip' + str(count)) in main.params['CTRL']:
+ temp = temp + (getattr(main,('ONOS' + str(count))),)
+ temp = temp + ("ONOS"+str(count),)
+ temp = temp + (main.params['CTRL']['ip'+str(count)],)
+ temp = temp + (eval(main.params['CTRL']['port'+str(count)]),)
+ ctrls.append(temp)
+ count = count + 1
+ else:
+ break
+ from sts.topology.teston_topology import TestONTopology # assumes that sts is already in you PYTHONPATH
+ global MNTopo
+ Topo = TestONTopology(main.Mininet1, ctrls) # can also add Intent API info for intent operations
+ MNTopo = Topo
+
def CASE5(self,main) :
import re
@@ -391,7 +415,16 @@
main.log.info("No Loss in the pings!")
utilities.assert_equals(expect=main.FALSE,actual=result,onpass="No Loss of connectivity!",onfail="LOSS OF CONNECTIVITY")
result5=not result
- result = result1 and result2 and result3 and result4 and result5
+
+ main.step("Check that ONOS Topology is consistent with MN Topology")
+
+
+ result6 = main.TRUE
+ for n in range(1,5):
+ result = main.Mininet1.compare_topo(MNTopo, main.ONOS1.get_json(main.params['CTRL']['ip'+str(n)]+":"+main.params['CTRL']['restPort'+str(n)]+main.params['TopoRest']))
+ utilities.assert_equals(expect=main.TRUE,actual=result,onpass="ONOS" + str(n) + " Topology matches MN Topology",onfail="ONOS" + str(n) + " Topology does not match MN Topology")
+ result6 = result6 and result
+ result = result1 and result2 and result3 and result4 and result5 and result6
utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Constant State Tests Passed!",onfail="CONSTANT STATE TESTS FAILED!!")
def CASE7 (self,main):
diff --git a/TestON/tests/HATestZK/HATestZK.topo b/TestON/tests/HATestZK/HATestZK.topo
index 9ccdb17..cecffad 100644
--- a/TestON/tests/HATestZK/HATestZK.topo
+++ b/TestON/tests/HATestZK/HATestZK.topo
@@ -2,7 +2,7 @@
<COMPONENT>
<ZK1>
- <host>10.128.9.1</host>
+ <host>10.128.11.1</host>
<user>admin</user>
<password></password>
<type>ZookeeperCliDriver</type>
@@ -12,7 +12,7 @@
</ZK1>
<ZK2>
- <host>10.128.9.2</host>
+ <host>10.128.11.2</host>
<user>admin</user>
<password></password>
<type>ZookeeperCliDriver</type>
@@ -22,7 +22,7 @@
</ZK2>
<ZK3>
- <host>10.128.9.3</host>
+ <host>10.128.11.3</host>
<user>admin</user>
<password></password>
<type>ZookeeperCliDriver</type>
@@ -32,7 +32,7 @@
</ZK3>
<ZK4>
- <host>10.128.9.4</host>
+ <host>10.128.11.4</host>
<user>admin</user>
<password></password>
<type>ZookeeperCliDriver</type>
@@ -42,7 +42,7 @@
</ZK4>
<ZK5>
- <host>10.128.9.5</host>
+ <host>10.128.11.5</host>
<user>admin</user>
<password></password>
<type>ZookeeperCliDriver</type>
@@ -52,7 +52,7 @@
</ZK5>
<RC1>
- <host>10.128.9.1</host>
+ <host>10.128.11.1</host>
<user>admin</user>
<password></password>
<type>RamCloudCliDriver</type>
@@ -62,7 +62,7 @@
</RC1>
<RC2>
- <host>10.128.9.2</host>
+ <host>10.128.11.2</host>
<user>admin</user>
<password></password>
<type>RamCloudCliDriver</type>
@@ -72,7 +72,7 @@
</RC2>
<RC3>
- <host>10.128.9.3</host>
+ <host>10.128.11.3</host>
<user>admin</user>
<password></password>
<type>RamCloudCliDriver</type>
@@ -82,7 +82,7 @@
</RC3>
<RC4>
- <host>10.128.9.4</host>
+ <host>10.128.11.4</host>
<user>admin</user>
<password></password>
<type>RamCloudCliDriver</type>
@@ -92,7 +92,7 @@
</RC4>
<RC5>
- <host>10.128.9.5</host>
+ <host>10.128.11.5</host>
<user>admin</user>
<password></password>
<type>RamCloudCliDriver</type>
@@ -102,7 +102,7 @@
</RC5>
<ONOS1>
- <host>10.128.9.1</host>
+ <host>10.128.11.1</host>
<user>admin</user>
<password></password>
<type>OnosCliDriver</type>
@@ -112,7 +112,7 @@
</ONOS1>
<ONOS2>
- <host>10.128.9.2</host>
+ <host>10.128.11.2</host>
<user>admin</user>
<password></password>
<type>OnosCliDriver</type>
@@ -122,7 +122,7 @@
</ONOS2>
<ONOS3>
- <host>10.128.9.3</host>
+ <host>10.128.11.3</host>
<user>admin</user>
<password></password>
<type>OnosCliDriver</type>
@@ -132,7 +132,7 @@
</ONOS3>
<ONOS4>
- <host>10.128.9.4</host>
+ <host>10.128.11.4</host>
<user>admin</user>
<password></password>
<type>OnosCliDriver</type>
@@ -142,7 +142,7 @@
</ONOS4>
<ONOS5>
- <host>10.128.9.5</host>
+ <host>10.128.11.5</host>
<user>admin</user>
<password></password>
<type>OnosCliDriver</type>
@@ -152,7 +152,7 @@
</ONOS5>
<Mininet1>
- <host>10.128.9.10</host>
+ <host>10.128.11.11</host>
<user>admin</user>
<password></password>
<type>MininetCliDriver</type>
@@ -166,7 +166,7 @@
</Mininet1>
<Mininet2>
- <host>10.128.9.10</host>
+ <host>10.128.11.11</host>
<user>admin</user>
<password></password>
<type>RemoteMininetDriver</type>