adding TestON
diff --git a/TestON/tests/OnosSanity/OnosSanity.params b/TestON/tests/OnosSanity/OnosSanity.params
new file mode 100644
index 0000000..85b626a
--- /dev/null
+++ b/TestON/tests/OnosSanity/OnosSanity.params
@@ -0,0 +1,17 @@
+<PARAMS>
+ <testcases>1</testcases>
+ <FLOWDEF>~/tmp</FLOWDEF>
+ <CASE1>
+ <destination>h6</destination>
+ </CASE1>
+ <PING>
+ <source1>h6</source1>
+ <target1>h31</target1>
+ <source2>h8</source2>
+ <target2>h33</target2>
+ </PING>
+ <LINK>
+ <begin>s1</begin>
+ <end>s2</end>
+ </LINK>
+</PARAMS>
diff --git a/TestON/tests/OnosSanity/OnosSanity.py b/TestON/tests/OnosSanity/OnosSanity.py
new file mode 100644
index 0000000..baaec06
--- /dev/null
+++ b/TestON/tests/OnosSanity/OnosSanity.py
@@ -0,0 +1,130 @@
+
+class OnosSanity :
+
+ def __init__(self) :
+ self.default = ''
+
+ def CASE1(self,main) :
+ import time
+ main.case("Checking if the startup was clean...")
+ main.step("Testing startup Zookeeper")
+ data = main.Zookeeper1.isup()
+ utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Zookeeper is up!",onfail="Zookeeper is down...")
+ main.step("Testing startup Cassandra")
+ data = main.Cassandra1.isup()
+ utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Cassandra is up!",onfail="Cassandra is down...")
+ main.step("Testing startup ONOS")
+ data = main.ONOS1.isup()
+ if data == main.FALSE:
+ main.log.info("Something is funny... restarting ONOS")
+ main.ONOS1.stop()
+ time.sleep(3)
+ main.ONOS1.start()
+ time.sleep(5)
+ data = main.ONOS1.isup()
+ main.log.info("\n\n\t\t\t\t ONOS VERSION")
+ main.ONOS1.get_version()
+ main.log.info("\n\n")
+ utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
+
+ def CASE2(self,main) :
+ main.case("Checking if one MN host exists")
+ main.step("Host IP Checking using checkIP")
+ result = main.Mininet1.checkIP(main.params['CASE1']['destination'])
+ main.step("Verifying the result")
+ utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host IP address configured",onfail="Host IP address not configured")
+
+ def CASE3(self,main) :
+ import time
+ main.case("Taking care of these flows!")
+ main.step("Cleaning out any leftover flows...")
+ main.ONOS1.delete_flow("all")
+ time.sleep(5)
+ strtTime = time.time()
+ main.ONOS1.add_flow(main.params['FLOWDEF'])
+ main.case("Checking flows")
+ result = main.FALSE
+ count = 1
+ main.log.info("Wait for flows to settle, then check")
+ while result == main.FALSE:
+ main.step("Waiting")
+ time.sleep(10)
+ main.step("Checking")
+ result = main.ONOS1.check_flow()
+ if result== main.FALSE and count < 6:
+ count = count + 1
+ main.log.info("Flow failed, waiting 10 seconds then making attempt number "+str(count))
+ elif result == main.FALSE and count == 6:
+ success = main.FALSE
+ break
+ else:
+ success = main.TRUE
+ break
+ endTime = time.time()
+ main.log.info("\n\t\t\t\tTime to add flows: "+str(endTime-strtTime)+" seconds")
+ utilities.assert_equals(expect=main.TRUE,actual=success,onpass="Flow check PASS",onfail="Flow check FAIL")
+ #time.sleep(10)
+ #data = main.ONOS1.get_flow("all")
+
+ def CASE4(self,main) :
+ main.case("Testing ping...")
+ ping_result = main.Mininet1.pingHost(src=main.params['PING']['source1'],target=main.params['PING']['target1'])
+ utilities.assert_equals(expect=main.TRUE,actual=ping_result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
+
+ def CASE5(self,main) :
+ import time
+ main.case("Bringing Link down... ")
+ result = main.Mininet1.link(END1=main.params['LINK']['begin'],END2=main.params['LINK']['end'],OPTION="down")
+ utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Link DOWN!",onfail="Link not brought down...")
+ time.sleep(10)
+
+ def CASE6(self,main) :
+ import time
+ main.case("Checking flows")
+ result = main.FALSE
+ count = 1
+ main.log.info("Wait for flows to settle, then check")
+ while result == main.FALSE:
+ main.step("Waiting")
+ time.sleep(10)
+ main.step("Checking")
+ result = main.ONOS1.check_flow()
+ if result== main.FALSE and count < 6:
+ count = count + 1
+ main.log.info("Flow failed, waiting 10 seconds then making attempt number "+str(count))
+ elif result == main.FALSE and count == 6:
+ success = main.FALSE
+ break
+ else:
+ success = main.TRUE
+ break
+ utilities.assert_equals(expect=main.TRUE,actual=success,onpass="Flow check PASS",onfail="Flow check FAIL")
+
+ def CASE7(self,main) :
+ main.case("Pinging EVERYTHINGGG!!!")
+ import time
+ strtTime = time.time()
+ result = main.TRUE
+ exit = main.FALSE
+ count = 1
+ while 1:
+ for i in range(6, 16) :
+ main.log.info("\n\t\t\t\th"+str(i)+" IS PINGING h"+str(i+25) )
+ ping = main.Mininet1.pingHost(src="h"+str(i),target="h"+str(i+25))
+ if ping == main.FALSE and count < 6:
+ count = count + 1
+ main.log.info("Ping failed, making attempt number "+str(count)+" in 10 seconds")
+ time.sleep(10)
+ break
+ elif ping == main.FALSE and count ==6:
+ main.log.error("Ping test failed")
+ exit = main.TRUE
+ break
+ elif ping == main.TRUE:
+ exit = main.TRUE
+ if exit == main.TRUE:
+ endTime = time.time()
+ break
+ main.log.info("\n\t\t\t\tTime to complete ping test: "+str(endTime-strtTime)+" seconds")
+ utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
+
diff --git a/TestON/tests/OnosSanity/OnosSanity.topo b/TestON/tests/OnosSanity/OnosSanity.topo
new file mode 100644
index 0000000..f55162c
--- /dev/null
+++ b/TestON/tests/OnosSanity/OnosSanity.topo
@@ -0,0 +1,50 @@
+<TOPOLOGY>
+
+ <COMPONENT>
+ <Zookeeper1>
+ <host>10.128.4.26</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>ZookeeperCliDriver</type>
+ <connect_order>1</connect_order>
+ <COMPONENTS>
+ </COMPONENTS>
+ </Zookeeper1>
+
+ <Cassandra1>
+ <host>10.128.4.26</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>CassandraCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS>
+ </COMPONENTS>
+ </Cassandra1>
+
+ <ONOS1>
+ <host>10.128.4.26</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>3</connect_order>
+ <COMPONENTS>
+
+ </COMPONENTS>
+ </ONOS1>
+
+ <Mininet1>
+ <host>10.128.4.26</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>MininetCliDriver</type>
+ <connect_order>4</connect_order>
+ <COMPONENTS>
+ # Specify the Option for mininet
+ <arg1> --custom ~/mininet/custom/topo-2sw-2host.py </arg1>
+ <arg2> --topo mytopo</arg2>
+ <controller> remote </controller>
+ </COMPONENTS>
+ </Mininet1>
+
+ </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/OnosSanity/OnosSanity.topo.back b/TestON/tests/OnosSanity/OnosSanity.topo.back
new file mode 100644
index 0000000..9561597
--- /dev/null
+++ b/TestON/tests/OnosSanity/OnosSanity.topo.back
@@ -0,0 +1,42 @@
+<TOPOLOGY>
+
+ <COMPONENT>
+ <Zookeeper1>
+ <host>10.128.4.26</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>ZookeeperCliDriver</type>
+ <COMPONENTS>
+ </COMPONENTS>
+ </Zookeeper1>
+ <Cassandra1>
+ <host>10.128.4.26</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>CassandraCliDriver</type>
+ <COMPONENTS>
+ </COMPONENTS>
+ </Cassandra1>
+ <ONOS1>
+ <host>10.128.4.26</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <COMPONENTS>
+
+ </COMPONENTS>
+ </ONOS1>
+
+
+ <ONOSRESTAPI1>
+ <host>10.128.4.26</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosRestApiDriver</type>
+ <COMPONENTS>
+ <topology_url>http://10.128.4.26:9000/topology</topology_url>
+ </COMPONENTS>
+ </ONOSRESTAPI1>
+
+ </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/OnosSanity/__init__.py b/TestON/tests/OnosSanity/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/OnosSanity/__init__.py