Driver fixes, Device device discovery in Sanity, two case additions to Perf
diff --git a/.gitignore b/.gitignore
index c9b568f..1377554 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1 @@
-*.pyc
 *.swp
diff --git a/README b/README
index e0cbcaa..5a51c60 100644
--- a/README
+++ b/README
@@ -1 +1,3 @@
 This is the Test Repo. 
+
+Some of the TestON assume the TestON folder is in home, Just create a soft link to the TestON folder from home to get around the issue. 
diff --git a/TestON/.gitignore b/TestON/.gitignore
deleted file mode 100644
index a25817a..0000000
--- a/TestON/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.pyc
-logs/*
diff --git a/TestON/config/teston.cfg b/TestON/config/teston.cfg
index ccec9ea..a015666 100644
--- a/TestON/config/teston.cfg
+++ b/TestON/config/teston.cfg
@@ -1,18 +1,18 @@
 <config>
 
     <parser> 
-        <file>/home/paxterra/Documents/AptanaWorkspace/TestON/core/xmlparser.py </file>
+        <file>/home/admin/TestON/core/xmlparser.py </file>
         <class>xmlparser</class>
     </parser>
     <mail_to></mail_to>
 
     <logger> 
-        <file>/home/paxterra/Documents/AptanaWorkspace/TestON/core/logger.py </file>
+        <file>/home/admin/TestON/core/logger.py </file>
         <class>Logger</class>
     </logger>
     
     <responseparser>
-        <file>/home/paxterra/Documents/AptanaWorkspace/TestON/core/jsonparser.py </file>
+        <file>/home/admin/TestON/core/jsonparser.py </file>
         <class>JsonParser</class>
     </responseparser>
 </config>
diff --git a/TestON/core/teston.py b/TestON/core/teston.py
index 5dd656a..869cab7 100644
--- a/TestON/core/teston.py
+++ b/TestON/core/teston.py
@@ -25,6 +25,7 @@
 '''
 
 import sys
+import pprint
 import getpass
 import os
 import re
@@ -67,7 +68,7 @@
         '''
         # Initialization of the variables.
         __builtin__.main = self
-        
+        pprint.pprint(sys.path)  
         __builtin__.path = path
         __builtin__.utilities = Utilities()
         self.TRUE = 1
@@ -607,6 +608,7 @@
         main.exit()
               
     try :
+        print main.classPath
         testModule = __import__(main.classPath, globals(), locals(), [main.TEST], -1)
     except(ImportError):
         print "There is no test like "+main.TEST
diff --git a/TestON/drivers/common/api/onosrestapidriver.py b/TestON/drivers/common/api/onosrestapidriver.py
index 31a8930..fd00bb4 100644
--- a/TestON/drivers/common/api/onosrestapidriver.py
+++ b/TestON/drivers/common/api/onosrestapidriver.py
@@ -29,6 +29,7 @@
 import re
 import sys
 import time 
+import json
 
 sys.path.append("../")
 from drivers.common.apidriver import API
@@ -92,6 +93,26 @@
         '''
         return response  
     
-    
-   
-    
+    def find_host(self,RestIP,RestPort,RestAPI,hostMAC):
+	retcode = 0
+	url ="http://%s:%s%s" %(RestIP,RestPort,RestAPI)
+		
+	try:
+	    command = "curl -s %s" % (url)
+	    result = os.popen(command).read()
+	    parsedResult = json.loads(result)
+            print parsedResult
+	except:
+	    print "REST IF %s has issue" % command
+	    parsedResult = ""  
+	if type(parsedResult) == 'dict' and parsedResult.has_key('code'):
+	    print "REST %s returned code %s" % (command, parsedResult['code'])
+	    parsedResult = ""
+
+    	if parsedResult == "":
+	    return (retcode, "Rest API has an error")	
+	else:
+	    found = [item for item in parsedResult if item['mac'] == [str(hostMAC)]]
+            retcode = 1
+	    return (retcode, found)
+
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 4e60f46..97c5db3 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -131,7 +131,7 @@
         *requires fping to be installed on machine running mininet 
         ''' 
         args = utilities.parse_args(["SRC","TARGET"],**pingParams)
-        command = args["SRC"] + " fping -i 100 -t 10 -C 1 -q "+args["TARGET"]
+        command = args["SRC"] + " fping -i 100 -t 20 -C 1 -q "+args["TARGET"]
         self.handle.sendline(command) 
         self.handle.expect(args["TARGET"]) 
         self.handle.expect("mininet")
@@ -139,7 +139,7 @@
         if re.search(":\s-" ,response):
             main.log.info("Ping fail") 
             return main.FALSE
-        elif re.search(":\s\d\.\d\d", response):
+        elif re.search(":\s\d{1,2}\.\d\d", response):
             main.log.info("Ping good!")
             return main.TRUE
         main.log.info("Install fping on mininet machine... ") 
@@ -150,7 +150,7 @@
         
         args = utilities.parse_args(["SRC","TARGET"],**pingParams)
         #command = args["SRC"] + " ping -" + args["CONTROLLER"] + " " +args ["TARGET"]
-        command = args["SRC"] + " ping "+args ["TARGET"]+" -c 2 -i .2"
+        command = args["SRC"] + " ping "+args ["TARGET"]+" -c 1 -i .2"
         response = self.execute(cmd=command,prompt="mininet",timeout=10 )
         if utilities.assert_matches(expect=',\s0\%\spacket\sloss',actual=response,onpass="No Packet loss",onfail="Host is not reachable"):
             main.log.info("NO PACKET LOSS, HOST IS REACHABLE")
@@ -276,12 +276,12 @@
         return main.TRUE
         
 
-    def yank(self, **yangargs):
+    def yank(self,**yankargs):
 	'''
-	yank out a mininet switch interfacet to host
+	yank a mininet switch interface to a host
 	'''
-	main.log.info('Yang out the switch interface attached to a host')
-	args = utilities.parse_args(["SW","INTF"])
+	main.log.info('Yank the switch interface attached to a host')
+	args = utilities.parse_args(["SW","INTF"],**yankargs)
 	sw = args["SW"] if args["SW"] !=None else ""
 	intf = args["INTF"] if args["INTF"] != None else ""
 	command = "py "+ str(sw) + '.detach("' + str(intf) + '")'
@@ -293,7 +293,7 @@
         plug the yanked mininet switch interface to a switch
         '''
         main.log.info('Plug the switch interface attached to a switch')
-        args = utilities.parse_args(["SW","INTF"])
+        args = utilities.parse_args(["SW","INTF"],**plugargs)
         sw = args["SW"] if args["SW"] !=None else ""
         intf = args["INTF"] if args["INTF"] != None else ""
         command = "py "+ str(sw) + '.attach("' + str(intf) + '")'
@@ -349,6 +349,8 @@
         port6 = args["PORT6"] if args["PORT6"] != None else ""
         port7 = args["PORT7"] if args["PORT7"] != None else ""
         port8 = args["PORT8"] if args["PORT8"] != None else ""
+        ptcpA = int(args["PORT1"])+int(sw) if args["PORT1"] != None else ""
+        ptcpB = "ptcp:"+str(ptcpA) if ip1 != "" else ""
         tcp1 = "tcp:"+str(ip1)+":"+str(port1) if ip1 != "" else ""
         tcp2 = "tcp:"+str(ip2)+":"+str(port2) if ip2 != "" else ""
         tcp3 = "tcp:"+str(ip3)+":"+str(port3) if ip3 != "" else ""
@@ -361,7 +363,7 @@
        # master2 = tcp2+" role master " if args["MASTER"] == 2 else ""
        # master3 = tcp3+" role master " if args["MASTER"] == 3 else ""
        # master4 = tcp4+" role master " if args["MASTER"] == 4 else ""
-        command = "sh ovs-vsctl set-controller "+str(sw)+" "+tcp1+" "+tcp2+" "+tcp3+" "+tcp4+" "+tcp5+" "+tcp6+" "+tcp7+" "+tcp8
+        command = "sh ovs-vsctl set-controller s"+str(sw)+" "+ptcpB+" "+tcp1+" "+tcp2+" "+tcp3+" "+tcp4+" "+tcp5+" "+tcp6+" "+tcp7+" "+tcp8
         self.execute(cmd=command,prompt="mininet>",timeout=5)
 
     def disconnect(self):
diff --git a/TestON/drivers/common/cli/emulator/remotemininetdriver.py b/TestON/drivers/common/cli/emulator/remotemininetdriver.py
index 5452dbe..5668182 100644
--- a/TestON/drivers/common/cli/emulator/remotemininetdriver.py
+++ b/TestON/drivers/common/cli/emulator/remotemininetdriver.py
@@ -72,7 +72,9 @@
         Starts a continuous ping on the mininet host outputing to a file in the /tmp dir. 
         '''
         args = utilities.parse_args(["SRC","TARGET"],**pingParams)
-        command = "mininet/util/m " + args["SRC"] + " ping "+args ["TARGET"]+" -i .1 -D -W 1 > /tmp/ping." + args["SRC"] + " &"
+        precmd = "rm /tmp/ping." + args["SRC"]
+        self.execute(cmd=precmd,prompt="(.*)",timeout=10)
+        command = "mininet/util/m " + args["SRC"] + " ping "+args ["TARGET"]+" -i 1 -W 1 > /tmp/ping." + args["SRC"] + " &"
         main.log.info( command ) 
         self.execute(cmd=command,prompt="(.*)",timeout=10)
         return main.TRUE
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index 41505f2..3b9e86b 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -59,14 +59,12 @@
         '''
         self.handle.sendline("")
         self.handle.expect("\$")
-        self.handle.sendline("cd ~/ONOS")
-        self.handle.expect("ONOS\$")
-        self.handle.sendline("./start-onos.sh start")
+        self.handle.sendline("~/ONOS/start-onos.sh start")
         self.handle.expect("onos.sh start")
         i=self.handle.expect(["Starting\sONOS\scontroller","Cassandra\sis\snot\srunning"])
         if i==0:
             try: 
-                self.handle.expect("ONOS\$", timeout=60)
+                self.handle.expect("\$", timeout=60)
                 main.log.info("ONOS Started ") 
             except:  
                 main.log.info("ONOS NOT Started, stuck while waiting for it to start ") 
@@ -111,8 +109,7 @@
         '''
         Starts the rest server on ONOS.
         '''
-        self.execute(cmd="cd ONOS",prompt="ONOS\$",timeout=10)
-        response = self.execute(cmd="start-rest.sh start",prompt="\$",timeout=10)
+        response = self.execute(cmd="~/ONOS/start-rest.sh start",prompt="\$",timeout=10)
         if re.search("admin",response):
             main.log.info("Rest Server Started Successfully")
             time.sleep(5)
@@ -190,12 +187,10 @@
         '''
         self.handle.sendline("")
         self.handle.expect("\$")
-        self.handle.sendline("cd ~/ONOS")
-        self.handle.expect("ONOS\$")
-        self.handle.sendline("./start-onos.sh stop")
+        self.handle.sendline("~/ONOS/start-onos.sh stop")
         self.handle.expect("stop", 2)
         result = self.handle.before 
-        self.handle.expect("ONOS\$", 60)
+        self.handle.expect("\$", 60)
         if re.search("Killed", result):
             main.log.info("ONOS Killed Successfully")
             return main.TRUE
@@ -507,7 +502,7 @@
         '''
         Used by CassndraCheck.py to scan ONOS logs for Exceptions
         '''
-        self.handle.sendline(r"dsh 'grep Exception ~/ONOS/onos-logs/onos.*.log'")
+        self.handle.sendline("dsh 'grep Exception ~/ONOS/onos-logs/onos.*.log'")
         self.handle.expect("\$ dsh") 
         self.handle.expect("\$")
         output = self.handle.before
@@ -527,7 +522,8 @@
         self.handle.sendline("cd ~/ONOS") 
         self.handle.expect("ONOS\$")
         self.handle.sendline("git pull")
-        
+       
+        uptodate = 0 
         i=self.handle.expect(['fatal','Username\sfor\s(.*):\s','Unpacking\sobjects',pexpect.TIMEOUT,'Already up-to-date','Aborting'],timeout=180)
         if i==0:
             main.log.error("Git pull had some issue...") 
@@ -553,12 +549,13 @@
             main.log.error("TIMEOUT")
             return main.FALSE
         elif i==4:
-            main.log.info("Already up to date") 
+            main.log.info("Already up to date")
+            uptodate = 1 
         elif i==5:
             main.log.info("Aborting... Are there conflicting git files?")
             return main.FALSE
         
-        
+        '''        
         main.log.info("./setup-local-maven.sh")
         self.handle.sendline("./setup-local-maven.sh")
         self.handle.expect("local-maven.sh")
@@ -575,36 +572,37 @@
             elif i == 3:
                 main.log.error("TIMEOUT!")
                 return main.FALSE
- 
-        main.log.info("mvn clean") 
-        self.handle.sendline("mvn clean")
-        while 1: 
-            i=self.handle.expect(['BUILD\sFAILURE','BUILD\sSUCCESS','ONOS\$',pexpect.TIMEOUT],timeout=30)
-            if i == 0:
-                main.log.error("Build failure!")
-                return main.FALSE
-            elif i == 1:
-                main.log.info("Build success!")
-            elif i == 2:
-                main.log.info("Build complete") 
-                break;
-            elif i == 3:
-                main.log.error("TIMEOUT!")
-                return main.FALSE
+        '''      
+        if uptodate == 0:
+            main.log.info("mvn clean") 
+            self.handle.sendline("mvn clean")
+            while 1: 
+                i=self.handle.expect(['BUILD\sFAILURE','BUILD\sSUCCESS','ONOS\$',pexpect.TIMEOUT],timeout=30)
+                if i == 0:
+                    main.log.error("Build failure!")
+                    return main.FALSE
+                elif i == 1:
+                    main.log.info("Build success!")
+                elif i == 2:
+                    main.log.info("Build complete") 
+                    break;
+                elif i == 3:
+                    main.log.error("TIMEOUT!")
+                    return main.FALSE
         
-        main.log.info("mvn compile") 
-        self.handle.sendline("mvn compile")
-        while 1: 
-            i=self.handle.expect(['BUILD\sFAILURE','BUILD\sSUCCESS','ONOS\$',pexpect.TIMEOUT],timeout=30)
-            if i == 0:
-                main.log.error("Build failure!")
-                return main.FALSE
-            elif i == 1:
-                main.log.info("Build success!")
-            elif i == 2:
-                main.log.info("Build complete") 
-                break;
-            elif i == 3:
-                main.log.error("TIMEOUT!")
-                return main.FALSE
+            main.log.info("mvn compile") 
+            self.handle.sendline("mvn compile")
+            while 1: 
+                i=self.handle.expect(['BUILD\sFAILURE','BUILD\sSUCCESS','ONOS\$',pexpect.TIMEOUT],timeout=30)
+                if i == 0:
+                    main.log.error("Build failure!")
+                    return main.FALSE
+                elif i == 1:
+                    main.log.info("Build success!")
+                elif i == 2:
+                    main.log.info("Build complete") 
+                    break;
+                elif i == 3:
+                    main.log.error("TIMEOUT!")
+                    return main.FALSE
         
diff --git a/TestON/tests/MininetTest/MininetTest.py b/TestON/tests/MininetTest/MininetTest.py
index 28850a4..72fab6e 100644
--- a/TestON/tests/MininetTest/MininetTest.py
+++ b/TestON/tests/MininetTest/MininetTest.py
@@ -8,6 +8,7 @@
 
         main.case("Testing the configuration of the host")
         main.step("Host IP Checking using checkIP")
+        main.ONOS1.start()
         result = main.Mininet1.checkIP(main.params['CASE1']['destination'])
         main.step("Verifying the result")
         utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured")
diff --git a/TestON/tests/MininetTest/MininetTest.topo b/TestON/tests/MininetTest/MininetTest.topo
index 645a8cb..1515f57 100644
--- a/TestON/tests/MininetTest/MininetTest.topo
+++ b/TestON/tests/MininetTest/MininetTest.topo
@@ -1,8 +1,72 @@
 <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.7.7</host>
+            <host>10.128.100.11</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>MininetCliDriver</type>
diff --git a/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.params b/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.params
index e9ddee1..fae2aed 100644
--- a/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.params
+++ b/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.params
@@ -1,5 +1,5 @@
 <PARAMS>
-    <testcases>1,2,3,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7</testcases>
+    <testcases>1,2,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7,3,4,5,6,7 </testcases>
     <FLOWDEF>~/flowdef_files/Center_Triangle/flowdef_20.txt</FLOWDEF>
     <CASE1>       
         <destination>h6</destination>
@@ -15,7 +15,7 @@
         <end>s2</end>
     </LINK>
     <CTRL>
-        <ip1>10.128.100.3</ip1>
+        <ip1>10.128.100.1</ip1>
         <port1>6633</port1>
         <ip2>10.128.100.4</ip2>
         <port2>6633</port2>
@@ -24,4 +24,7 @@
         <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/OnosCHO4nodes/OnosCHO4nodes.py b/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.py
index 13c8905..75f3d5f 100644
--- a/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.py
+++ b/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.py
@@ -8,14 +8,43 @@
 #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
-        main.log.report("Startup check Zookeeper1, Cassandra1, and ONOS1 connections")
         import time
-        main.case("Checking if the startup was clean...") 
+        main.log.report("Pulling latest code from github to all nodes")
+        main.ONOS1.stop()
+        main.ONOS2.stop()
+        main.ONOS3.stop()
+        main.ONOS4.stop()
+        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()
@@ -26,9 +55,6 @@
             main.ONOS1.start()
             time.sleep(5) 
             data = main.ONOS1.isup()
-        main.log.report("\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...")
            
 #**********************************************************************************************************************************************************************************************
@@ -50,28 +76,24 @@
         for i in range(25): 
             if i < 3:
                 j=i+1
-                main.Mininet1.assign_sw_controller(sw="s"+str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])
-                time.sleep(3)
-                main.Mininet1.assign_sw_controller(sw="s"+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'])
-                time.sleep(3)
+                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="s"+str(j),ip1=main.params['CTRL']['ip2'],port1=main.params['CTRL']['port2'])
-                time.sleep(3)
-                main.Mininet1.assign_sw_controller(sw="s"+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'])
-                time.sleep(3)
+                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="s"+str(j),ip1=main.params['CTRL']['ip3'],port1=main.params['CTRL']['port3'])
-                time.sleep(3)
-                main.Mininet1.assign_sw_controller(sw="s"+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'])
-                time.sleep(3)
+                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="s"+str(j),ip1=main.params['CTRL']['ip4'],port1=main.params['CTRL']['port4'])
-                time.sleep(3)
-                main.Mininet1.assign_sw_controller(sw="s"+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'])
-                time.sleep(3)
+                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")       
  
 # **********************************************************************************************************************************************************************************************
@@ -101,22 +123,49 @@
                 count = count + 1
                 main.log.report("Flow failed, waiting 10 seconds then making attempt number "+str(count))
             elif tmp == main.FALSE and count == 6:
-                result = main.FALSE
+                result1 = main.FALSE
                 break
             else:
-                result = main.TRUE
+                result1 = main.TRUE
                 break
         endTime = time.time()
-        if result == main.TRUE:
+        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")
-        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Flow check PASS",onfail="Flow check FAIL")
+        
+        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 10 seconds before trying again.
+#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) :
@@ -125,12 +174,19 @@
         for i in range(25):
             if i < 15:
                 j=i+1
-                main.Mininet1.assign_sw_controller(sw="s"+str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])  #Assigning a single controller removes all other controllers
-                time.sleep(3)
+                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="s"+str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])
-                time.sleep(3)
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])
+       
+        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
@@ -140,8 +196,8 @@
             if ping == main.FALSE and count < 6:
                 count = count + 1
                 i = 6
-                main.log.info("Ping failed, making attempt number "+str(count)+" in 15 seconds")
-                time.sleep(15)
+                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
@@ -165,12 +221,19 @@
         for i in range(25):
             if i < 15:
                 j=i+1
-                main.Mininet1.assign_sw_controller(sw="s"+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'])
-                time.sleep(3)
+                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="s"+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'])
-                time.sleep(3)
+                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'])
+       
+        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
@@ -180,8 +243,8 @@
             if ping == main.FALSE and count < 6:
                 count = count + 1
                 i = 6
-                main.log.info("Ping failed, making attempt number "+str(count)+" in 15 seconds")
-                time.sleep(15)
+                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
@@ -200,12 +263,21 @@
 #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 6 attempts")
+        main.log.report("Bring Link between s1 and s2 down, wait 15 seconds, then ping until all hosts are reachable or fail after 6 attempts")
         import time
         main.case("Bringing Link down... ")
         result = main.Mininet1.link(END1=main.params['LINK']['begin'],END2=main.params['LINK']['end'],OPTION="down")
-        time.sleep(3)
+        time.sleep(15)
         utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Link DOWN!",onfail="Link not brought down...")
+        
+        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
+
         strtTime = time.time()
         count = 1
         i = 6
@@ -214,9 +286,9 @@
             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 15 seconds")
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 5 seconds")
                 i = 6
-                time.sleep(15)
+                time.sleep(5)
             elif ping == main.FALSE and count ==6:
                 main.log.error("Ping test failed")
                 i = 17
@@ -235,12 +307,21 @@
 #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 6 attempts")
+        main.log.report("Bring Link between s1 and s2 up, wait 15 seconds, then ping until all hosts are reachable or fail after 6 attempts")
         import time
-        main.case("Bringing Link back up... ")
-        result = main.Mininet1.link(END1=main.params['LINK']['begin'],END2=main.params['LINK']['end'],OPTION="down")
-        time.sleep(3)
-        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Link DOWN!",onfail="Link not brought down...")
+        main.case("Bringing Link up... ")
+        result = main.Mininet1.link(END1=main.params['LINK']['begin'],END2=main.params['LINK']['end'],OPTION="up")
+        time.sleep(15)
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Link UP!",onfail="Link not brought up...")
+       
+        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
@@ -249,9 +330,9 @@
             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 15 seconds")
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 5 seconds")
                 i = 6
-                time.sleep(15)
+                time.sleep(5)
             elif ping == main.FALSE and count ==6:
                 main.log.error("Ping test failed")
                 i = 17
@@ -266,3 +347,103 @@
             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']
+        except IndexError:
+            Reststatus = 0
+        if Reststatus == 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']
+        except IndexError:
+            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.")
+            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']
+        except IndexError:
+            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.")
+            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/OnosCHO4nodes/OnosCHO4nodes.topo b/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.topo
index 5e72388..48fc2a7 100644
--- a/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.topo
+++ b/TestON/tests/OnosCHO4nodes/OnosCHO4nodes.topo
@@ -2,7 +2,7 @@
 
     <COMPONENT>
         <Zookeeper1>
-            <host>10.128.100.3</host>
+            <host>10.128.100.1</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>ZookeeperCliDriver</type>
@@ -42,7 +42,7 @@
         </Zookeeper4>
 
         <Cassandra1>
-            <host>10.128.100.3</host>
+            <host>10.128.100.1</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>CassandraCliDriver</type>
@@ -82,7 +82,7 @@
         </Cassandra4>
 
         <ONOS1>
-            <host>10.128.100.3</host>
+            <host>10.128.100.1</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>OnosCliDriver</type>
@@ -122,14 +122,14 @@
         </ONOS4>
 
         <Mininet1>
-            <host>10.128.100.3</host>
+            <host>10.128.100.11</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>MininetCliDriver</type>
             <connect_order>13</connect_order>
             <COMPONENTS>
                 # Specify the Option for mininet
-                <arg1> --custom ~/mininet/custom/topo-2sw-2host.py </arg1>
+                <arg1> --custom ~/mininet/custom/topo-onos4node.py </arg1>
                 <arg2> --topo mytopo</arg2>
                 <controller> remote </controller>
              </COMPONENTS>
diff --git a/TestON/tests/OnosDD_PARP/.OnosSanity.topo.swp b/TestON/tests/OnosDD_PARP/.OnosSanity.topo.swp
deleted file mode 100644
index c2a0aff..0000000
--- a/TestON/tests/OnosDD_PARP/.OnosSanity.topo.swp
+++ /dev/null
Binary files differ
diff --git a/TestON/tests/OnosDD_PARP/.OnosSanity4nodes.topo.swp b/TestON/tests/OnosDD_PARP/.OnosSanity4nodes.topo.swp
deleted file mode 100644
index 1500dc4..0000000
--- a/TestON/tests/OnosDD_PARP/.OnosSanity4nodes.topo.swp
+++ /dev/null
Binary files differ
diff --git a/TestON/tests/OnosDD_PARP/OnosDD_PARP.params b/TestON/tests/OnosDD_PARP/OnosDD_PARP.params
index 6fdbea5..03e9886 100644
--- a/TestON/tests/OnosDD_PARP/OnosDD_PARP.params
+++ b/TestON/tests/OnosDD_PARP/OnosDD_PARP.params
@@ -1,5 +1,5 @@
 <PARAMS>
-    <testcases>1,2,3,4,5,6,7</testcases>
+    <testcases>1,2,21,3</testcases>
     <FLOWDEF>~/flowdef_files/Center_Triangle/flowdef_20.txt</FLOWDEF>
     <CASE1>       
         <destination>h6</destination>
@@ -14,6 +14,18 @@
         <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>
@@ -24,4 +36,10 @@
         <ip4>10.128.100.6</ip4>
         <port4>6633</port4>
     </CTRL>
+    <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/OnosDD_PARP/OnosDD_PARP.py b/TestON/tests/OnosDD_PARP/OnosDD_PARP.py
index ef3b47a..01c1169 100644
--- a/TestON/tests/OnosDD_PARP/OnosDD_PARP.py
+++ b/TestON/tests/OnosDD_PARP/OnosDD_PARP.py
@@ -1,5 +1,5 @@
 
-class OnosSanity4nodes :
+class OnosDD_PARP :
 
     def __init__(self) :
         self.default = ''
@@ -60,27 +60,27 @@
         for i in range(25): 
             if i < 3:
                 j=i+1
-                main.Mininet1.assign_sw_controller(sw="s"+str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])
+                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="s"+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.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'])
                 time.sleep(1)
             elif i >= 3 and i < 5:
                 j=i+1
-                main.Mininet1.assign_sw_controller(sw="s"+str(j),ip1=main.params['CTRL']['ip2'],port1=main.params['CTRL']['port2'])
+                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="s"+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.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'])
                 time.sleep(1)
             elif i >= 5 and i < 15:
                 j=i+1
-                main.Mininet1.assign_sw_controller(sw="s"+str(j),ip1=main.params['CTRL']['ip3'],port1=main.params['CTRL']['port3'])
+                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="s"+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.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'])
                 time.sleep(1)
             else:
                 j=i+16
-                main.Mininet1.assign_sw_controller(sw="s"+str(j),ip1=main.params['CTRL']['ip4'],port1=main.params['CTRL']['port4'])
+                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="s"+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.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'])
                 time.sleep(1)
         main.Mininet1.get_sw_controller("s1")       
  
@@ -135,11 +135,11 @@
         for i in range(25):
             if i < 15:
                 j=i+1
-                main.Mininet1.assign_sw_controller(sw="s"+str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])  #Assigning a single controller removes all other controllers
+                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
                 time.sleep(1)
             else:
                 j=i+16
-                main.Mininet1.assign_sw_controller(sw="s"+str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])
                 time.sleep(1)
         strtTime = time.time()
         count = 1
@@ -175,11 +175,11 @@
         for i in range(25):
             if i < 15:
                 j=i+1
-                main.Mininet1.assign_sw_controller(sw="s"+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.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'])
                 time.sleep(1)
             else:
                 j=i+16
-                main.Mininet1.assign_sw_controller(sw="s"+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.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'])
                 time.sleep(1)
         strtTime = time.time()
         count = 1
@@ -276,3 +276,103 @@
             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']
+        except IndexError:
+            Reststatus = 0
+        if Reststatus == 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("Attemp to yank out s1-eth1 from s1 sucessfully")
+            result = main.TRUE
+        else:
+            main.log.report("Attemp 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']
+        except IndexError:
+            Reststatus = 0
+        if Reststatus == 0:
+            main.log.report("Attemp to plug s1-eth1 to s6 FAILED")
+            result = main.FALSE
+        elif attachedSW == "00:00:00:00:00:00:00:06":
+            main.log.report("Attemp 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']
+        except IndexError:
+            Reststatus = 0
+        if Reststatus == 0:
+            main.log.report("Attemp to plug s1-eth1 back to s1 FAILED")
+            result = main.FALSE
+        elif attachedSW == "00:00:00:00:00:00:00:01":
+            main.log.report("Attemp 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="DIVICE DISCOVERY TEST FAILED")
+
diff --git a/TestON/tests/OnosDD_PARP/OnosDD_PARP.topo b/TestON/tests/OnosDD_PARP/OnosDD_PARP.topo
index 9086c16..48fc2a7 100644
--- a/TestON/tests/OnosDD_PARP/OnosDD_PARP.topo
+++ b/TestON/tests/OnosDD_PARP/OnosDD_PARP.topo
@@ -122,14 +122,14 @@
         </ONOS4>
 
         <Mininet1>
-            <host>10.128.100.4</host>
+            <host>10.128.100.11</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>MininetCliDriver</type>
             <connect_order>13</connect_order>
             <COMPONENTS>
                 # Specify the Option for mininet
-                <arg1> --custom ~/mininet/custom/topo-2sw-2host.py </arg1>
+                <arg1> --custom ~/mininet/custom/topo-onos4node.py </arg1>
                 <arg2> --topo mytopo</arg2>
                 <controller> remote </controller>
              </COMPONENTS>
diff --git a/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.params b/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.params
index 90a751c..995ecda 100644
--- a/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.params
+++ b/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.params
@@ -1,6 +1,6 @@
 <PARAMS>
-    <testcases>1,2,3,4,5,6,7</testcases>
-    <Iterations>1</Iterations>
+    <testcases>1,2,3,4,5,6,7,8,9,10,11</testcases>
+    <Iterations>3</Iterations>
     <WaitTime>60</WaitTime>
     <RestIP>10.128.100.4</RestIP>
     <MN_size>57</MN_size>
@@ -8,13 +8,16 @@
     <NR_Switches>25</NR_Switches>
     <NR_Links>50</NR_Links>
     <FLOWDEF>~/flowdef_files/Center_Triangle/flowdef_20.txt</FLOWDEF>
-    <CASE1>       
-        <destination>h1</destination>
-    </CASE1>       
-    <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>
     <PING>
         <source1>h6</source1>
         <source2>h7</source2>
diff --git a/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.py b/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.py
index 8d65f35..f84b232 100644
--- a/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.py
+++ b/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.py
@@ -14,12 +14,28 @@
         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")
         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.ONOS1.drop_keyspace()
         time.sleep(5) 
@@ -41,6 +57,10 @@
         data = data & main.ONOS3.isup()
         data = data & main.ONOS4.isup()
         main.ONOS1.start_rest()
+        time.sleep(5)
+        test= main.ONOS1.rest_status()
+        if test == main.FALSE:
+            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 ...")
@@ -54,19 +74,67 @@
         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...")
+        #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
@@ -86,14 +154,39 @@
             result = main.ONOS1.check_flow()
             if result == main.TRUE: 
                 t2 = time.time()
-                main.log.info( 'Adding flows took %0.3f ms' % ((t2-t1)*1000.0))
+                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 CASE4(self,main) :
+    def CASE5(self,main) :
         '''
         Tests a single ping 
         '''
@@ -103,12 +196,13 @@
         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) :
+    def CASE6(self,main) :
         '''
         Starts continuous pings on the Mininet nodes
         '''
-        main.log.report("Starting continuous ping")
+        main.log.report("Starting continuous ping, then toggle a single link in the 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'])
@@ -120,7 +214,7 @@
         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'])
-        time.sleep(5) 
+        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'])
@@ -131,33 +225,18 @@
         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'])
-        utilities.assert_equals(expect=main.TRUE,actual=result) 
-
-
-    def CASE6(self,main) : 
-        '''
-        Brings the defined link down and up a certain number of iterations
-        Stops the continuous pings that are running on the mininet machines from CASE 5
-        '''
-        import time
-        import os
-        main.log.report("Links UP/DOWN and stop ping")
-        main.log.case( "Link down number of iterations: " +  main.params['Iterations'] )
-        os.popen("echo "" > ~/tools/downtimes.log")
+        main.step( "Link down number of iterations: " +  main.params['Iterations'] )
         for i in range(int(main.params['Iterations'])):
-            main.log.info("Bringing Link down... ")
-            #main.ONOS1.link_down(SDPID=main.params['LINK1']['dpid1'],SPORT=main.params['LINK1']['port1'],DDPID=main.params['LINK1']['dpid2'],DPORT=main.params['LINK1']['port2'])
-            main.Mininet1.link(END1=main.params['LINK']['begin'],END2=main.params['LINK']['end'],OPTION="down")
-            os.popen("echo `date +%s` >> ~/tools/downtimes.log")
+            main.log.info("Bringing Link down... ") 
+            main.Mininet1.link(END1="s1",END2="s2",OPTION="down")
             main.log.info( "Waiting " + main.params['WaitTime'] + " seconds.... " )
             time.sleep( int(main.params['WaitTime']) )
             main.log.info("Bringing Link up... ")
-            #main.ONOS1.link_up(SDPID=main.params['LINK1']['dpid1'],SPORT=main.params['LINK1']['port1'],DDPID=main.params['LINK1']['dpid2'],DPORT=main.params['LINK1']['port2'])
-            main.Mininet1.link(END1=main.params['LINK']['begin'],END2=main.params['LINK']['end'],OPTION="up")
+            main.Mininet1.link(END1="s1",END2="s2",OPTION="up")
             main.log.info( "Waiting " + main.params['WaitTime'] + " seconds.... " )
             time.sleep( int(main.params['WaitTime']) )
         main.case("Killing remote ping processes ") 
-        result = main.Mininet4.pingKill() 
+        result =  result & main.Mininet4.pingKill() 
         utilities.assert_equals(expect=main.TRUE,actual=result) 
        
 
@@ -170,16 +249,193 @@
         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()
-        average=result.split(":")[1] 
-        main.log.info( "Reroute times are... " ) 
-        main.log.report( result ) 
+        #result=os.popen("/home/admin/tools/shell.sh " + main.params['Iterations']).read()
+        try:
+            result=os.popen("/home/admin/get_reroute_times.py").read() 
+            average=result.split(":")[1] 
+            main.log.info( "Reroute times are... " ) 
+            main.log.report( result + " seconds" ) 
+            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
+        except:
+            main.log.report("No data")
+            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 multiple 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")
+        main.step( "Link down number of iterations: " +  main.params['Iterations'] )
+        for i in range(int(main.params['Iterations'])):
+            main.log.info("s1-s2 link down")
+            main.Mininet1.link(END1="s1",END2="s2",OPTION="down")
+            main.Mininet1.link(END1="s1",END2="s3",OPTION="up")
+            main.Mininet1.link(END1="s2",END2="s3",OPTION="up")
+
+            time.sleep(5)
+
+            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 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: 
+        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 CASE10(self,main) :
+        '''
+        Starts continuous pings on the Mininet nodes
+        '''
+        main.log.info("Make sure all links in triangle are up")
+        main.Mininet1.link(END1="s1",END2="s2",OPTION="up")
+        main.Mininet1.link(END1="s1",END2="s3",OPTION="up")
+        main.Mininet1.link(END1="s2",END2="s3",OPTION="up")
+        main.log.report("Start continuous pings, then toggle one link in center triangle and start/stop 1 ONOS node")
+        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")
+        main.step( "Link down number of iterations: " +  main.params['Iterations'] )
+        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")
+            if i % 4 == 0:
+                main.ONOS1.stop()
+            elif i % 4 == 1:
+                main.ONOS2.stop()
+            elif i % 4 == 2:
+                main.ONOS3.stop()
+            else:
+                main.ONOS4.stop()
+
+            time.sleep(5)
+
+            main.log.info("s1-s2 link up | Onos 1 back up")
+            main.Mininet1.link(END1="s1",END2="s2",OPTION="up")
+            if i % 4 == 0:
+                main.ONOS1.start()
+                main.ONOS1.isup()
+            elif i % 4 == 1:
+                main.ONOS2.start()
+                main.ONOS2.isup()
+            elif i % 4 == 2:
+                main.ONOS3.start()
+                main.ONOS3.isup()
+            else:
+                main.ONOS4.start()
+                main.ONOS4.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 CASE11(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/OnosPerf4nodes/OnosPerf4nodes.topo b/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.topo
index 5f35b09..eb6130f 100644
--- a/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.topo
+++ b/TestON/tests/OnosPerf4nodes/OnosPerf4nodes.topo
@@ -67,28 +67,28 @@
         </ONOS4>
 
         <Mininet1>
-            <host>10.128.100.4</host>
+            <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-2sw-2host.py </arg1>
+                <arg1> --custom ~/mininet/custom/topo-onos4node.py </arg1>
                 <arg2> --topo mytopo</arg2>
-                <controller> remote </controller>
+                <controller> remote,ip=10.128.100.1,port=6633 </controller>
              </COMPONENTS>
         </Mininet1>
 
         <Mininet4>
-            <host>10.128.100.4</host>
+            <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.4</host>
+            <host>10.128.100.11</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>RemoteMininetDriver</type>
diff --git a/TestON/tests/OnosSanity4nodes/.OnosSanity.topo.swp b/TestON/tests/OnosSanity4nodes/.OnosSanity.topo.swp
deleted file mode 100644
index c2a0aff..0000000
--- a/TestON/tests/OnosSanity4nodes/.OnosSanity.topo.swp
+++ /dev/null
Binary files differ
diff --git a/TestON/tests/OnosSanity4nodes/.OnosSanity4nodes.topo.swp b/TestON/tests/OnosSanity4nodes/.OnosSanity4nodes.topo.swp
deleted file mode 100644
index 1500dc4..0000000
--- a/TestON/tests/OnosSanity4nodes/.OnosSanity4nodes.topo.swp
+++ /dev/null
Binary files differ
diff --git a/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.params b/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.params
index 6fdbea5..e16f336 100644
--- a/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.params
+++ b/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.params
@@ -1,5 +1,5 @@
 <PARAMS>
-    <testcases>1,2,3,4,5,6,7</testcases>
+    <testcases>1,2,21,3,4,5,6,7</testcases>
     <FLOWDEF>~/flowdef_files/Center_Triangle/flowdef_20.txt</FLOWDEF>
     <CASE1>       
         <destination>h6</destination>
@@ -14,6 +14,18 @@
         <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>
@@ -24,4 +36,13 @@
         <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/OnosSanity4nodes/OnosSanity4nodes.py b/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.py
index ef3b47a..bc0291b 100644
--- a/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.py
+++ b/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.py
@@ -21,6 +21,10 @@
         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...")
@@ -28,7 +32,19 @@
         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()
+        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()
@@ -60,28 +76,24 @@
         for i in range(25): 
             if i < 3:
                 j=i+1
-                main.Mininet1.assign_sw_controller(sw="s"+str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])
+                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="s"+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'])
-                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="s"+str(j),ip1=main.params['CTRL']['ip2'],port1=main.params['CTRL']['port2'])
+                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="s"+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'])
-                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="s"+str(j),ip1=main.params['CTRL']['ip3'],port1=main.params['CTRL']['port3'])
+                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="s"+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'])
-                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="s"+str(j),ip1=main.params['CTRL']['ip4'],port1=main.params['CTRL']['port4'])
+                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="s"+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'])
-                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")       
  
 # **********************************************************************************************************************************************************************************************
@@ -111,36 +123,17 @@
                 count = count + 1
                 main.log.report("Flow failed, waiting 10 seconds then making attempt number "+str(count))
             elif tmp == main.FALSE and count == 6:
-                result = main.FALSE
+                result1 = main.FALSE
                 break
             else:
-                result = main.TRUE
+                result1 = main.TRUE
                 break
         endTime = time.time()
-        if result == main.TRUE:
+        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")
-        utilities.assert_equals(expect=main.TRUE,actual=result,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 10 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 3 attempts")
-        import time
-        for i in range(25):
-            if i < 15:
-                j=i+1
-                main.Mininet1.assign_sw_controller(sw="s"+str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])  #Assigning a single controller removes all other controllers
-                time.sleep(1)
-            else:
-                j=i+16
-                main.Mininet1.assign_sw_controller(sw="s"+str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])
-                time.sleep(1)
+        
         strtTime = time.time()
         count = 1
         i = 6
@@ -155,6 +148,59 @@
             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'])
+       
+        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 < 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
@@ -170,29 +216,36 @@
 #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 3 attempts")
+        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="s"+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'])
-                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="s"+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'])
-                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'])
+       
+        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 < 3:
+            if ping == main.FALSE and count < 6:
                 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.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
@@ -210,24 +263,33 @@
 #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, wait 20 seconds, then ping until all hosts are reachable or fail after 3 attempts")
+        main.log.report("Bring Link between s1 and s2 down, wait 15 seconds, then ping until all hosts are reachable or fail after 6 attempts")
         import time
         main.case("Bringing Link down... ")
         result = main.Mininet1.link(END1=main.params['LINK']['begin'],END2=main.params['LINK']['end'],OPTION="down")
-        time.sleep(20)
+        time.sleep(15)
         utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Link DOWN!",onfail="Link not brought down...")
+        
+        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
+
         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:
+            if ping == main.FALSE and count < 6:
                 count = count + 1
-                main.log.info("Ping failed, making attempt number "+str(count)+" in 10 seconds")
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 5 seconds")
                 i = 6
-                time.sleep(10)
-            elif ping == main.FALSE and count ==3:
+                time.sleep(5)
+            elif ping == main.FALSE and count ==6:
                 main.log.error("Ping test failed")
                 i = 17
                 result = main.FALSE
@@ -245,24 +307,33 @@
 #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, wait 20 seconds, then ping until all hosts are reachable or fail after 3 attempts")
+        main.log.report("Bring Link between s1 and s2 up, wait 15 seconds, then ping until all hosts are reachable or fail after 6 attempts")
         import time
         main.case("Bringing Link up... ")
         result = main.Mininet1.link(END1=main.params['LINK']['begin'],END2=main.params['LINK']['end'],OPTION="up")
-        time.sleep(20)
+        time.sleep(15)
         utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Link UP!",onfail="Link not brought up...")
+       
+        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 < 3:
+            if ping == main.FALSE and count < 6:
                 count = count + 1
-                main.log.info("Ping failed, making attempt number "+str(count)+" in 10 seconds")
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 5 seconds")
                 i = 6
-                time.sleep(10)
-            elif ping == main.FALSE and count ==3:
+                time.sleep(5)
+            elif ping == main.FALSE and count ==6:
                 main.log.error("Ping test failed")
                 i = 17
                 result = main.FALSE
@@ -276,3 +347,103 @@
             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']
+        except IndexError:
+            Reststatus = 0
+        if Reststatus == 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']
+        except IndexError:
+            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.")
+            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']
+        except IndexError:
+            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.")
+            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.topo b/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.topo
index 9086c16..48fc2a7 100644
--- a/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.topo
+++ b/TestON/tests/OnosSanity4nodes/OnosSanity4nodes.topo
@@ -122,14 +122,14 @@
         </ONOS4>
 
         <Mininet1>
-            <host>10.128.100.4</host>
+            <host>10.128.100.11</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>MininetCliDriver</type>
             <connect_order>13</connect_order>
             <COMPONENTS>
                 # Specify the Option for mininet
-                <arg1> --custom ~/mininet/custom/topo-2sw-2host.py </arg1>
+                <arg1> --custom ~/mininet/custom/topo-onos4node.py </arg1>
                 <arg2> --topo mytopo</arg2>
                 <controller> remote </controller>
              </COMPONENTS>
diff --git a/TestON/tests/OnosScale4nodes/OnosScale4nodes.py b/TestON/tests/OnosScale4nodes/OnosScale4nodes.py
index a054088..06778da 100644
--- a/TestON/tests/OnosScale4nodes/OnosScale4nodes.py
+++ b/TestON/tests/OnosScale4nodes/OnosScale4nodes.py
@@ -20,10 +20,27 @@
         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")
         main.ONOS1.start()
         main.ONOS2.start()
+        main.ONOS2.start_rest()
+        time.sleep(5)
+        test= main.ONOS2.rest_status()
+        if test == main.FALSE:
+            main.ONOS2.start_rest()
         main.ONOS3.start()
         main.ONOS4.start()
         data = main.ONOS1.isup()
@@ -77,7 +94,7 @@
         main.log.info("Pointing the Switches at ONE controller... then BEGIN time") 
         main.Mininet1.ctrl_local()
         t1 = time.time()
-        for i in range(9) : 
+        for i in range(15) : 
             result = main.ONOS1.check_status(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
             if result == 1 : 
                 break
@@ -117,13 +134,14 @@
         main.ONOS2.stop()
         main.ONOS3.stop()
         main.ONOS4.stop()
-        main.log.info("Dropping keyspace...")
-        main.ONOS1.drop_keyspace()
+        #main.log.info("Dropping keyspace...")
+        #main.ONOS1.drop_keyspace()
         time.sleep(5)
         main.log.info("Bringing ONOS up")
         main.ONOS1.start()
         time.sleep(5) 
         main.ONOS2.start()
+        main.ONOS2.start_rest()
         main.ONOS3.start()
         main.ONOS4.start()
         main.ONOS1.isup()
@@ -134,7 +152,7 @@
         main.log.info("Pointing the Switches at ALL controllers... then BEGIN time") 
         main.Mininet1.ctrl_all()
         t1 = time.time()
-        for i in range(9) : 
+        for i in range(15) : 
             result = main.ONOS1.check_status(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
             if result == 1 : 
                 break
@@ -164,7 +182,7 @@
         Then it evenly points all mininet switches to all ONOS nodes, but only one node, and times how long it take for the ONOS rest call to reflect the correct count of switches and links.
         '''
         import time
-        main.log.report("Time convergence for switches -> one of all nodes in cluster")
+        main.log.report("Time convergence for switches -> Divide switches equall among all  nodes in cluster")
         main.case("Timing Onos Convergence for even single controller distribution")
         main.step("Bringing ONOS down...") 
         main.log.info("all switch no controllers") 
@@ -174,13 +192,14 @@
         main.ONOS2.stop()
         main.ONOS3.stop()
         main.ONOS4.stop()
-        main.log.info("Dropping keyspace...")
-        main.ONOS1.drop_keyspace()
+        #main.log.info("Dropping keyspace...")
+        #main.ONOS1.drop_keyspace()
         time.sleep(5)
         main.log.info("Bringing ONOS up")
         main.ONOS1.start()
         time.sleep(5) 
         main.ONOS2.start()
+        main.ONOS2.start_rest()
         main.ONOS3.start()
         main.ONOS4.start()
         main.ONOS1.isup()
@@ -191,7 +210,7 @@
         main.log.info("Pointing the Switches to alternating controllers... then BEGIN time") 
         main.Mininet1.ctrl_divide()
         t1 = time.time()
-        for i in range(9) : 
+        for i in range(15) : 
             result = main.ONOS1.check_status(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
             if result == 1 : 
                 break
diff --git a/TestON/tests/OnosScale4nodes/OnosScale4nodes.topo b/TestON/tests/OnosScale4nodes/OnosScale4nodes.topo
index 69ba473..e9d764f 100644
--- a/TestON/tests/OnosScale4nodes/OnosScale4nodes.topo
+++ b/TestON/tests/OnosScale4nodes/OnosScale4nodes.topo
@@ -70,7 +70,7 @@
         </Cassandra4>
 
         <Mininet1>
-            <host>10.128.100.4</host>
+            <host>10.128.100.11</host>
             <user>admin</user>
             <password>onos_test</password>
             <type>MininetCliDriver</type>
@@ -79,7 +79,7 @@
                 # Specify the Option for mininet
                 <arg1> </arg1>
                 <arg2> --topo linear,100 </arg2>
-                <controller> remote </controller>
+                <controller> remote,ip=10.128.100.1,port=6633 </controller>
              </COMPONENTS>
         </Mininet1>