diff --git a/TestON/tests/CassandraCheck/CassandraCheck.pyc b/TestON/tests/CassandraCheck/CassandraCheck.pyc
new file mode 100644
index 0000000..c2d5794
--- /dev/null
+++ b/TestON/tests/CassandraCheck/CassandraCheck.pyc
Binary files differ
diff --git a/TestON/tests/CassandraCheck/__init__.pyc b/TestON/tests/CassandraCheck/__init__.pyc
new file mode 100644
index 0000000..a4df73b
--- /dev/null
+++ b/TestON/tests/CassandraCheck/__init__.pyc
Binary files differ
diff --git a/TestON/tests/MininetTest/__init__.pyc b/TestON/tests/MininetTest/__init__.pyc
new file mode 100644
index 0000000..917ac46
--- /dev/null
+++ b/TestON/tests/MininetTest/__init__.pyc
Binary files differ
diff --git a/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.pyc b/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.pyc
new file mode 100644
index 0000000..5355937
--- /dev/null
+++ b/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.pyc
Binary files differ
diff --git a/TestON/tests/OnosCHO4nodes/__init__.pyc b/TestON/tests/OnosCHO4nodes/__init__.pyc
new file mode 100644
index 0000000..73fab79
--- /dev/null
+++ b/TestON/tests/OnosCHO4nodes/__init__.pyc
Binary files differ
diff --git a/TestON/tests/OnosCHO8nodes/OnosCHO8nodes.pyc b/TestON/tests/OnosCHO8nodes/OnosCHO8nodes.pyc
new file mode 100644
index 0000000..b10aa02
--- /dev/null
+++ b/TestON/tests/OnosCHO8nodes/OnosCHO8nodes.pyc
Binary files differ
diff --git a/TestON/tests/OnosCHO8nodes/__init__.pyc b/TestON/tests/OnosCHO8nodes/__init__.pyc
new file mode 100644
index 0000000..171aaa3
--- /dev/null
+++ b/TestON/tests/OnosCHO8nodes/__init__.pyc
Binary files differ
diff --git a/TestON/tests/OnosDD_PARP/OnosDD_PARP.pyc b/TestON/tests/OnosDD_PARP/OnosDD_PARP.pyc
new file mode 100644
index 0000000..7e3c03c
--- /dev/null
+++ b/TestON/tests/OnosDD_PARP/OnosDD_PARP.pyc
Binary files differ
diff --git a/TestON/tests/OnosDD_PARP/__init__.pyc b/TestON/tests/OnosDD_PARP/__init__.pyc
new file mode 100644
index 0000000..06b4186
--- /dev/null
+++ b/TestON/tests/OnosDD_PARP/__init__.pyc
Binary files differ
diff --git a/TestON/tests/OnosPerf/OnosPerf.pyc b/TestON/tests/OnosPerf/OnosPerf.pyc
new file mode 100644
index 0000000..549ad66
--- /dev/null
+++ b/TestON/tests/OnosPerf/OnosPerf.pyc
Binary files differ
diff --git a/TestON/tests/OnosPerf/__init__.pyc b/TestON/tests/OnosPerf/__init__.pyc
new file mode 100644
index 0000000..170443d
--- /dev/null
+++ b/TestON/tests/OnosPerf/__init__.pyc
Binary files differ
diff --git a/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.pyc b/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.pyc
new file mode 100644
index 0000000..e04e189
--- /dev/null
+++ b/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.pyc
Binary files differ
diff --git a/TestON/tests/OnosPerf4nodes/__init__.pyc b/TestON/tests/OnosPerf4nodes/__init__.pyc
new file mode 100644
index 0000000..ed9f676
--- /dev/null
+++ b/TestON/tests/OnosPerf4nodes/__init__.pyc
Binary files differ
diff --git a/TestON/tests/OnosPerfTest/OnosPerfTest.params b/TestON/tests/OnosPerfTest/OnosPerfTest.params
new file mode 100644
index 0000000..05c11da
--- /dev/null
+++ b/TestON/tests/OnosPerfTest/OnosPerfTest.params
@@ -0,0 +1,43 @@
+<PARAMS>
+    <testcases>1,2,3,4,5,6,7,8,9</testcases>
+    <Iterations>3</Iterations>
+    <WaitTime>120</WaitTime>
+    <RestIP>10.128.100.4</RestIP>
+    <MN_size>57</MN_size>
+    <TargetTime>20</TargetTime>
+    <NR_Switches>25</NR_Switches>
+    <NR_Links>50</NR_Links>
+    <FLOWDEF>~/flowdef_files/Center_Triangle/flowdef_20.txt</FLOWDEF>
+    <CTRL>
+        <ip1>10.128.100.1</ip1>
+        <port1>6633</port1>
+        <ip2>10.128.100.4</ip2>
+        <port2>6633</port2>
+        <ip3>10.128.100.5</ip3>
+        <port3>6633</port3>
+        <ip4>10.128.100.6</ip4>
+        <port4>6633</port4>
+    </CTRL>
+    <PING>
+        <source1>h6</source1>
+        <source2>h7</source2>
+        <source3>h8</source3>
+        <source4>h9</source4>
+        <source5>h10</source5>
+        <source6>h11</source6>
+        <source7>h12</source7>
+        <source8>h13</source8>
+        <source9>h14</source9>
+        <source10>h15</source10>
+        <target1>10.0.0.16</target1>
+        <target2>10.0.0.17</target2>
+        <target3>10.0.0.18</target3>
+        <target4>10.0.0.19</target4>
+        <target5>10.0.0.20</target5>
+        <target6>10.0.0.21</target6>
+        <target7>10.0.0.22</target7>
+        <target8>10.0.0.23</target8>
+        <target9>10.0.0.24</target9>
+        <target10>10.0.0.25</target10>
+    </PING>
+</PARAMS>      
diff --git a/TestON/tests/OnosPerfTest/OnosPerfTest.py b/TestON/tests/OnosPerfTest/OnosPerfTest.py
new file mode 100644
index 0000000..70a3955
--- /dev/null
+++ b/TestON/tests/OnosPerfTest/OnosPerfTest.py
@@ -0,0 +1,337 @@
+
+class OnosPerfTest:
+
+    def __init__(self) :
+        self.default = ''
+
+    def CASE1(self,main) :
+        '''
+        First case is to simply check if ONOS, ZK, and Cassandra are all running properly.
+        If ONOS if not running properly, it will restart ONOS once before continuing. 
+        It will then check if the ONOS has a view of all the switches and links as defined in the params file.
+        The test will only pass if ONOS is running properly, and has a full view of all topology elements.
+        '''
+        import time
+        main.log.report("Checking if the startup was clean") 
+        main.case("Checking if the startup was clean...")
+        main.ONOS1.stop()
+        main.ONOS2.stop()
+        main.ONOS3.stop()
+        main.ONOS4.stop()
+        main.step("Testing startup Zookeeper")
+        main.ONOS1.get_version()
+        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")
+        main.Cassandra1.start()
+        main.Cassandra2.start()
+        main.Cassandra3.start()
+        main.Cassandra4.start()
+        data =  main.Cassandra1.isup()
+        utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Cassandra is up!",onfail="Cassandra is down...")
+        main.ONOS1.drop_keyspace()
+        time.sleep(5) 
+        main.ONOS1.start()
+        time.sleep(5)
+        main.ONOS2.start()
+        main.ONOS3.start()
+        main.ONOS4.start()
+        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()
+        data = data & main.ONOS2.isup()
+        data = data & main.ONOS3.isup()
+        data = data & main.ONOS4.isup()
+        main.ONOS1.start_rest()
+        #topoview = main.ONOS1.check_status(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+
+        utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running ",onfail="ONOS didn't start ...")
+
+    def CASE2(self,main) :
+        '''
+        Makes sure that the HW links are all up
+        Verifies that at least one mininet host exists.
+        Proves that there is actually a mininet that we are working with
+        '''
+        import time
+        main.step("Checking if MN switches exist")
+        main.log.report("Check if MN switches exist")
+        #result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+        #for i in range(2):
+        #    if result == main.FALSE: 
+        #        time.sleep(5)
+        #        result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+        #    else: 
+        #        break
+        #main.step("Verifying the result")
+        #utilities.assert_equals(expect=main.TRUE,actual=result,onpass="MN switches exist",onfail="MN is missing switches and or links...")
+
+        main.step("assigning ONOS controllers to switches")
+        for i in range(25):
+            if i < 3:
+                j=i+1
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])
+                time.sleep(1)
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
+            elif i >= 3 and i < 5:
+                j=i+1
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip2'],port1=main.params['CTRL']['port2'])
+                time.sleep(1)
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
+            elif i >= 5 and i < 15:
+                j=i+1
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip3'],port1=main.params['CTRL']['port3'])
+                time.sleep(1)
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
+            else:
+                j=i+16
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip4'],port1=main.params['CTRL']['port4'])
+                time.sleep(1)
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
+        main.Mininet1.get_sw_controller("s1")
+
+    def CASE3(self,main) :
+        '''
+        Verifies that ONOS sees the right topology... 
+        '''
+        import time
+        main.log.report("checking if ONOS sees the right topo...") 
+        main.case("TOPO check")
+        main.step("calling rest calls") 
+        for i in range(9):
+            result = main.ONOS1.check_status(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+            time.sleep(5)
+            if result == 1:
+                break
+        if result == 0:
+            main.ONOS1.start()
+            main.ONOS2.start()
+            main.ONOS3.start()
+            main.ONOS4.start()
+            for i in range(9):
+                result = main.ONOS1.check_status(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+                time.sleep(5)
+                if result == 1:
+                    break
+        utilities.assert_equals(expect=1,actual=result)
+       
+    def CASE4(self,main) :
+        '''
+        This Test case: 
+            - Clears out any leftover flows
+            - Adds new flows into ONOS
+            - Checks flows up to 10 times waiting for each flow to be caluculated and no "NOT" statements inte get_flow
+        '''
+        import time
+        main.log.report("Deleting and adding flows")
+        main.case("Taking care of these flows!") 
+        main.step("Cleaning out any leftover flows...")
+        main.log.info("deleting...")
+        main.ONOS1.delete_flow("all")
+        main.log.info("adding...")
+        t1 = time.time()
+        main.ONOS1.add_flow(main.params['FLOWDEF'])   
+        main.log.info("Checking...")
+        for i in range(15):
+            result = main.ONOS1.check_flow()
+            if result == main.TRUE: 
+                t2 = time.time()
+                main.log.info( 'Adding flows took %0.3f s' % (t2-t1))
+                break
+            time.sleep(5)
+            main.log.info("Checking Flows again...")
+
+        strtTime = time.time()
+        count = 1
+        i = 6
+        while i < 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 < 3:
+                count = count + 1
+                i = 6
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 10 seconds")
+                time.sleep(10)
+            elif ping == main.FALSE and count ==3:
+                main.log.error("Ping test failed")
+                i = 17
+                result = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result = main.TRUE
+        endTime = time.time()
+        if result == main.TRUE:
+            main.log.info("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.info("\tPING TEST FAIL")
+
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="flows are good",onfail="FLOWS not correct") 
+
+
+    def CASE5(self,main) :
+        '''
+        Tests a single ping 
+        '''
+        main.log.report("Testing a single ping")
+        main.case("Testing ping...")
+        ping_result = main.Mininet4.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 CASE6(self,main) :
+        '''
+        Starts continuous pings on the Mininet nodes
+        '''
+        main.log.report("Start continuous pings, then toggle links in center triangle")
+        import time
+        import os
+
+        main.case("Starting long ping... ") 
+        main.Mininet4.pingLong(src=main.params['PING']['source1'],target=main.params['PING']['target1'])
+        main.Mininet4.pingLong(src=main.params['PING']['source2'],target=main.params['PING']['target2'])
+        main.Mininet4.pingLong(src=main.params['PING']['source3'],target=main.params['PING']['target3'])
+        main.Mininet4.pingLong(src=main.params['PING']['source4'],target=main.params['PING']['target4'])
+        main.Mininet4.pingLong(src=main.params['PING']['source5'],target=main.params['PING']['target5'])
+        main.Mininet4.pingLong(src=main.params['PING']['source6'],target=main.params['PING']['target6'])
+        main.Mininet4.pingLong(src=main.params['PING']['source7'],target=main.params['PING']['target7'])
+        main.Mininet4.pingLong(src=main.params['PING']['source8'],target=main.params['PING']['target8'])
+        main.Mininet4.pingLong(src=main.params['PING']['source9'],target=main.params['PING']['target9'])
+        main.Mininet4.pingLong(src=main.params['PING']['source10'],target=main.params['PING']['target10'])
+        main.step("Check that the pings are going")
+        result = main.Mininet4.pingstatus(src=main.params['PING']['source1'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source2'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source3'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source4'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source5'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source6'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source7'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source8'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source9'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source10'])
+        main.step( "Making topo change while flows are rerouting")
+            
+        for i in range(int(main.params['Iterations'])): 
+            main.log.info("s1-s2 link down")
+            main.Mininet1.link(END1="s1",END2="s2",OPTION="down")
+
+            time.sleep(3)
+
+            main.log.info("s1-s2 link up | s1-s3 link down | s2-s3 link down")
+            main.Mininet1.link(END1="s1",END2="s2",OPTION="up")
+            main.Mininet1.link(END1="s1",END2="s3",OPTION="down")
+            main.Mininet1.link(END1="s2",END2="s3",OPTION="down")
+
+            main.log.info( "Waiting " + main.params['WaitTime'] + " seconds.... " )
+            time.sleep( int(main.params['WaitTime']) )
+
+        main.case("Killing remote ping processes ") 
+        result =  result & main.Mininet4.pingKill() 
+        utilities.assert_equals(expect=main.TRUE,actual=result) 
+       
+
+    def CASE7(self,main) :
+        '''
+        Processes all of the ping data and outputs raw data and an overall average
+        '''
+        import os
+        import time
+        main.log.report("Process ping data")
+        main.case("Processing Ping data") 
+        time.sleep(3) 
+        #result=os.popen("/home/admin/tools/shell.sh " + main.params['Iterations']).read()
+        result=os.popen("/home/admin/get_reroute_times.py").read() 
+        average=result.split(":")[1] 
+        main.log.info( "Reroute times are... " ) 
+        main.log.report( result ) 
+        try:
+            if float(average) < float(main.params['TargetTime']) :
+                test=main.TRUE
+            else:
+                test=main.FALSE
+        except ValueError: 
+            main.log.error("Data is corrupted")
+            test=main.FALSE
+        utilities.assert_equals(expect=main.TRUE,actual=test,onpass="Average is less then the target time!",onfail="Average is worse then target time... ")
+
+    def CASE8(self,main) :
+        '''
+        Starts continuous pings on the Mininet nodes
+        '''
+        main.log.report("Start continuous pings, then toggle links in center triangle")
+        import time
+        import os
+
+        main.case("Starting long ping... ")
+        main.Mininet4.pingLong(src=main.params['PING']['source1'],target=main.params['PING']['target1'])
+        main.Mininet4.pingLong(src=main.params['PING']['source2'],target=main.params['PING']['target2'])
+        main.Mininet4.pingLong(src=main.params['PING']['source3'],target=main.params['PING']['target3'])
+        main.Mininet4.pingLong(src=main.params['PING']['source4'],target=main.params['PING']['target4'])
+        main.Mininet4.pingLong(src=main.params['PING']['source5'],target=main.params['PING']['target5'])
+        main.Mininet4.pingLong(src=main.params['PING']['source6'],target=main.params['PING']['target6'])
+        main.Mininet4.pingLong(src=main.params['PING']['source7'],target=main.params['PING']['target7'])
+        main.Mininet4.pingLong(src=main.params['PING']['source8'],target=main.params['PING']['target8'])
+        main.Mininet4.pingLong(src=main.params['PING']['source9'],target=main.params['PING']['target9'])
+        main.Mininet4.pingLong(src=main.params['PING']['source10'],target=main.params['PING']['target10'])
+        main.step("Check that the pings are going")
+        result = main.Mininet4.pingstatus(src=main.params['PING']['source1'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source2'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source3'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source4'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source5'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source6'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source7'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source8'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source9'])
+        result = result & main.Mininet4.pingstatus(src=main.params['PING']['source10'])
+        main.step( "Making topo change while flows are rerouting")
+
+        for i in range(int(main.params['Iterations'])):
+            main.log.info("s1-s2 link down | Onos 1 down")
+            main.Mininet1.link(END1="s1",END2="s2",OPTION="down")
+            main.ONOS1.stop() 
+
+            time.sleep(3)
+
+            main.log.info("s1-s2 link up | Onos 1 back up")
+            main.Mininet1.link(END1="s1",END2="s2",OPTION="up")
+            main.ONOS1.start()
+            main.ONOS1.isup()
+
+            main.log.info( "Waiting " + main.params['WaitTime'] + " seconds.... " )
+            time.sleep( int(main.params['WaitTime']) )
+
+        main.case("Killing remote ping processes ")
+        result =  result & main.Mininet4.pingKill()
+        utilities.assert_equals(expect=main.TRUE,actual=result)
+
+
+    def CASE9(self,main) :
+        '''
+        Processes all of the ping data and outputs raw data and an overall average
+        '''
+        import os
+        import time
+        main.log.report("Process ping data")
+        main.case("Processing Ping data")
+        time.sleep(3)
+        #result=os.popen("/home/admin/tools/shell.sh " + main.params['Iterations']).read()
+        result=os.popen("/home/admin/get_reroute_times.py").read()
+        average=result.split(":")[1]
+        main.log.info( "Reroute times are... " )
+        main.log.report( result )
+        try:
+            if float(average) < float(main.params['TargetTime']) :
+                test=main.TRUE
+            else:
+                test=main.FALSE
+        except ValueError:
+            main.log.error("Data is corrupted")
+            test=main.FALSE
+        utilities.assert_equals(expect=main.TRUE,actual=test,onpass="Average is less then the target time!",onfail="Average is worse then target time... ")
+
diff --git a/TestON/tests/OnosPerfTest/OnosPerfTest.pyc b/TestON/tests/OnosPerfTest/OnosPerfTest.pyc
new file mode 100644
index 0000000..77d7ca0
--- /dev/null
+++ b/TestON/tests/OnosPerfTest/OnosPerfTest.pyc
Binary files differ
diff --git a/TestON/tests/OnosPerfTest/OnosPerfTest.topo b/TestON/tests/OnosPerfTest/OnosPerfTest.topo
new file mode 100644
index 0000000..eb6130f
--- /dev/null
+++ b/TestON/tests/OnosPerfTest/OnosPerfTest.topo
@@ -0,0 +1,99 @@
+<TOPOLOGY>
+    <COMPONENT>
+        <Zookeeper1>
+            <host>10.128.100.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>ZookeeperCliDriver</type>
+            <connect_order>1</connect_order>
+        </Zookeeper1>
+
+        <Cassandra1>
+            <host>10.128.100.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>CassandraCliDriver</type>
+            <connect_order>2</connect_order>
+        </Cassandra1>
+        <Cassandra2>
+            <host>10.128.100.4</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>CassandraCliDriver</type>
+            <connect_order>3</connect_order>
+        </Cassandra2>
+        <Cassandra3>
+            <host>10.128.100.5</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>CassandraCliDriver</type>
+            <connect_order>4</connect_order>
+        </Cassandra3>
+        <Cassandra4>
+            <host>10.128.100.6</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>CassandraCliDriver</type>
+            <connect_order>5</connect_order>
+        </Cassandra4>
+ 
+        <ONOS1>
+            <host>10.128.100.1</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>6</connect_order>
+        </ONOS1>
+        <ONOS2>
+            <host>10.128.100.4</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>7</connect_order>
+        </ONOS2>
+        <ONOS3>
+            <host>10.128.100.5</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>8</connect_order>
+        </ONOS3>
+        <ONOS4>
+            <host>10.128.100.6</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>OnosCliDriver</type>
+            <connect_order>9</connect_order>
+        </ONOS4>
+
+        <Mininet1>
+            <host>10.128.100.11</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>MininetCliDriver</type>
+            <connect_order>10</connect_order>
+            <COMPONENTS>
+                # Specify the Option for mininet
+                <arg1> --custom ~/mininet/custom/topo-onos4node.py </arg1>
+                <arg2> --topo mytopo</arg2>
+                <controller> remote,ip=10.128.100.1,port=6633 </controller>
+             </COMPONENTS>
+        </Mininet1>
+
+        <Mininet4>
+            <host>10.128.100.11</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>RemoteMininetDriver</type>
+            <connect_order>11</connect_order>
+        </Mininet4>
+        <Mininet8>
+            <host>10.128.100.11</host>
+            <user>admin</user>
+            <password>onos_test</password>
+            <type>RemoteMininetDriver</type>
+            <connect_order>12</connect_order>
+        </Mininet8>
+
+    </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/OnosPerfTest/__init__.py b/TestON/tests/OnosPerfTest/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/OnosPerfTest/__init__.py
diff --git a/TestON/tests/OnosPerfTest/__init__.pyc b/TestON/tests/OnosPerfTest/__init__.pyc
new file mode 100644
index 0000000..69a5962
--- /dev/null
+++ b/TestON/tests/OnosPerfTest/__init__.pyc
Binary files differ
diff --git a/TestON/tests/OnosSanity/OnosSanity.pyc b/TestON/tests/OnosSanity/OnosSanity.pyc
new file mode 100644
index 0000000..640a28d
--- /dev/null
+++ b/TestON/tests/OnosSanity/OnosSanity.pyc
Binary files differ
diff --git a/TestON/tests/OnosSanity/__init__.pyc b/TestON/tests/OnosSanity/__init__.pyc
new file mode 100644
index 0000000..d852f43
--- /dev/null
+++ b/TestON/tests/OnosSanity/__init__.pyc
Binary files differ
diff --git a/TestON/tests/OnosSanity4nodes/OnosSanity4node_testDD.py b/TestON/tests/OnosSanity4nodes/OnosSanity4node_testDD.py
new file mode 100644
index 0000000..a0c9f98
--- /dev/null
+++ b/TestON/tests/OnosSanity4nodes/OnosSanity4node_testDD.py
@@ -0,0 +1,456 @@
+
+class OnosSanity4nodes :
+
+    def __init__(self) :
+        self.default = ''
+
+#**********************************************************************************************************************************************************************************************
+#Test startup
+#Tests the startup of Zookeeper1, Cassandra1, and ONOS1 to be certain that all started up successfully
+    def CASE1(self,main) :  #Check to be sure ZK, Cass, and ONOS are up, then get ONOS version
+        import time
+        main.log.report("Pulling latest code from github to all nodes")
+        main.ONOS1.git_pull()
+        main.ONOS2.git_pull()
+        main.ONOS3.git_pull()
+        main.ONOS4.git_pull()
+        main.Cassandra1.start()
+        main.Cassandra2.start()
+        main.Cassandra3.start()
+        main.Cassandra4.start()
+        time.sleep(20)
+        main.ONOS1.drop_keyspace()
+        main.ONOS1.start()
+        time.sleep(10)
+        main.ONOS2.start()
+        main.ONOS3.start()
+        main.ONOS4.start()
+        main.ONOS1.start_rest()
+        time.sleep(5)
+        test= main.ONOS1.rest_status()
+        if test == main.FALSE:
+            main.ONOS1.start_rest()
+        main.ONOS1.get_version()
+        main.log.report("Startup check Zookeeper1, Cassandra1, and ONOS1 connections")
+        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() 
+        if data == main.FALSE:
+            main.Cassandra1.stop()
+            main.Cassandra2.stop()
+            main.Cassandra3.stop()
+            main.Cassandra4.stop()
+
+            time.sleep(5)
+ 
+            main.Cassandra1.start()
+            main.Cassandra2.start()
+            main.Cassandra3.start()
+            main.Cassandra4.start()
+        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.report("Something is funny... restarting ONOS")
+            main.ONOS1.stop()
+            time.sleep(3)
+            main.ONOS1.start()
+            time.sleep(5) 
+            data = main.ONOS1.isup()
+        utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
+           
+#**********************************************************************************************************************************************************************************************
+#Assign Controllers
+#This test first checks the ip of a mininet host, to be certain that the mininet exists(Host is defined in Params as <CASE1><destination>).
+#Then the program assignes each ONOS instance a single controller to a switch(To be the initial master), then assigns all controllers.
+#NOTE: The reason why all four controllers are assigned although one was already assigned as the master is due to the 'ovs-vsctl set-controller' command erases all present controllers if
+#      the controllers already assigned to the switch are not specified.
+
+    def CASE2(self,main) :    #Make sure mininet exists, then assign controllers to switches
+        import time
+        main.log.report("Check if mininet started properly, then assign controllers ONOS 1,2,3 and 4")
+        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")
+        main.step("assigning ONOS controllers to switches")
+        for i in range(25): 
+            if i < 3:
+                j=i+1
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])
+                time.sleep(1)
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
+            elif i >= 3 and i < 5:
+                j=i+1
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip2'],port1=main.params['CTRL']['port2'])
+                time.sleep(1)
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
+            elif i >= 5 and i < 15:
+                j=i+1
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip3'],port1=main.params['CTRL']['port3'])
+                time.sleep(1)
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
+            else:
+                j=i+16
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip4'],port1=main.params['CTRL']['port4'])
+                time.sleep(1)
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
+        main.Mininet1.get_sw_controller("s1")       
+ 
+# **********************************************************************************************************************************************************************************************
+#Add Flows
+#Deletes any remnant flows from any previous test, add flows from the file labeled <FLOWDEF>, then runs the check flow test
+#NOTE: THE FLOWDEF FILE MUST BE PRESENT ON TESTON VM!!! TestON will copy the file from its home machine into /tmp/flowtmp on the machine the ONOS instance is present on
+
+    def CASE3(self,main) :    #Delete any remnant flows, then add flows, and time how long it takes flow tables to update
+        main.log.report("Delete any flows from previous tests, then add flows from FLOWDEF file, then wait for switch flow tables to update")
+        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")
+        tmp = main.FALSE
+        count = 1
+        main.log.info("Wait for flows to be pushed to the switches, then check")
+        while tmp == main.FALSE:
+            main.step("Waiting")
+            time.sleep(10)
+            main.step("Checking")
+            tmp = main.ONOS1.check_flow()
+            if tmp == main.FALSE and count < 6:
+                count = count + 1
+                main.log.report("Flow failed, waiting 10 seconds then making attempt number "+str(count))
+            elif tmp == main.FALSE and count == 6:
+                result1 = main.FALSE
+                break
+            else:
+                result1 = main.TRUE
+                break
+        endTime = time.time()
+        if result1 == main.TRUE:
+            main.log.report("\n\t\t\t\tTime to add flows: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tFlows failed check")
+        
+        strtTime = time.time()
+        count = 1
+        i = 6
+        while i < 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 < 3:
+                count = count + 1
+                i = 6
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 10 seconds")
+                time.sleep(10)
+            elif ping == main.FALSE and count ==3:
+                main.log.error("Ping test failed")
+                i = 17
+                result2 = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result2 = main.TRUE
+        endTime = time.time()
+        if result2 == main.TRUE:
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tPING TEST FAIL")
+
+        result3 = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+        main.step("Verifying the result")
+        utilities.assert_equals(expect=main.TRUE,actual=result1 and result2 and result3,onpass="Flow check PASS",onfail="Flow check FAIL")
+
+#**********************************************************************************************************************************************************************************************
+#This test case removes Controllers 2,3, and 4 then performs a ping test.
+#The assign controller is used because the ovs-vsctl module deletes all current controllers when a new controller is assigned.
+#The ping test performs single pings on hosts from opposite sides of the topology. If one ping fails, the test waits 5 seconds before trying again.
+#If the ping test fails 6 times, then the test case will return false
+
+    def CASE4(self,main) :
+        main.log.report("Remove ONOS 2,3,4 then ping until all hosts are reachable or fail after 6 attempts")
+        import time
+        for i in range(25):
+            if i < 15:
+                j=i+1
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])  #Assigning a single controller removes all other controllers
+            else:
+                j=i+16
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])
+      
+        strtTime = time.time() 
+        result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+        for i in range(2):
+            if result == main.FALSE:
+                time.sleep(5)
+                result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+            else:
+                break
+
+        count = 1
+        i = 6
+        while i < 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
+                i = 6
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 5 seconds")
+                time.sleep(5)
+            elif ping == main.FALSE and count ==6:
+                main.log.error("Ping test failed")
+                i = 17
+                result = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result = main.TRUE
+        endTime = time.time() 
+        if result == main.TRUE:
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tPING TEST FAIL")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
+
+# **********************************************************************************************************************************************************************************************
+#This test case restores the controllers removed by Case 4 then performs a ping test.
+
+    def CASE5(self,main) :
+        main.log.report("Restore ONOS 2,3,4 then ping until all hosts are reachable or fail after 6 attempts")
+        import time
+        for i in range(25):
+            if i < 15:
+                j=i+1
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
+            else:
+                j=i+16
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
+      
+        strtTime = time.time() 
+        result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+        for i in range(2):
+            if result == main.FALSE:
+                time.sleep(5)
+                result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+            else:
+                break
+
+        count = 1
+        i = 6
+        while i < 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
+                i = 6
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 5 seconds")
+                time.sleep(5)
+            elif ping == main.FALSE and count ==6:
+                main.log.error("Ping test failed")
+                i = 17
+                result = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result = main.TRUE
+        endTime = time.time()
+        if result == main.TRUE:
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tPING TEST FAILED")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
+
+# **********************************************************************************************************************************************************************************************
+#Brings a link that all flows pass through in the mininet down, then runs a ping test to view reroute time
+
+    def CASE6(self,main) :
+        main.log.report("Bring Link between s1 and s2 down, then ping until all hosts are reachable or fail after 10 attempts")
+        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...")
+       
+        strtTime = time.time() 
+        result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],str(int(main.params['NR_Links'])-2))
+        for i in range(2):
+            if result == main.FALSE:
+                time.sleep(5)
+                result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],str(int(main.params['NR_Links'])-2))
+            else:
+                break
+
+        count = 1
+        i = 6
+        while i < 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 < 10:
+                count = count + 1
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 5 seconds")
+                i = 6
+                time.sleep(5)
+            elif ping == main.FALSE and count == 10:
+                main.log.error("Ping test failed")
+                i = 17
+                result = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result = main.TRUE
+        endTime = time.time()
+        if result == main.TRUE:
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tPING TEST FAILED")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
+
+# **********************************************************************************************************************************************************************************************
+#Brings the link that Case 6 took down  back up, then runs a ping test to view reroute time
+
+    def CASE7(self,main) :
+        main.log.report("Bring Link between s1 and s2 up, then ping until all hosts are reachable or fail after 10 attempts")
+        import time
+        main.case("Bringing Link up... ")
+        result = main.Mininet1.link(END1=main.params['LINK']['begin'],END2=main.params['LINK']['end'],OPTION="up")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Link UP!",onfail="Link not brought up...")
+      
+        strtTime = time.time() 
+        result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+        for i in range(2):
+            if result == main.FALSE:
+                time.sleep(5)
+                result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+            else:
+                break
+
+        strtTime = time.time()
+        count = 1
+        i = 6
+        while i < 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 < 10:
+                count = count + 1
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 5 seconds")
+                i = 6
+                time.sleep(5)
+            elif ping == main.FALSE and count ==10:
+                main.log.error("Ping test failed")
+                i = 17
+                result = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result = main.TRUE
+        endTime = time.time()
+        if result == main.TRUE:
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tPING TESTS FAILED")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
+
+
+# ******************************************************************************************************************************************************************
+# Test Device Discovery function by yanking s6:s6-eth0 interface and re-plug it into a switch
+
+    def CASE21(self,main) :
+        import json
+        from drivers.common.api.onosrestapidriver import *
+        main.log.report("Test device discovery function, by attach/detach/move host h1 from s1->s6->s1.")
+        main.log.report("Check initially hostMAC exist on the mininet...")
+        host = main.params['YANK']['hostname']
+        mac = main.params['YANK']['hostmac']
+        RestIP1 = main.params['RESTCALL']['restIP1']
+        RestIP2 = main.params['RESTCALL']['restIP2']
+        RestPort = main.params['RESTCALL']['restPort']
+        url = main.params['RESTCALL']['restURL']
+        #print "host=" + host + ";  RestIP=" + RestIP1 + ";  RestPort=" + str(RestPort)
+        
+        main.log.info("\n\t\t\t\t ping issue one ping from" + str(host) + "to generate arp to switch. Ping result is not important" )
+        ping = main.Mininet1.pingHost(src = str(host),target = "10.0.0.254")
+        restcall = OnosRestApiDriver()
+        Reststatus, Hoststatus = restcall.find_host(RestIP1,RestPort,url,mac)
+        try:
+            attachedSW = Hoststatus[0]['attachmentPoint'][0]['switchDPID']
+            host_ip = Hoststatus[0]['ipv4'][0]
+        except:
+            Reststatus = 0
+        if Reststatus == 1 and host_ip == '10.0.0.1':
+            main.log.report("\tFound host " + host + " attached to switchDPID = " + attachedSW)
+            result = main.TRUE
+        else:
+            main.log.report("\t Host " + host + " with MAC:" + str(mac) + " does not exist. FAILED")
+            result = main.FALSE
+
+        ##### Step to yank out "s1-eth1" from s1, which is on autoONOS1 #####
+
+        main.log.report("Yank out s1-eth1")
+        main.case("Yankout s6-eth1 (link to h1) from s1")
+        result = main.Mininet1.yank(SW=main.params['YANK']['sw1'],INTF=main.params['YANK']['intf'])
+        time.sleep(3)
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Yank command suceeded",onfail="Yank command failed...")
+        ping = main.Mininet1.pingHost(src = str(host),target = "10.0.0.254")
+        Reststatus, Hoststatus = restcall.find_host(RestIP1,RestPort,url,mac)
+        try:
+            attachedSW = Hoststatus[0]['attachmentPoint'][0]['switchDPID']
+        except IndexError:
+            Reststatus = 0
+        if Reststatus == 0:
+            main.log.report("Attempt to yank out s1-eth1 from s1 sucessfully")
+            result = main.TRUE
+        else:
+            main.log.report("Attempt to yank out s1-eht1 from s1 failed.")
+            result = main.FALSE
+        
+        ##### Step to plug "s1-eth1" to s6, which is on autoONOS3  ######
+        main.log.report("Plug s1-eth1 into s6")
+        main.case("Plug s1-eth1 to s6")
+        result = main.Mininet1.plug(SW=main.params['PLUG']['sw6'],INTF=main.params['PLUG']['intf'])
+        time.sleep(3)
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Plug command suceeded",onfail="Plug command failed...")
+        ping = main.Mininet1.pingHost(src = str(host),target = "10.0.0.254")
+        Reststatus, Hoststatus = restcall.find_host(RestIP2,RestPort,url,mac)
+        try:
+            attachedSW = Hoststatus[0]['attachmentPoint'][0]['switchDPID']
+            host_ip = Hoststatus[0]['ipv4'][0]
+        except:
+            Reststatus = 0
+        if Reststatus == 0:
+            main.log.report("Attempt to plug s1-eth1 to s6 FAILED")
+            result = main.FALSE
+        elif attachedSW == "00:00:00:00:00:00:00:06"and host_ip == '10.0.0.1':
+            main.log.report("Attempt to plug s1-eht1 to s6 succeded.")
+            result = main.TRUE
+        else:
+            main.log.report( "FAILED to attach s1-eth1 to s6 correctly!")
+            result = main.FALSE
+
+        ###### Step to put interface "s1-eth1" back to s1"#####
+        main.log.report("Move s1-eth1 back on to s1")
+        main.case("Move s1-eth1 back to s1")
+        result = main.Mininet1.yank(SW=main.params['YANK']['sw6'],INTF=main.params['YANK']['intf'])
+        time.sleep(3)
+        retult = main.Mininet1.plug(SW=main.params['PLUG']['sw1'],INTF=main.params['PLUG']['intf'])
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Yank/Plug command suceeded",onfail="Yank/Plug command failed...")
+        ping = main.Mininet1.pingHost(src = str(host),target = "10.0.0.254")
+        Reststatus, Hoststatus = restcall.find_host(RestIP1,RestPort,url,mac)
+        try:
+            attachedSW = Hoststatus[0]['attachmentPoint'][0]['switchDPID']
+            host_ip = Hoststatus[0]['ipv4'][0]
+        except:
+            Reststatus = 0
+        if Reststatus == 0:
+            main.log.report("Attempt to plug s1-eth1 back to s1 FAILED")
+            result = main.FALSE
+        elif attachedSW == "00:00:00:00:00:00:00:01" and host_ip == '10.0.0.1':
+            main.log.report("Attempt to plug s1-eht1 back to s1 succeded.")
+            result = main.TRUE
+        else:
+            main.log.report( "FAIL to attach s1-eth1 to s1 correctly!")
+            result = main.FALSE
+
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="DEVICE DISCOVERY TEST PASSED PLUG/UNPLUG/MOVE TEST",onfail="DEVICE DISCOVERY TEST FAILED")
+
+
diff --git a/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.params_old b/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.params_old
new file mode 100644
index 0000000..2eea988
--- /dev/null
+++ b/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.params_old
@@ -0,0 +1,30 @@
+<PARAMS>
+    <testcases>1,2,21,21,3,4,5,6,7</testcases>
+    <FLOWDEF>~/flowdef_files/Center_Triangle/flowdef_20.txt</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>
+    <CTRL>
+        <ip1>10.128.100.1</ip1>
+        <port1>6633</port1>
+        <ip2>10.128.100.4</ip2>
+        <port2>6633</port2>
+        <ip3>10.128.100.5</ip3>
+        <port3>6633</port3>
+        <ip4>10.128.100.6</ip4>
+        <port4>6633</port4>
+    </CTRL>
+    <RestIP> 10.128.100.1 </RestIP>
+    <NR_Switches>25</NR_Switches>
+    <NR_Links>50</NR_Links>
+</PARAMS>      
diff --git a/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.pyc b/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.pyc
new file mode 100644
index 0000000..7219e21
--- /dev/null
+++ b/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.pyc
Binary files differ
diff --git a/TestON/tests/OnosSanity4nodes/__init__.pyc b/TestON/tests/OnosSanity4nodes/__init__.pyc
new file mode 100644
index 0000000..81ca0a2
--- /dev/null
+++ b/TestON/tests/OnosSanity4nodes/__init__.pyc
Binary files differ
diff --git a/TestON/tests/OnosSanity8nodes/OnosSanity8nodes.pyc b/TestON/tests/OnosSanity8nodes/OnosSanity8nodes.pyc
new file mode 100644
index 0000000..79b49b2
--- /dev/null
+++ b/TestON/tests/OnosSanity8nodes/OnosSanity8nodes.pyc
Binary files differ
diff --git a/TestON/tests/OnosSanity8nodes/__init__.pyc b/TestON/tests/OnosSanity8nodes/__init__.pyc
new file mode 100644
index 0000000..4a5710a
--- /dev/null
+++ b/TestON/tests/OnosSanity8nodes/__init__.pyc
Binary files differ
diff --git a/TestON/tests/OnosScale/OnosScale.pyc b/TestON/tests/OnosScale/OnosScale.pyc
new file mode 100644
index 0000000..19dfdf5
--- /dev/null
+++ b/TestON/tests/OnosScale/OnosScale.pyc
Binary files differ
diff --git a/TestON/tests/OnosScale/__init__.pyc b/TestON/tests/OnosScale/__init__.pyc
new file mode 100644
index 0000000..40dd87d
--- /dev/null
+++ b/TestON/tests/OnosScale/__init__.pyc
Binary files differ
diff --git a/TestON/tests/OnosScale/check_status.pyc b/TestON/tests/OnosScale/check_status.pyc
new file mode 100644
index 0000000..d8aa1f1
--- /dev/null
+++ b/TestON/tests/OnosScale/check_status.pyc
Binary files differ
diff --git a/TestON/tests/OnosScale4nodes/OnosScale4nodes.pyc b/TestON/tests/OnosScale4nodes/OnosScale4nodes.pyc
new file mode 100644
index 0000000..c640ca9
--- /dev/null
+++ b/TestON/tests/OnosScale4nodes/OnosScale4nodes.pyc
Binary files differ
diff --git a/TestON/tests/OnosScale4nodes/__init__.pyc b/TestON/tests/OnosScale4nodes/__init__.pyc
new file mode 100644
index 0000000..3d19c8b
--- /dev/null
+++ b/TestON/tests/OnosScale4nodes/__init__.pyc
Binary files differ
diff --git a/TestON/tests/OnosScale4nodes/check_status.pyc b/TestON/tests/OnosScale4nodes/check_status.pyc
new file mode 100644
index 0000000..d8aa1f1
--- /dev/null
+++ b/TestON/tests/OnosScale4nodes/check_status.pyc
Binary files differ
diff --git a/TestON/tests/OnosTest/OnosTest.pyc b/TestON/tests/OnosTest/OnosTest.pyc
new file mode 100644
index 0000000..4ea207b
--- /dev/null
+++ b/TestON/tests/OnosTest/OnosTest.pyc
Binary files differ
diff --git a/TestON/tests/OnosTest/__init__.pyc b/TestON/tests/OnosTest/__init__.pyc
new file mode 100644
index 0000000..63f5103
--- /dev/null
+++ b/TestON/tests/OnosTest/__init__.pyc
Binary files differ
diff --git a/TestON/tests/TimsDeathTest/TimsDeathTest.pyc b/TestON/tests/TimsDeathTest/TimsDeathTest.pyc
new file mode 100644
index 0000000..a731d92
--- /dev/null
+++ b/TestON/tests/TimsDeathTest/TimsDeathTest.pyc
Binary files differ
diff --git a/TestON/tests/TimsDeathTest/__init__.pyc b/TestON/tests/TimsDeathTest/__init__.pyc
new file mode 100644
index 0000000..b23656b
--- /dev/null
+++ b/TestON/tests/TimsDeathTest/__init__.pyc
Binary files differ
diff --git a/TestON/tests/__init__.pyc b/TestON/tests/__init__.pyc
new file mode 100644
index 0000000..275a7e0
--- /dev/null
+++ b/TestON/tests/__init__.pyc
Binary files differ
diff --git a/TestON/tests/testDD/.OnosSanity4nodes.py.swn b/TestON/tests/testDD/.OnosSanity4nodes.py.swn
new file mode 100644
index 0000000..cb578ac
--- /dev/null
+++ b/TestON/tests/testDD/.OnosSanity4nodes.py.swn
Binary files differ
diff --git a/TestON/tests/testDD/.OnosSanity4nodes.py.swo b/TestON/tests/testDD/.OnosSanity4nodes.py.swo
new file mode 100644
index 0000000..5389b47
--- /dev/null
+++ b/TestON/tests/testDD/.OnosSanity4nodes.py.swo
Binary files differ
diff --git a/TestON/tests/testDD/__init__.py b/TestON/tests/testDD/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/testDD/__init__.py
diff --git a/TestON/tests/testDD/__init__.pyc b/TestON/tests/testDD/__init__.pyc
new file mode 100644
index 0000000..16a9123
--- /dev/null
+++ b/TestON/tests/testDD/__init__.pyc
Binary files differ
diff --git a/TestON/tests/testDD/testDD.params b/TestON/tests/testDD/testDD.params
new file mode 100644
index 0000000..9a1732b
--- /dev/null
+++ b/TestON/tests/testDD/testDD.params
@@ -0,0 +1,48 @@
+<PARAMS>
+    <testcases>1,2,21</testcases>
+    <FLOWDEF>~/flowdef_files/Center_Triangle/flowdef_20.txt</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>
+    <YANK>
+        <hostname>h1</hostname>
+        <hostmac>00:00:00:00:00:01</hostmac>
+	<sw1>s1</sw1>
+        <sw6>s6</sw6>
+        <intf>s1-eth1</intf>
+    </YANK>
+    <PLUG>
+        <intf>s1-eth1</intf>
+	<sw6>s6</sw6>
+	<sw1>s1</sw1>
+    </PLUG>
+    <CTRL>
+        <ip1>10.128.100.1</ip1>
+        <port1>6633</port1>
+        <ip2>10.128.100.4</ip2>
+        <port2>6633</port2>
+        <ip3>10.128.100.5</ip3>
+        <port3>6633</port3>
+        <ip4>10.128.100.6</ip4>
+        <port4>6633</port4>
+    </CTRL>
+    <RestIP>10.128.100.1</RestIP>
+    <NR_Switches>25</NR_Switches>
+    <NR_Links>50</NR_Links>
+    <RESTCALL>
+	<restIP1>10.128.100.1</restIP1>
+	<restIP2>10.128.100.5</restIP2>
+	<restPort>8080</restPort>
+	<restURL>/wm/device/</restURL>
+    </RESTCALL>
+</PARAMS>      
diff --git a/TestON/tests/testDD/testDD.py b/TestON/tests/testDD/testDD.py
new file mode 100644
index 0000000..2a823f9
--- /dev/null
+++ b/TestON/tests/testDD/testDD.py
@@ -0,0 +1,472 @@
+
+class testDD :
+
+    def __init__(self) :
+        self.default = ''
+
+#**********************************************************************************************************************************************************************************************
+#Test startup
+#Tests the startup of Zookeeper1, Cassandra1, and ONOS1 to be certain that all started up successfully
+    def CASE1(self,main) :  #Check to be sure ZK, Cass, and ONOS are up, then get ONOS version
+        import time
+        main.log.report("Pulling latest code from github to all nodes")
+        main.ONOS1.git_pull()
+        main.ONOS2.git_pull()
+        main.ONOS3.git_pull()
+        main.ONOS4.git_pull()
+        main.Cassandra1.start()
+        main.Cassandra2.start()
+        main.Cassandra3.start()
+        main.Cassandra4.start()
+        time.sleep(20)
+        main.ONOS1.drop_keyspace()
+        main.ONOS1.start()
+        time.sleep(10)
+        main.ONOS2.start()
+        main.ONOS3.start()
+        main.ONOS4.start()
+        main.ONOS1.start_rest()
+        time.sleep(5)
+        test= main.ONOS1.rest_status()
+        if test == main.FALSE:
+            main.ONOS1.start_rest()
+        main.ONOS1.get_version()
+        main.log.report("Startup check Zookeeper1, Cassandra1, and ONOS1 connections")
+        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() 
+        if data == main.FALSE:
+            main.Cassandra1.stop()
+            main.Cassandra2.stop()
+            main.Cassandra3.stop()
+            main.Cassandra4.stop()
+
+            time.sleep(5)
+ 
+            main.Cassandra1.start()
+            main.Cassandra2.start()
+            main.Cassandra3.start()
+            main.Cassandra4.start()
+        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.report("Something is funny... restarting ONOS")
+            main.ONOS1.stop()
+            time.sleep(3)
+            main.ONOS1.start()
+            time.sleep(5) 
+            data = main.ONOS1.isup()
+        utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
+           
+#**********************************************************************************************************************************************************************************************
+#Assign Controllers
+#This test first checks the ip of a mininet host, to be certain that the mininet exists(Host is defined in Params as <CASE1><destination>).
+#Then the program assignes each ONOS instance a single controller to a switch(To be the initial master), then assigns all controllers.
+#NOTE: The reason why all four controllers are assigned although one was already assigned as the master is due to the 'ovs-vsctl set-controller' command erases all present controllers if
+#      the controllers already assigned to the switch are not specified.
+
+    def CASE2(self,main) :    #Make sure mininet exists, then assign controllers to switches
+        import time
+        main.log.report("Check if mininet started properly, then assign controllers ONOS 1,2,3 and 4")
+        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")
+        main.step("assigning ONOS controllers to switches")
+        for i in range(25): 
+            if i < 3:
+                j=i+1
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])
+                time.sleep(1)
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
+            elif i >= 3 and i < 5:
+                j=i+1
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip2'],port1=main.params['CTRL']['port2'])
+                time.sleep(1)
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
+            elif i >= 5 and i < 15:
+                j=i+1
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip3'],port1=main.params['CTRL']['port3'])
+                time.sleep(1)
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
+            else:
+                j=i+16
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip4'],port1=main.params['CTRL']['port4'])
+                time.sleep(1)
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
+        main.Mininet1.get_sw_controller("s1")       
+ 
+# **********************************************************************************************************************************************************************************************
+#Add Flows
+#Deletes any remnant flows from any previous test, add flows from the file labeled <FLOWDEF>, then runs the check flow test
+#NOTE: THE FLOWDEF FILE MUST BE PRESENT ON TESTON VM!!! TestON will copy the file from its home machine into /tmp/flowtmp on the machine the ONOS instance is present on
+
+    def CASE3(self,main) :    #Delete any remnant flows, then add flows, and time how long it takes flow tables to update
+        main.log.report("Delete any flows from previous tests, then add flows from FLOWDEF file, then wait for switch flow tables to update")
+        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")
+        tmp = main.FALSE
+        count = 1
+        main.log.info("Wait for flows to be pushed to the switches, then check")
+        while tmp == main.FALSE:
+            main.step("Waiting")
+            time.sleep(10)
+            main.step("Checking")
+            tmp = main.ONOS1.check_flow()
+            if tmp == main.FALSE and count < 6:
+                count = count + 1
+                main.log.report("Flow failed, waiting 10 seconds then making attempt number "+str(count))
+            elif tmp == main.FALSE and count == 6:
+                result1 = main.FALSE
+                break
+            else:
+                result1 = main.TRUE
+                break
+        endTime = time.time()
+        if result1 == main.TRUE:
+            main.log.report("\n\t\t\t\tTime to add flows: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tFlows failed check")
+        
+        strtTime = time.time()
+        count = 1
+        i = 6
+        while i < 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 < 3:
+                count = count + 1
+                i = 6
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 10 seconds")
+                time.sleep(10)
+            elif ping == main.FALSE and count ==3:
+                main.log.error("Ping test failed")
+                i = 17
+                result2 = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result2 = main.TRUE
+        endTime = time.time()
+        if result2 == main.TRUE:
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tPING TEST FAIL")
+
+        result3 = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+        main.step("Verifying the result")
+        utilities.assert_equals(expect=main.TRUE,actual=result1 and result2 and result3,onpass="Flow check PASS",onfail="Flow check FAIL")
+
+#**********************************************************************************************************************************************************************************************
+#This test case removes Controllers 2,3, and 4 then performs a ping test.
+#The assign controller is used because the ovs-vsctl module deletes all current controllers when a new controller is assigned.
+#The ping test performs single pings on hosts from opposite sides of the topology. If one ping fails, the test waits 5 seconds before trying again.
+#If the ping test fails 6 times, then the test case will return false
+
+    def CASE4(self,main) :
+        main.log.report("Remove ONOS 2,3,4 then ping until all hosts are reachable or fail after 6 attempts")
+        import time
+        for i in range(25):
+            if i < 15:
+                j=i+1
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])  #Assigning a single controller removes all other controllers
+            else:
+                j=i+16
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])
+      
+        strtTime = time.time() 
+        result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+        for i in range(2):
+            if result == main.FALSE:
+                time.sleep(5)
+                result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+            else:
+                break
+
+        count = 1
+        i = 6
+        while i < 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
+                i = 6
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 5 seconds")
+                time.sleep(5)
+            elif ping == main.FALSE and count ==6:
+                main.log.error("Ping test failed")
+                i = 17
+                result = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result = main.TRUE
+        endTime = time.time() 
+        if result == main.TRUE:
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tPING TEST FAIL")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
+
+# **********************************************************************************************************************************************************************************************
+#This test case restores the controllers removed by Case 4 then performs a ping test.
+
+    def CASE5(self,main) :
+        main.log.report("Restore ONOS 2,3,4 then ping until all hosts are reachable or fail after 6 attempts")
+        import time
+        for i in range(25):
+            if i < 15:
+                j=i+1
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
+            else:
+                j=i+16
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
+      
+        strtTime = time.time() 
+        result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+        for i in range(2):
+            if result == main.FALSE:
+                time.sleep(5)
+                result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+            else:
+                break
+
+        count = 1
+        i = 6
+        while i < 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
+                i = 6
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 5 seconds")
+                time.sleep(5)
+            elif ping == main.FALSE and count ==6:
+                main.log.error("Ping test failed")
+                i = 17
+                result = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result = main.TRUE
+        endTime = time.time()
+        if result == main.TRUE:
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tPING TEST FAILED")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
+
+# **********************************************************************************************************************************************************************************************
+#Brings a link that all flows pass through in the mininet down, then runs a ping test to view reroute time
+
+    def CASE6(self,main) :
+        main.log.report("Bring Link between s1 and s2 down, then ping until all hosts are reachable or fail after 10 attempts")
+        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...")
+       
+        strtTime = time.time() 
+        result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],str(int(main.params['NR_Links'])-2))
+        for i in range(2):
+            if result == main.FALSE:
+                time.sleep(5)
+                result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],str(int(main.params['NR_Links'])-2))
+            else:
+                break
+
+        count = 1
+        i = 6
+        while i < 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 < 10:
+                count = count + 1
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 5 seconds")
+                i = 6
+                time.sleep(5)
+            elif ping == main.FALSE and count == 10:
+                main.log.error("Ping test failed")
+                i = 17
+                result = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result = main.TRUE
+        endTime = time.time()
+        if result == main.TRUE:
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tPING TEST FAILED")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
+
+# **********************************************************************************************************************************************************************************************
+#Brings the link that Case 6 took down  back up, then runs a ping test to view reroute time
+
+    def CASE7(self,main) :
+        main.log.report("Bring Link between s1 and s2 up, then ping until all hosts are reachable or fail after 10 attempts")
+        import time
+        main.case("Bringing Link up... ")
+        result = main.Mininet1.link(END1=main.params['LINK']['begin'],END2=main.params['LINK']['end'],OPTION="up")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Link UP!",onfail="Link not brought up...")
+      
+        strtTime = time.time() 
+        result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+        for i in range(2):
+            if result == main.FALSE:
+                time.sleep(5)
+                result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+            else:
+                break
+
+        strtTime = time.time()
+        count = 1
+        i = 6
+        while i < 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 < 10:
+                count = count + 1
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 5 seconds")
+                i = 6
+                time.sleep(5)
+            elif ping == main.FALSE and count ==10:
+                main.log.error("Ping test failed")
+                i = 17
+                result = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result = main.TRUE
+        endTime = time.time()
+        if result == main.TRUE:
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tPING TESTS FAILED")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
+
+
+# ******************************************************************************************************************************************************************
+# Test Device Discovery function by yanking s6:s6-eth0 interface and re-plug it into a switch
+
+    def CASE21(self,main) :
+        import json
+        from drivers.common.api.onosrestapidriver import *
+        main.log.report("Test device discovery function, by attach/detach/move host h1 from s1->s6->s1.")
+        main.log.report("Check initially hostMAC exist on the mininet...")
+        host = main.params['YANK']['hostname']
+        mac = main.params['YANK']['hostmac']
+        RestIP1 = main.params['RESTCALL']['restIP1']
+        RestIP2 = main.params['RESTCALL']['restIP2']
+        RestPort = main.params['RESTCALL']['restPort']
+        url = main.params['RESTCALL']['restURL']
+        #print "host=" + host + ";  RestIP=" + RestIP1 + ";  RestPort=" + str(RestPort)
+        
+        main.log.info("\n\t\t\t\t ping issue one ping from" + str(host) + "to generate arp to switch. Ping result is not important" )
+        ping = main.Mininet1.pingHost(src = str(host),target = "10.0.0.254")
+        restcall = OnosRestApiDriver()
+        Reststatus, Hoststatus = restcall.find_host(RestIP1,RestPort,url,mac)
+        try:
+            attachedSW = Hoststatus[0]['attachmentPoint'][0]['switchDPID']
+            ip_found = Hoststatus[0]['ipv4'][0]
+        except:
+            Reststatus = 0
+
+        if Reststatus == 1:
+            main.log.report("\tFound host " + host + " attached to switchDPID = " + attachedSW)
+            if ip_found != None:
+                main.log.report("/t IP discovered is ip_found ( " + ip_found + " ).")
+                result = main.TRUE
+            else:
+                main.log.report("/t Found host attached to switch, but no IP address discovered.")
+                result = main.FALSE
+        else:
+            main.log.report("\t Host " + host + " with MAC:" + str(mac) + " does not exist. FAILED")
+            result = main.FALSE
+
+        ##### Step to yank out "s1-eth1" from s1, which is on autoONOS1 #####
+
+        main.log.report("Yank out s1-eth1")
+        main.case("Yankout s6-eth1 (link to h1) from s1")
+        result = main.Mininet1.yank(SW=main.params['YANK']['sw1'],INTF=main.params['YANK']['intf'])
+        time.sleep(3)
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Yank command suceeded",onfail="Yank command failed...")
+        ping = main.Mininet1.pingHost(src = str(host),target = "10.0.0.254")
+        Reststatus, Hoststatus = restcall.find_host(RestIP1,RestPort,url,mac)
+        try:
+            attachedSW = Hoststatus[0]['attachmentPoint'][0]['switchDPID']
+        except:
+            Reststatus = 0
+        if Reststatus == 0:
+            main.log.report("Attempt to yank out s1-eth1 from s1 sucessfully")
+            result = main.TRUE
+        else:
+            main.log.report("Attempt to yank out s1-eht1 from s1 failed.")
+            result = main.FALSE
+        
+        ##### Step to plug "s1-eth1" to s6, which is on autoONOS3  ######
+        main.log.report("Plug s1-eth1 into s6")
+        main.case("Plug s1-eth1 to s6")
+        result = main.Mininet1.plug(SW=main.params['PLUG']['sw6'],INTF=main.params['PLUG']['intf'])
+        time.sleep(3)
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Plug command suceeded",onfail="Plug command failed...")
+        ping = main.Mininet1.pingHost(src = str(host),target = "10.0.0.254")
+        Reststatus, Hoststatus = restcall.find_host(RestIP2,RestPort,url,mac)
+        try:
+            attachedSW = Hoststatus[0]['attachmentPoint'][0]['switchDPID']
+            ip_found = Hoststatus[0]['ipv4'][0]
+        except:
+            Reststatus = 0
+        if Reststatus == 0:
+            main.log.report("Attempt to plug s1-eth1 to s6 FAILED")
+            result = main.FALSE
+        elif attachedSW == "00:00:00:00:00:00:00:06":
+            main.log.report("Attempt to plug s1-eht1 to s6 succeded.")
+            if ip_found != None:
+                main.log.report("/t IP discovered is ip_found ( " + ip_found + " ).")
+                result = main.TRUE
+            else:
+                main.log.report("/t Found host attached to switch, but no IP address discovered.")
+                result = main.FALSE
+        else:
+            main.log.report( "FAILED to attach s1-eth1 to s6 correctly!")
+            result = main.FALSE
+
+        ###### Step to put interface "s1-eth1" back to s1"#####
+        main.log.report("Move s1-eth1 back on to s1")
+        main.case("Move s1-eth1 back to s1")
+        result = main.Mininet1.yank(SW=main.params['YANK']['sw6'],INTF=main.params['YANK']['intf'])
+        time.sleep(3)
+        retult = main.Mininet1.plug(SW=main.params['PLUG']['sw1'],INTF=main.params['PLUG']['intf'])
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Yank/Plug command suceeded",onfail="Yank/Plug command failed...")
+        ping = main.Mininet1.pingHost(src = str(host),target = "10.0.0.254")
+        Reststatus, Hoststatus = restcall.find_host(RestIP1,RestPort,url,mac)
+        try:
+            attachedSW = Hoststatus[0]['attachmentPoint'][0]['switchDPID']
+            ip_found = Hoststatus[0]['ipv4'][0]
+        except:
+            Reststatus = 0
+        if Reststatus == 0:
+            main.log.report("Attempt to plug s1-eth1 back to s1 FAILED")
+            result = main.FALSE
+        elif attachedSW == "00:00:00:00:00:00:00:01":
+            main.log.report("Attempt to plug s1-eht1 back to s1 succeded.")
+            if ip_found != None:
+                main.log.report("/t IP discovered is ip_found ( " + ip_found + " ).")
+                result = main.TRUE
+            else:
+                main.log.report("/t Found host attached to switch, but no IP address discovered.")
+                result = main.FALSE
+        else:
+            main.log.report( "FAIL to attach s1-eth1 to s1 correctly!")
+            result = main.FALSE
+
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="DEVICE DISCOVERY TEST PASSED PLUG/UNPLUG/MOVE TEST",onfail="DEVICE DISCOVERY TEST FAILED")
+
+
diff --git a/TestON/tests/testDD/testDD.pyc b/TestON/tests/testDD/testDD.pyc
new file mode 100644
index 0000000..973430e
--- /dev/null
+++ b/TestON/tests/testDD/testDD.pyc
Binary files differ
diff --git a/TestON/tests/testDD/testDD.topo b/TestON/tests/testDD/testDD.topo
new file mode 100644
index 0000000..0c77a3b
--- /dev/null
+++ b/TestON/tests/testDD/testDD.topo
@@ -0,0 +1,139 @@
+<TOPOLOGY>
+
+    <COMPONENT>
+        <Zookeeper1>
+            <host>10.128.100.1</host>
+            <user>admin</user>
+            <password></password>
+            <type>ZookeeperCliDriver</type>
+            <connect_order>1</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </Zookeeper1>
+
+        <Zookeeper2>
+            <host>10.128.100.4</host>
+            <user>admin</user>
+            <password></password>
+            <type>ZookeeperCliDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </Zookeeper2>
+
+        <Zookeeper3>
+            <host>10.128.100.5</host>
+            <user>admin</user>
+            <password></password>
+            <type>ZookeeperCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </Zookeeper3>
+       
+        <Zookeeper4>
+            <host>10.128.100.6</host>
+            <user>admin</user>
+            <password></password>
+            <type>ZookeeperCliDriver</type>
+            <connect_order>4</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </Zookeeper4>
+
+        <Cassandra1>
+            <host>10.128.100.1</host>
+            <user>admin</user>
+            <password></password>
+            <type>CassandraCliDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </Cassandra1>
+
+        <Cassandra2>
+            <host>10.128.100.4</host>
+            <user>admin</user>
+            <password></password>
+            <type>CassandraCliDriver</type>
+            <connect_order>6</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </Cassandra2>
+       
+        <Cassandra3>
+            <host>10.128.100.5</host>
+            <user>admin</user>
+            <password></password>
+            <type>CassandraCliDriver</type>
+            <connect_order>7</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </Cassandra3>
+       
+        <Cassandra4>
+            <host>10.128.100.6</host>
+            <user>admin</user>
+            <password></password>
+            <type>CassandraCliDriver</type>
+            <connect_order>8</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </Cassandra4>
+
+        <ONOS1>
+            <host>10.128.100.1</host>
+            <user>admin</user>
+            <password></password>
+            <type>OnosCliDriver</type>
+            <connect_order>9</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </ONOS1>
+
+        <ONOS2>
+            <host>10.128.100.4</host>
+            <user>admin</user>
+            <password></password>
+            <type>OnosCliDriver</type>
+            <connect_order>10</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </ONOS2>
+
+        <ONOS3>
+            <host>10.128.100.5</host>
+            <user>admin</user>
+            <password></password>
+            <type>OnosCliDriver</type>
+            <connect_order>11</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </ONOS3>
+       
+        <ONOS4>
+            <host>10.128.100.6</host>
+            <user>admin</user>
+            <password></password>
+            <type>OnosCliDriver</type>
+            <connect_order>12</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </ONOS4>
+
+        <Mininet1>
+            <host>10.128.100.11</host>
+            <user>admin</user>
+            <password></password>
+            <type>MininetCliDriver</type>
+            <connect_order>13</connect_order>
+            <COMPONENTS>
+                # Specify the Option for mininet
+                <arg1> --custom ~/mininet/custom/topo-onos4node.py </arg1>
+                <arg2> --topo mytopo</arg2>
+                <controller> remote </controller>
+             </COMPONENTS>
+        </Mininet1>
+
+    </COMPONENT>
+</TOPOLOGY>
