Merge branch 'master' of github.com:OPENNETWORKINGLAB/ONLabTest
diff --git a/README.md b/README.md
index 8224da6..bd2fa6f 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 TestON, a testing infastructure by Paxterra
 =======================================
-TestON is the testing platform that all the ONOS tests are being run on curretly. 
+TestON is the testing platform that all the ONOS tests are being run on currently. 
 
 
 Setup 
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index f2d1f69..cfa0ecc 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -155,7 +155,7 @@
         '''
         args = utilities.parse_args(["SRC","TARGET"],**pingParams)
         #command = args["SRC"] + " ping -" + args["CONTROLLER"] + " " +args ["TARGET"]
-        command = args["SRC"] + " ping "+args ["TARGET"]+" -c 1 -i .2 -W 8"
+        command = args["SRC"] + " ping "+args ["TARGET"]+" -c 1 -i 1 -w 8"
         try:
             main.log.warn("Sending: " + command)
             #response = self.execute(cmd=command,prompt="mininet",timeout=10 )
@@ -433,7 +433,9 @@
         option = args["OPTION"] if args["OPTION"] != None else ""
         command = "link "+str(end1) + " " + str(end2)+ " " + str(option)
         try:
-            response = self.execute(cmd=command,prompt="mininet>",timeout=10)
+            #response = self.execute(cmd=command,prompt="mininet>",timeout=10)
+            self.handle.sendline(command)
+            self.handle.expect("mininet>")    
         except pexpect.EOF:  
             main.log.error(self.name + ": EOF exception found")
             main.log.error(self.name + ":     " + self.handle.before)
@@ -566,6 +568,7 @@
             try:
                 response = self.execute(cmd="exit",prompt="(.*)",timeout=120)
                 response = self.execute(cmd="exit",prompt="(.*)",timeout=120)
+                self.handle.sendline("sudo mn -c")
             except pexpect.EOF:  
                 main.log.error(self.name + ": EOF exception found")
                 main.log.error(self.name + ":     " + self.handle.before)
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index 9590b26..e19bc7b 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -122,7 +122,18 @@
             main.log.info(":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
             main.cleanup()
             main.exit()
- 
+
+    def start_all(self):
+        '''
+        starts ZK, RC, and ONOS
+        '''
+        self.handle.sendline("cd "+self.home)
+        self.handle.sendline("./onos.sh start")
+        self.handle.expect("./onos.sh start")
+        self.handle.expect(["\$",pexpect.TIMEOUT])
+
+
+
     def start_rest(self):
         '''
         Starts the rest server on ONOS.
@@ -196,23 +207,25 @@
             self.execute(cmd="\n",prompt="\$",timeout=10)
             tail2 = self.execute(cmd="tail " + self.home + "/onos-logs/onos.*.log",prompt="\$",timeout=10)
             pattern = '(.*)1 instance(.*)'
+            patternUp = 'Sending LLDP out'
             pattern2 = '(.*)Exception: Connection refused(.*)'
            # if utilities.assert_matches(expect=pattern,actual=response,onpass="ONOS process is running...",onfail="ONOS process not running..."):
             
             if re.search(pattern, response):
-                main.log.info(self.name + ": ONOS process is running...")
-                if tail1 == tail2:
-                    main.log.error(self.name + ": ONOS is frozen...")#logs aren't moving
-                    return main.FALSE
-                elif re.search( pattern2,tail1 ):
-                    main.log.info(self.name + ": Connection Refused found in onos log")
-                    return main.FALSE
-                elif re.search( pattern2,tail2 ):
-                    main.log.info(self.name + ": Connection Refused found in onos log")
-                    return main.FALSE
-                else:
-                    main.log.info(self.name + ": Onos log is moving! It's looking good!")
-                    return main.TRUE
+                if re.search(patternUp,tail2):
+                    main.log.info(self.name + ": ONOS process is running...")
+                    if tail1 == tail2:
+                        main.log.error(self.name + ": ONOS is frozen...")#logs aren't moving
+                        return main.FALSE
+                    elif re.search( pattern2,tail1 ):
+                        main.log.info(self.name + ": Connection Refused found in onos log")
+                        return main.FALSE
+                    elif re.search( pattern2,tail2 ):
+                        main.log.info(self.name + ": Connection Refused found in onos log")
+                        return main.FALSE
+                    else:
+                        main.log.info(self.name + ": Onos log is moving! It's looking good!")
+                        return main.TRUE
             else:
                 main.log.error(self.name + ": ONOS process not running...")
                 return main.FALSE
@@ -813,8 +826,8 @@
 
         '''
         try:
-            main.log.info(self.name + ": Stopping ONOS")
-            self.stop()
+            # main.log.info(self.name + ": Stopping ONOS")
+            #self.stop()
             self.handle.sendline("cd " + self.home)
             self.handle.expect("ONOS\$")
             if comp1=="":
diff --git a/TestON/drivers/common/cli/zookeeperclidriver.py b/TestON/drivers/common/cli/zookeeperclidriver.py
index 752df44..242e07b 100644
--- a/TestON/drivers/common/cli/zookeeperclidriver.py
+++ b/TestON/drivers/common/cli/zookeeperclidriver.py
@@ -135,7 +135,7 @@
         Calls the zookeeper status and returns TRUE if it has an assigned Mode to it. 
         '''
         self.execute(cmd="\n",prompt="\$",timeout=10)
-        response = self.execute(cmd=self.home + "/bin/zkServer.sh status ",prompt="Mode",timeout=10)
+        response = self.execute(cmd=self.home + "/onos.sh zk status ",prompt="Mode",timeout=10)
         pattern = '(.*)Mode(.*)'
         if re.search(pattern, response): 
 	    main.log.info(self.name + ": Zookeeper is up.") 
diff --git a/TestON/drivers/common/clidriver.py b/TestON/drivers/common/clidriver.py
index 0406e48..6c537e6 100644
--- a/TestON/drivers/common/clidriver.py
+++ b/TestON/drivers/common/clidriver.py
@@ -53,31 +53,31 @@
             self.handle =pexpect.spawn('ssh -X '+self.user_name+'@'+self.ip_address,maxread=50000)
 
         self.handle.logfile = self.logfile_handler
-        i=self.handle.expect([ssh_newkey,'password:',pexpect.EOF,pexpect.TIMEOUT,refused,'>|#|$'],120)
+	i = 5
+	while i == 5:
+	    i=self.handle.expect([ssh_newkey,'password:',pexpect.EOF,pexpect.TIMEOUT,refused,'teston>','>|#|\$'],120)
+	    if i==0:
+	        main.log.info("ssh key confirmation received, send yes")
+	        self.handle.sendline('yes')
+	        i=self.handle.expect([ssh_newkey,'password:',pexpect.EOF])
+	    if i==1:
+	        main.log.info("ssh connection asked for password, gave password")
+	        self.handle.sendline(self.pwd)
+	        self.handle.expect('>|#|\$')
+	    elif i==2:
+	        main.log.error("Connection timeout")
+	        return main.FALSE
+	    elif i==3: #timeout
+	        main.log.error("No route to the Host "+self.user_name+"@"+self.ip_address)
+	        return main.FALSE
+	    elif i==4:
+	        main.log.error("ssh: connect to host "+self.ip_address+" port 22: Connection refused")
+	        return main.FALSE
+	    elif i==6:
+	        main.log.info("Password not required logged in")
 
-        if i==0:
-            main.log.info("ssh key confirmation received, send yes")
-            self.handle.sendline('yes')
-            i=self.handle.expect([ssh_newkey,'password:',pexpect.EOF])
-        if i==1:
-            main.log.info("ssh connection asked for password, gave password")
-            self.handle.sendline(self.pwd)
-            self.handle.expect('>|#|$')
-
-        elif i==2:
-            main.log.error("Connection timeout")
-            return main.FALSE
-        elif i==3: #timeout
-            main.log.error("No route to the Host "+self.user_name+"@"+self.ip_address)
-            return main.FALSE
-        elif i==4:
-            main.log.error("ssh: connect to host "+self.ip_address+" port 22: Connection refused")
-            return main.FALSE
-        elif i==5:
-            main.log.info("Password not required logged in")
-
-        self.handle.sendline("\r")
-        self.handle.expect('>|#|$', 2)
+        self.handle.sendline("\n")
+        self.handle.expect('>|#|\$')
         return self.handle
 
     
@@ -99,7 +99,7 @@
         '''
 
         result = super(CLI, self).execute(self)
-        defaultPrompt = '.*[$>\#]'
+        defaultPrompt = '.*[\$|>|#]'
         args = utilities.parse_args(["CMD", "TIMEOUT", "PROMPT", "MORE"], **execparams)
         expectPrompt = args["PROMPT"] if args["PROMPT"] else defaultPrompt
         self.LASTRSP = ""
@@ -163,7 +163,7 @@
         i = handle.expect([".ssword:*",default, pexpect.EOF])
         if i==0:
             handle.sendline(pwd)
-            handle.sendline("\r")
+            handle.sendline("\n")
 
         if i==1:
             handle.expect(default)
@@ -212,7 +212,7 @@
             main.log.error("ssh: connect to host "+ip_address+" port 22: Connection refused")
             return main.FALSE
 
-        self.handle.sendline("\r")
+        self.handle.sendline("\n")
         
         return self.handle
     
diff --git a/TestON/tests/ONOSSanity4/ONOSSanity4.params b/TestON/tests/ONOSSanity4/ONOSSanity4.params
new file mode 100644
index 0000000..c3ffb50
--- /dev/null
+++ b/TestON/tests/ONOSSanity4/ONOSSanity4.params
@@ -0,0 +1,49 @@
+<PARAMS>
+    <testcases>1</testcases>
+    <FLOWDEF>~/flowdef_files/Center_Triangle/flowdef_20.txt</FLOWDEF>
+    <CASE1>       
+        <destination>h6</destination>
+    </CASE1>       
+    <PING>
+        <source1>h7</source1>
+        <target1>h32</target1>
+        <source2>h8</source2>
+        <target2>h33</target2>
+    </PING>
+    <LINK>
+        <begin>s1</begin>
+        <end>s2</end>
+    </LINK>
+    <YANK>
+        <hostname>h1</hostname>
+        <hostip>10.0.0.1</hostip>
+        <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.4.151</ip1>
+        <port1>6633</port1>
+        <ip2>10.128.4.152</ip2>
+        <port2>6633</port2>
+        <ip3>10.128.4.153</ip3>
+        <port3>6633</port3>
+        <ip4>10.128.4.154</ip4>
+        <port4>6633</port4>
+    </CTRL>
+    <RestIP>10.128.4.151</RestIP>
+    <NR_Switches>25</NR_Switches>
+    <NR_Links>50</NR_Links>
+    <RESTCALL>
+	<restIP1>10.128.4.151</restIP1>
+	<restIP2>10.128.4.152</restIP2>
+	<restPort>8080</restPort>
+	<restURL>/wm/onos/topology/switches/json</restURL>
+    </RESTCALL>
+</PARAMS>      
diff --git a/TestON/tests/ONOSSanity4/ONOSSanity4.py b/TestON/tests/ONOSSanity4/ONOSSanity4.py
new file mode 100644
index 0000000..da5c167
--- /dev/null
+++ b/TestON/tests/ONOSSanity4/ONOSSanity4.py
@@ -0,0 +1,147 @@
+class ONOSSanity4 :
+    def __init__(self) :
+        self.default = ''
+
+#************************************************************************************************************************************
+    '''
+    CASE1: Initial Startup
+    This case will follow the following steps
+    1. Stop all instances of Zookeeper, RAMCloud, and ONOS
+    2. Pull and build (if necessary) the latest ONOS code from Gerrit
+    3. Start Up Zookeeper, RAMCloud, and ONOS. (We will be using the start_all function aka ./onos.sh start)
+    4. Start up Mininet (Omitted for now as the Mininet is started up when the handle is connected)
+    5. Start up Rest Server
+    6. Test startup of Zookeeper
+    7. Test startup of RAMCloud
+    8. Test startup of ONOS
+    9. Test startup of Rest Server
+    10. Test startup of Mininet
+    '''
+    def CASE1(self,main) :
+        main.case("Initial Startup")
+        main.step("\n*************************\nStop all instances of ZK, RC, and ONOS\n*******************\n")
+        main.ONOS1.stop()
+        main.ONOS2.stop()
+        main.ONOS3.stop()
+        main.ONOS4.stop()
+        main.RC1.stop_serv()
+        main.RC2.stop_serv()
+        main.RC3.stop_serv()
+        main.RC4.stop_serv()
+        main.RC1.stop_coor()
+        main.Zookeeper1.stop()
+        main.Zookeeper2.stop()
+        main.Zookeeper3.stop()
+        main.Zookeeper4.stop()
+        main.step("**************\nPull and build (if necessary) the latest ONOS code from Gerrit \n****************\n")
+        uptodate = main.ONOS1.git_pull()
+        main.ONOS2.git_pull()
+        main.ONOS3.git_pull()
+        main.ONOS4.git_pull()
+        ver1 = main.ONOS1.get_version()
+        ver2 = main.ONOS4.get_version()
+        if ver1!=ver2:
+            main.ONOS2.git_pull("ONOS1 master")
+            main.ONOS3.git_pull("ONOS1 master")
+            main.ONOS4.git_pull("ONOS1 master")
+        if uptodate==0:
+            main.ONOS1.git_compile()
+            main.ONOS2.git_compile()
+            main.ONOS3.git_compile()
+            main.ONOS4.git_compile()
+        main.ONOS1.print_version()
+        main.step("Start up ZK, RC, and ONOS")
+        main.ONOS1.start_all()
+        main.ONOS2.start_all()
+        main.ONOS3.start_all()
+        main.ONOS4.start_all()
+        #main.step("Start Up Mininet")
+        main.step("Start up Rest Server")
+        main.ONOS1.start_rest()
+        main.step("Test startup of Zookeeper")
+        for i in range(2):
+            zk1up = main.Zookeeper1.isup()
+            zk2up = main.Zookeeper2.isup()
+            zk3up = main.Zookeeper3.isup()
+            zk4up = main.Zookeeper4.isup()
+            zkup = zk1up and zk2up and zk3up and zk4up
+            if zkup==main.TRUE:
+                break
+        utilities.assert_equals(expect=main.TRUE,actual=zkup,onpass="Zookeeper is up!",onfail="Zookeeper is down! Exiting!")
+        if zkup==main.FALSE:
+            main.cleanup()
+            main.exit()
+        main.step("Test startup of RamCloud")
+        for i in range(2):
+            rccup = main.RC1.status_coor()
+            rcs1up = main.RC1.status_serv()
+            rcs2up = main.RC2.status_serv()
+            rcs3up = main.RC3.status_serv()
+            rcs4up = main.RC4.status_serv()
+            rcup = rccup and rcs1up and rcs2up and rcs3up and rcs4up
+            if rcup==main.TRUE:
+                break
+        utilities.assert_equals(expect=main.TRUE,actual=rcup,onpass="RAMCloud is up!",onfail="RAMCloud is down! Exiting!")
+        if rcup == main.FALSE:
+            main.cleanup()
+            main.exit()
+
+        main.step("Test startup of ONOS")
+        for i in range(2):
+            ONOS1up = main.ONOS1.isup()
+            ONOS2up = main.ONOS2.isup()
+            ONOS3up = main.ONOS3.isup()
+            ONOS4up = main.ONOS4.isup()
+            ONOSup = ONOS1up and ONOS2up and ONOS3up and ONOS4up
+            if ONOSup==main.TRUE:
+                break
+        utilities.assert_equals(expect=main.TRUE,actual=ONOSup,onpass="ONOS is up!",onfail="ONOS is down! Exiting!")
+        if ONOSup==main.FALSE:
+            main.cleanup()
+            main.exit()
+
+        main.step("Test startup of Rest Server")
+        for i in range(2):
+            restStatus = main.ONOS1.rest_status()
+            if restStatus==main.TRUE:
+                break
+        utilities.assert_equals(expect=main.TRUE,actual=restStatus,onpass="Rest Server is up!",onfail="Rest Server is Down! Exiting!")
+        if restStatus==main.FALSE:
+            main.cleanup()
+            main.exit()
+
+            
+
+
+
+#************************************************************************************************************************************
+
+
+#************************************************************************************************************************************
+        '''
+        CASE2: Assign Controllers
+        This case will follow the following steps
+        1. Assign a Master Controller to each switch
+        2. Verify Master Controller
+        3. Assign all controllers to all switches
+        4. Verify all controllers
+        '''
+#************************************************************************************************************************************
+
+
+#************************************************************************************************************************************
+        '''
+        CASE3: Device Discovery Test
+        This case will follow the following steps
+        1. Ping to generate arp packets to switch
+        2. Find number of hosts with target IP (Try twice if not 1. Then will fail)
+        3. Yank the switch
+        4. Ping to generate arp packets to switch
+        5. Find number of hosts with target IP (Try twice if not 0. Then will fail)
+        6. Plug the switch
+        7. Ping to generate arp packets to switch
+        8. Find number of hosts with target IP (Try twice if not 1. Then will fail)
+
+        
+        '''
+#************************************************************************************************************************************
diff --git a/TestON/tests/ONOSSanity4/ONOSSanity4.topo b/TestON/tests/ONOSSanity4/ONOSSanity4.topo
new file mode 100644
index 0000000..f4e1745
--- /dev/null
+++ b/TestON/tests/ONOSSanity4/ONOSSanity4.topo
@@ -0,0 +1,139 @@
+<TOPOLOGY>
+
+    <COMPONENT>
+        <Zookeeper1>
+            <host>10.128.4.151</host>
+            <user>admin</user>
+            <password></password>
+            <type>ZookeeperCliDriver</type>
+            <connect_order>1</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </Zookeeper1>
+
+        <Zookeeper2>
+            <host>10.128.4.152</host>
+            <user>admin</user>
+            <password></password>
+            <type>ZookeeperCliDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </Zookeeper2>
+
+        <Zookeeper3>
+            <host>10.128.4.153</host>
+            <user>admin</user>
+            <password></password>
+            <type>ZookeeperCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </Zookeeper3>
+       
+        <Zookeeper4>
+            <host>10.128.4.154</host>
+            <user>admin</user>
+            <password></password>
+            <type>ZookeeperCliDriver</type>
+            <connect_order>4</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </Zookeeper4>
+
+        <RC1>
+            <host>10.128.4.151</host>
+            <user>admin</user>
+            <password></password>
+            <type>RamCloudCliDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </RC1>
+
+        <RC2>
+            <host>10.128.4.152</host>
+            <user>admin</user>
+            <password></password>
+            <type>RamCloudCliDriver</type>
+            <connect_order>6</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </RC2>
+       
+        <RC3>
+            <host>10.128.4.153</host>
+            <user>admin</user>
+            <password></password>
+            <type>RamCloudCliDriver</type>
+            <connect_order>7</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </RC3>
+       
+        <RC4>
+            <host>10.128.4.154</host>
+            <user>admin</user>
+            <password></password>
+            <type>RamCloudCliDriver</type>
+            <connect_order>8</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </RC4>
+
+        <ONOS1>
+            <host>10.128.4.151</host>
+            <user>admin</user>
+            <password></password>
+            <type>OnosCliDriver</type>
+            <connect_order>9</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </ONOS1>
+
+        <ONOS2>
+            <host>10.128.4.152</host>
+            <user>admin</user>
+            <password></password>
+            <type>OnosCliDriver</type>
+            <connect_order>10</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </ONOS2>
+
+        <ONOS3>
+            <host>10.128.4.153</host>
+            <user>admin</user>
+            <password></password>
+            <type>OnosCliDriver</type>
+            <connect_order>11</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </ONOS3>
+       
+        <ONOS4>
+            <host>10.128.4.154</host>
+            <user>admin</user>
+            <password></password>
+            <type>OnosCliDriver</type>
+            <connect_order>12</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </ONOS4>
+
+        <Mininet1>
+            <host>10.128.4.159</host>
+            <user>admin</user>
+            <password></password>
+            <type>MininetCliDriver</type>
+            <connect_order>13</connect_order>
+            <COMPONENTS>
+                # Specify the Option for mininet
+                <arg1> --custom ~/mininet/custom/topo-onos4nodeNEW.py </arg1>
+                <arg2> --topo mytopo --arp</arg2>
+                <controller> remote </controller>
+             </COMPONENTS>
+        </Mininet1>
+
+    </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/ONOSSanity4/__init__.py b/TestON/tests/ONOSSanity4/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/ONOSSanity4/__init__.py
diff --git a/TestON/tests/RCOnosPerf4nodes/RCOnosPerf4nodes.py b/TestON/tests/RCOnosPerf4nodes/RCOnosPerf4nodes.py
index bd0763d..11ea4f6 100644
--- a/TestON/tests/RCOnosPerf4nodes/RCOnosPerf4nodes.py
+++ b/TestON/tests/RCOnosPerf4nodes/RCOnosPerf4nodes.py
@@ -21,8 +21,6 @@
         main.RamCloud2.start_serv()
         main.RamCloud3.start_serv()
         main.RamCloud4.start_serv()
-        time.sleep(20)
-        main.ONOS1.drop_keyspace()
         main.ONOS1.start()
         time.sleep(10)
         main.ONOS2.start()
@@ -40,7 +38,7 @@
         data =  main.Zookeeper1.isup()
         utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Zookeeper is up!",onfail="Zookeeper is down...")
         main.step("Testing startup RamCloud")
-        data =  main.RamCloud1.isup()
+        data =  main.RamCloud1.server_status()
         if data == main.FALSE:
             main.RamCloud1.stop_coor()
             main.RamCloud1.stop_serv()
@@ -157,10 +155,12 @@
         main.case("Taking care of these flows!") 
         main.step("Cleaning out any leftover flows...")
         main.log.info("deleting...")
-        main.ONOS1.delete_flow("all")
+        main.ONOS1.rm_flow()
+       # main.ONOS1.delete_flow("all")
         main.log.info("adding...")
         t1 = time.time()
-        main.ONOS1.add_flow(main.params['FLOWDEF'])   
+        main.ONOS1.ad_flow()
+       # main.ONOS1.add_flow(main.params['FLOWDEF'])   
         main.log.info("Checking...")
         for i in range(15):
             result = main.ONOS1.check_flow()
diff --git a/TestON/tests/RCOnosSanity4nodesJ/RCOnosSanity4nodesJ.params b/TestON/tests/RCOnosSanity4nodesJ/RCOnosSanity4nodesJ.params
index 8730ce6..29ffc61 100644
--- a/TestON/tests/RCOnosSanity4nodesJ/RCOnosSanity4nodesJ.params
+++ b/TestON/tests/RCOnosSanity4nodesJ/RCOnosSanity4nodesJ.params
@@ -1,5 +1,5 @@
 <PARAMS>
-    <testcases>1,2,3,31,41,4,5,6,7</testcases>
+    <testcases>1,2,21,3,31,4,41,5,6,7,3,4,5,6,7</testcases>
     <FLOWDEF>~/flowdef_files/Center_Triangle/flowdef_20.txt</FLOWDEF>
     <CASE1>       
         <destination>h6</destination>
@@ -44,6 +44,6 @@
 	<restIP1>10.128.4.151</restIP1>
 	<restIP2>10.128.4.152</restIP2>
 	<restPort>8080</restPort>
-	<restURL>/wm/onos/ng/switches/json</restURL>
+	<restURL>/wm/onos/topology/switches/json</restURL>
     </RESTCALL>
 </PARAMS>      
diff --git a/TestON/tests/RCOnosSanity4nodesJ/RCOnosSanity4nodesJ.py b/TestON/tests/RCOnosSanity4nodesJ/RCOnosSanity4nodesJ.py
index 09be2db..1480e76 100644
--- a/TestON/tests/RCOnosSanity4nodesJ/RCOnosSanity4nodesJ.py
+++ b/TestON/tests/RCOnosSanity4nodesJ/RCOnosSanity4nodesJ.py
@@ -9,8 +9,23 @@
 #Tests the startup of Zookeeper1, RamCloud1, and ONOS1 to be certain that all started up successfully
     def CASE1(self,main) :  #Check to be sure ZK, Cass, and ONOS are up, then get ONOS version
         import time
+        main.ONOS1.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties")
+        main.ONOS2.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties")
+        main.ONOS3.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties")
+        main.ONOS4.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties")
+        
         main.Zookeeper1.start()
-        time.sleep(20)
+        main.Zookeeper2.start()
+        main.Zookeeper3.start()
+        main.Zookeeper4.start()
+        main.RamCloud1.stop_coor()
+        main.RamCloud1.stop_serv()
+        main.RamCloud2.stop_serv()
+        main.RamCloud3.stop_serv()
+        main.RamCloud4.stop_serv()
+
+        
+        main.Zookeeper1.start()
         main.Zookeeper2.start()
         main.Zookeeper3.start()
         main.Zookeeper4.start()
@@ -28,7 +43,8 @@
                 main.ONOS2.git_pull("ONOS1 master")
                 main.ONOS3.git_pull("ONOS1 master")
                 main.ONOS4.git_pull("ONOS1 master")
-        if uptodate==0:
+       #if uptodate==0
+        if 1:
             main.ONOS1.git_compile()
             main.ONOS2.git_compile()
             main.ONOS3.git_compile()
@@ -43,19 +59,18 @@
        # main.ONOS3.get_version()
        # main.ONOS4.get_version()
         main.RamCloud1.start_coor()
-        time.sleep(20)
+        time.sleep(1)
         main.RamCloud1.start_serv()
         main.RamCloud2.start_serv()
         main.RamCloud3.start_serv()
         main.RamCloud4.start_serv()
-        time.sleep(20)
         main.ONOS1.start()
-        time.sleep(20)
+        time.sleep(5)
         main.ONOS2.start()
         main.ONOS3.start()
         main.ONOS4.start()
         main.ONOS1.start_rest()
-        time.sleep(5)
+        time.sleep(10)
         test= main.ONOS1.rest_status()
         if test == main.FALSE:
             main.ONOS1.start_rest()
@@ -66,7 +81,7 @@
         data =  main.Zookeeper1.isup()
         utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Zookeeper is up!",onfail="Zookeeper is down...")
         main.step("Testing startup RamCloud")   
-        data =  main.RamCloud1.status() 
+        data =  main.RamCloud1.status_serv() 
         if data == main.FALSE:
             main.RamCloud1.stop_coor()
             main.RamCloud1.stop_serv()
@@ -143,10 +158,12 @@
         main.step("Cleaning out any leftover flows...")
         #main.ONOS1.delete_flow("all")
         strtTime = time.time()
-        print("hello")
         main.ONOS1.rm_flow()
         print("world")
         main.ONOS1.ad_flow()
+        time.sleep(2)
+        main.ONOS1.ad_flow()
+        print("hello")
        # main.ONOS1.add_flow(main.params['FLOWDEF']['testONip'],main.params['FLOWDEF']['user'],main.params['FLOWDEF']['password'],main.params['FLOWDEF']['flowDef'])
         main.case("Checking flows")
        
@@ -370,7 +387,7 @@
         main.case("Bringing Link up... ")
         result = main.Mininet1.link(END1=main.params['LINK']['begin'],END2=main.params['LINK']['end'],OPTION="up")
         utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Link UP!",onfail="Link not brought up...")
-      
+        time.sleep(5) 
         strtTime = time.time() 
         result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
         for i in range(2):
diff --git a/TestON/tests/RCOnosScale4nodes/RCOnosScale4nodes.params b/TestON/tests/RCOnosScale4nodes/RCOnosScale4nodes.params
index dd4e311..f04ef3a 100644
--- a/TestON/tests/RCOnosScale4nodes/RCOnosScale4nodes.params
+++ b/TestON/tests/RCOnosScale4nodes/RCOnosScale4nodes.params
@@ -3,7 +3,7 @@
     <Iterations>2</Iterations>
     <WaitTime>50</WaitTime>
     <TargetTime>50</TargetTime>
-    <RestIP>10.128.100.1</RestIP>
+    <RestIP>10.128.4.151</RestIP>
     <NR_Switches>100</NR_Switches>
     <NR_Links>198</NR_Links>
 </PARAMS>      
diff --git a/TestON/tests/RRCOnosSanity4nodesJ/RRCOnosSanity4nodesJ.params b/TestON/tests/RRCOnosSanity4nodesJ/RRCOnosSanity4nodesJ.params
new file mode 100644
index 0000000..3f0c13a
--- /dev/null
+++ b/TestON/tests/RRCOnosSanity4nodesJ/RRCOnosSanity4nodesJ.params
@@ -0,0 +1,49 @@
+<PARAMS>
+    <testcases>1,2,21,31,4,41,5,6,7,4,5,6,7</testcases>
+    <FLOWDEF>~/flowdef_files/Center_Triangle/flowdef_20.txt</FLOWDEF>
+    <CASE1>       
+        <destination>h6</destination>
+    </CASE1>       
+    <PING>
+        <source1>h7</source1>
+        <target1>h32</target1>
+        <source2>h8</source2>
+        <target2>h33</target2>
+    </PING>
+    <LINK>
+        <begin>s1</begin>
+        <end>s2</end>
+    </LINK>
+    <YANK>
+        <hostname>h1</hostname>
+        <hostip>10.0.0.1</hostip>
+        <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.4.151</ip1>
+        <port1>6633</port1>
+        <ip2>10.128.4.152</ip2>
+        <port2>6633</port2>
+        <ip3>10.128.4.153</ip3>
+        <port3>6633</port3>
+        <ip4>10.128.4.154</ip4>
+        <port4>6633</port4>
+    </CTRL>
+    <RestIP>10.128.4.151</RestIP>
+    <NR_Switches>25</NR_Switches>
+    <NR_Links>50</NR_Links>
+    <RESTCALL>
+	<restIP1>10.128.4.151</restIP1>
+	<restIP2>10.128.4.152</restIP2>
+	<restPort>8080</restPort>
+	<restURL>/wm/onos/topology/switches/json</restURL>
+    </RESTCALL>
+</PARAMS>      
diff --git a/TestON/tests/RRCOnosSanity4nodesJ/RRCOnosSanity4nodesJ.py b/TestON/tests/RRCOnosSanity4nodesJ/RRCOnosSanity4nodesJ.py
new file mode 100644
index 0000000..372286f
--- /dev/null
+++ b/TestON/tests/RRCOnosSanity4nodesJ/RRCOnosSanity4nodesJ.py
@@ -0,0 +1,586 @@
+
+class RRCOnosSanity4nodesJ :
+
+    def __init__(self) :
+        self.default = ''
+
+#*****************************************************************************************************************************************************************************************
+#Test startup
+#Tests the startup of Zookeeper1, RamCloud1, and ONOS1 to be certain that all started up successfully
+    def CASE1(self,main) :  #Check to be sure ZK, Cass, and ONOS are up, then get ONOS version
+        import time
+        main.Zookeeper1.start()
+        main.Zookeeper2.start()
+        main.Zookeeper3.start()
+        main.Zookeeper4.start()
+        main.RamCloud1.stop_coor()
+        main.RamCloud1.stop_serv()
+        main.RamCloud2.stop_serv()
+        main.RamCloud3.stop_serv()
+        main.RamCloud4.stop_serv()
+        
+        main.ONOS1.handle.sendline("cp ~/onos.properties.reactive ~/ONOS/conf/onos.properties")
+        main.ONOS2.handle.sendline("cp ~/onos.properties.reactive ~/ONOS/conf/onos.properties")
+        main.ONOS3.handle.sendline("cp ~/onos.properties.reactive ~/ONOS/conf/onos.properties")
+        main.ONOS4.handle.sendline("cp ~/onos.properties.reactive ~/ONOS/conf/onos.properties")
+        
+        main.Zookeeper1.start()
+        main.Zookeeper2.start()
+        main.Zookeeper3.start()
+        main.Zookeeper4.start()
+        main.log.report("Pulling latest code from github to all nodes")
+        for i in range(2):
+            uptodate = main.ONOS1.git_pull()
+            main.ONOS2.git_pull()
+            main.ONOS3.git_pull()
+            main.ONOS4.git_pull()
+            ver1 = main.ONOS1.get_version()
+            ver2 = main.ONOS4.get_version()
+            if ver1==ver2:
+                break
+            elif i==1:
+                main.ONOS2.git_pull("ONOS1 master")
+                main.ONOS3.git_pull("ONOS1 master")
+                main.ONOS4.git_pull("ONOS1 master")
+        #if uptodate==0:
+        if 1:
+            main.ONOS1.git_compile()
+            main.ONOS2.git_compile()
+            main.ONOS3.git_compile()
+            main.ONOS4.git_compile()
+        main.ONOS1.print_version()    
+       # main.RamCloud1.git_pull()
+       # main.RamCloud2.git_pull()
+       # main.RamCloud3.git_pull()
+       # main.RamCloud4.git_pull()
+       # main.ONOS1.get_version()
+       # main.ONOS2.get_version()
+       # main.ONOS3.get_version()
+       # main.ONOS4.get_version()
+        main.RamCloud1.start_coor()
+        time.sleep(1)
+        main.RamCloud1.start_serv()
+        main.RamCloud2.start_serv()
+        main.RamCloud3.start_serv()
+        main.RamCloud4.start_serv()
+        main.ONOS1.start()
+        time.sleep(5)
+        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, RamCloud1, 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 RamCloud")   
+        data =  main.RamCloud1.status_serv() 
+        if data == main.FALSE:
+            main.RamCloud1.stop_coor()
+            main.RamCloud1.stop_serv()
+            main.RamCloud2.stop_serv()
+            main.RamCloud3.stop_serv()
+            main.RamCloud4.stop_serv()
+
+            time.sleep(5)
+            main.RamCloud1.start_coor()
+            main.RamCloud1.start_serv()
+            main.RamCloud2.start_serv()
+            main.RamCloud3.start_serv()
+            main.RamCloud4.start_serv()
+        utilities.assert_equals(expect=main.TRUE,actual=data,onpass="RamCloud is up!",onfail="RamCloud is down...")
+        main.step("Testing startup ONOS")   
+        data = main.ONOS1.isup()
+        if data == main.FALSE: 
+            main.log.report("Something is funny... restarting ONOS")
+            main.ONOS1.stop()
+            time.sleep(3)
+            main.ONOS1.start()
+            time.sleep(5) 
+            data = main.ONOS1.isup()
+        utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
+           
+#**********************************************************************************************************************************************************************************************
+#Assign Controllers
+#This test first checks the ip of a mininet host, to be certain that the mininet exists(Host is defined in Params as <CASE1><destination>).
+#Then the program assignes each ONOS instance a single controller to a switch(To be the initial master), then assigns all controllers.
+#NOTE: The reason why all four controllers are assigned although one was already assigned as the master is due to the 'ovs-vsctl set-controller' command erases all present controllers if
+#      the controllers already assigned to the switch are not specified.
+
+    def CASE2(self,main) :    #Make sure mininet exists, then assign controllers to switches
+        import time
+        main.log.report("Check if mininet started properly, then assign controllers ONOS 1,2,3 and 4")
+        main.case("Checking if one MN host exists")
+        main.step("Host IP Checking using checkIP")
+        result = main.Mininet1.checkIP(main.params['CASE1']['destination'])
+        main.step("Verifying the result")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host IP address configured",onfail="Host IP address not configured")
+        main.step("assigning ONOS controllers to switches")
+        for i in range(25): 
+            if i < 3:
+                j=i+1
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])
+                time.sleep(1)
+                main.Mininet1.assign_sw_controller(sw=str(j),count=4,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),count=4,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),count=4,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),count=4,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")       
+        main.ONOS1.purge()
+ 
+# **********************************************************************************************************************************************************************************************
+#Add Flows
+#Deletes any remnant flows from any previous test, add flows from the file labeled <FLOWDEF>, then runs the check flow test
+#NOTE: THE FLOWDEF FILE MUST BE PRESENT ON TESTON VM!!! TestON will copy the file from its home machine into /tmp/flowtmp on the machine the ONOS instance is present on
+
+    def CASE3(self,main) :    #Delete any remnant flows, then add flows, and time how long it takes flow tables to update
+        main.log.report("Delete any flows from previous tests, then add flows from FLOWDEF file, then wait for switch flow tables to update")
+        import time
+        main.case("Taking care of these flows!") 
+        main.step("Cleaning out any leftover flows...")
+        #main.ONOS1.delete_flow("all")
+        strtTime = time.time()
+        print("hello")
+        main.ONOS1.rm_flow()
+        print("world")
+        main.ONOS1.ad_flow()
+       # main.ONOS1.add_flow(main.params['FLOWDEF']['testONip'],main.params['FLOWDEF']['user'],main.params['FLOWDEF']['password'],main.params['FLOWDEF']['flowDef'])
+        main.case("Checking flows")
+       
+        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 < 9:
+                count = count + 1
+                i = 6
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 2 seconds")
+                time.sleep(2)
+            elif ping == main.FALSE and count ==9:
+                main.log.error("Ping test failed")
+                i = 17
+                result = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result = main.TRUE
+        endTime = time.time()
+        if result == main.TRUE:
+            main.log.report("\tTime to add flows: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tFlows failed check")
+
+        result2 = 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=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 5 seconds before trying again.
+#If the ping test fails 6 times, then the test case will return false
+    def CASE41(self,main) :
+        main.log.report("Testing Removal")
+        main.ONOS2.stop()
+        main.ONOS3.stop()
+        main.ONOS4.stop()
+        strtTime = time.time() 
+        result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+        for i in range(10):
+            if result == main.FALSE:
+                time.sleep(5)
+                result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+            else:
+                break
+
+        count = 1
+        i = 6
+        while i < 16 :
+            main.log.info("\n\t\t\t\th"+str(i)+" IS PINGING h"+str(i+25) )
+            ping = main.Mininet1.pingHost(src="h"+str(i),target="h"+str(i+25))
+            if ping == main.FALSE and count < 6:
+                count = count + 1
+                i = 6
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 2 seconds")
+                time.sleep(2)
+            elif ping == main.FALSE and count ==6:
+                main.log.error("Ping test failed")
+                i = 17
+                result = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result = main.TRUE
+        endTime = time.time() 
+        if result == main.TRUE:
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tPING TEST FAIL")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
+        time.sleep(10)
+        main.ONOS2.start() 
+        main.ONOS3.start()
+        main.ONOS4.start() 
+        time.sleep(10)
+
+
+    def CASE4(self,main) :
+        main.log.report("Remove ONOS 2,3,4 then ping until all hosts are reachable or fail after 6 attempts")
+        import time
+        for i in range(25):
+            if i < 15:
+                j=i+1
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])  #Assigning a single controller removes all other controllers
+            else:
+                j=i+16
+                main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'])
+      
+        strtTime = time.time() 
+        result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+        for i in range(10):
+            if result == main.FALSE:
+                time.sleep(5)
+                result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+            else:
+                break
+
+        count = 1
+        i = 6
+        while i < 16 :
+            main.log.info("\n\t\t\t\th"+str(i)+" IS PINGING h"+str(i+25) )
+            ping = main.Mininet1.pingHost(src="h"+str(i),target="h"+str(i+25))
+            if ping == main.FALSE and count < 6:
+                count = count + 1
+                i = 6
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 2 seconds")
+                time.sleep(2)
+            elif ping == main.FALSE and count ==6:
+                main.log.error("Ping test failed")
+                i = 17
+                result = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result = main.TRUE
+        endTime = time.time() 
+        if result == main.TRUE:
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tPING TEST FAIL")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
+        time.sleep(10)
+
+# **********************************************************************************************************************************************************************************************
+#This test case restores the controllers removed by Case 4 then performs a ping test.
+
+    def CASE5(self,main) :
+        main.log.report("Restore ONOS 2,3,4 then ping until all hosts are reachable or fail after 6 attempts")
+        import time
+        for i in range(25):
+            if i < 15:
+                j=i+1
+                main.Mininet1.assign_sw_controller(sw=str(j),count=4,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),count=4,ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4'])
+      
+        strtTime = time.time() 
+        result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+        for i in range(2):
+            if result == main.FALSE:
+                time.sleep(5)
+                result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+            else:
+                break
+
+        count = 1
+        i = 6
+        while i < 16 :
+            main.log.info("\n\t\t\t\th"+str(i)+" IS PINGING h"+str(i+25) )
+            ping = main.Mininet1.pingHost(src="h"+str(i),target="h"+str(i+25))
+            if ping == main.FALSE and count < 6:
+                count = count + 1
+                i = 6
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 2 seconds")
+                time.sleep(2)
+            elif ping == main.FALSE and count ==6:
+                main.log.error("Ping test failed")
+                i = 17
+                result = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result = main.TRUE
+        endTime = time.time()
+        if result == main.TRUE:
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tPING TEST FAILED")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
+
+# **********************************************************************************************************************************************************************************************
+#Brings a link that all flows pass through in the mininet down, then runs a ping test to view reroute time
+
+    def CASE6(self,main) :
+        main.log.report("Bring Link between s1 and s2 down, then ping until all hosts are reachable or fail after 10 attempts")
+        import time
+        main.case("Bringing Link down... ")
+        result = main.Mininet1.link(END1=main.params['LINK']['begin'],END2=main.params['LINK']['end'],OPTION="down")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Link DOWN!",onfail="Link not brought down...")
+       
+        strtTime = time.time() 
+        result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],str(int(main.params['NR_Links'])-2))
+        for i in range(2):
+            if result == main.FALSE:
+                time.sleep(5)
+                result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],str(int(main.params['NR_Links'])-2))
+            else:
+                break
+
+        count = 1
+        i = 6
+        while i < 16 :
+            main.log.info("\n\t\t\t\th"+str(i)+" IS PINGING h"+str(i+25) )
+            ping = main.Mininet1.pingHost(src="h"+str(i),target="h"+str(i+25))
+            if ping == main.FALSE and count < 10:
+                count = count + 1
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 2 seconds")
+                i = 6
+                time.sleep(2)
+            elif ping == main.FALSE and count == 10:
+                main.log.error("Ping test failed")
+                i = 17
+                result = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result = main.TRUE
+        endTime = time.time()
+        if result == main.TRUE:
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tPING TEST FAILED")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
+
+# **********************************************************************************************************************************************************************************************
+#Brings the link that Case 6 took down  back up, then runs a ping test to view reroute time
+
+    def CASE7(self,main) :
+        main.log.report("Bring Link between s1 and s2 up, then ping until all hosts are reachable or fail after 10 attempts")
+        import time
+        main.case("Bringing Link up... ")
+        result = main.Mininet1.link(END1=main.params['LINK']['begin'],END2=main.params['LINK']['end'],OPTION="up")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Link UP!",onfail="Link not brought up...")
+        time.sleep(5) 
+        strtTime = time.time() 
+        result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+        for i in range(2):
+            if result == main.FALSE:
+                time.sleep(5)
+                result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links'])
+            else:
+                break
+
+        strtTime = time.time()
+        count = 1
+        i = 6
+        while i < 16 :
+            main.log.info("\n\t\t\t\th"+str(i)+" IS PINGING h"+str(i+25) )
+            ping = main.Mininet1.pingHost(src="h"+str(i),target="h"+str(i+25))
+            if ping == main.FALSE and count < 10:
+                count = count + 1
+                main.log.info("Ping failed, making attempt number "+str(count)+" in 2 seconds")
+                i = 6
+                time.sleep(2)
+            elif ping == main.FALSE and count ==10:
+                main.log.error("Ping test failed")
+                i = 17
+                result = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result = main.TRUE
+        endTime = time.time()
+        if result == main.TRUE:
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tPING TESTS FAILED")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
+
+
+# ******************************************************************************************************************************************************************
+# Test Device Discovery function by yanking s6:s6-eth0 interface and re-plug it into a switch
+
+    def CASE21(self,main) :
+        import json
+        main.log.report("Test device discovery function, by attach, detach, move host h1 from s1->s6->s1. Per mininet naming, switch port the host attaches will remain as 's1-eth1' throughout the test.")
+        main.log.report("Check initially hostMAC/IP exist on the mininet...")
+        host = main.params['YANK']['hostname']
+        mac = main.params['YANK']['hostmac']
+        hostip = main.params['YANK']['hostip']
+        RestIP1 = main.params['RESTCALL']['restIP1']
+        RestPort = main.params['RESTCALL']['restPort']
+        url = main.params['RESTCALL']['restURL']
+       
+        t_topowait = 0
+        t_restwait = 10
+        main.log.report( "Wait time from topo change to ping set to " + str(t_topowait))
+        main.log.report( "Wait time from ping to rest call set to " + str(t_restwait))
+        #print "host=" + host + ";  RestIP=" + RestIP1 + ";  RestPort=" + str(RestPort)
+        time.sleep(t_topowait) 
+        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")
+        time.sleep(t_restwait)
+        Reststatus, Switch, Port, MAC = main.ONOS1.find_host(RestIP1,RestPort,url, hostip)
+        main.log.report("Number of host with IP=10.0.0.1 found by ONOS is: " + str(Reststatus))
+        if Reststatus == 1:
+            main.log.report("\t PASSED - Found host IP = " + hostip + "; MAC = " + "".join(MAC) + "; attached to switchDPID = " + "".join(Switch) + "; at port = " + "".join(Port))
+            result1 = main.TRUE
+        elif Reststatus > 1:
+            main.log.report("\t FAILED - Host " + host + " with MAC:" + mac + " has " + str(Reststatus) + " duplicated IP addresses. FAILED")
+            main.log.report("switches are: " + "; ".join(Switch))
+            main.log.report("Ports are: " + "; ".join(Port))
+            main.log.report("MACs are: " + "; ".join(MAC))
+            result1 = main.FALSE
+        elif Reststatus == 0 and Switch == []:
+            main.log.report("\t FAILED - Host " + host + " with MAC:" + mac + " does not exist. FAILED")
+            result1 = main.FALSE
+        else:# check if rest server is working
+            main.log.error("Issue with find host")
+            result1 = 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(t_topowait)
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Yank command suceeded",onfail="Yank command failed...")
+
+        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")
+        time.sleep(t_restwait)
+        Reststatus, Switch, Port, MAC = main.ONOS1.find_host(RestIP1,RestPort,url, hostip)
+
+        main.log.report("Number of host with IP=10.0.0.1 found by ONOS is: " + str(Reststatus))
+        if Reststatus == 1:
+            main.log.report("\tFAILED - Found host IP = " + hostip + "; MAC = " + "".join(MAC) + "; attached to switchDPID = " + "".join(Switch) + "; at port = " + "".join(Port))
+            result2 = main.FALSE
+        elif Reststatus > 1:
+            main.log.report("\t FAILED - Host " + host + " with MAC:" + str(mac) + " has " + str(Reststatus) + " duplicated IP addresses. FAILED")
+            main.log.report("switches are: " + "; ".join(Switch))
+            main.log.report("Ports are: " + "; ".join(Port))
+            main.log.report("MACs are: " + "; ".join(MAC))
+            result2 = main.FALSE
+        elif Reststatus == 0 and Switch == []:
+            main.log.report("\t PASSED - Host " + host + " with MAC:" + str(mac) + " does not exist. PASSED - host is not supposed to be attached to the switch.")
+            result2 = main.TRUE
+        else:# check if rest server is working
+            main.log.error("Issue with find host")
+            result2 = 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(t_topowait)
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Plug command suceeded",onfail="Plug command failed...")
+        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")
+        time.sleep(t_restwait)
+        Reststatus, Switch, Port, MAC = main.ONOS1.find_host(RestIP1,RestPort,url, hostip)
+
+        main.log.report("Number of host with IP=10.0.0.1 found by ONOS is: " + str(Reststatus))
+        if Reststatus == 1:
+            main.log.report("\tPASSED - Found host IP = " + hostip + "; MAC = " + "".join(MAC) + "; attached to switchDPID = " + "".join(Switch) + "; at port = " + "".join(Port))
+            result3 = main.TRUE
+        elif Reststatus > 1:
+            main.log.report("\t FAILED - Host " + host + " with MAC:" + str(mac) + " has " + str(Reststatus) + " duplicated IP addresses. FAILED")
+            main.log.report("switches are: " + "; ".join(Switch))
+            main.log.report("Ports are: " + "; ".join(Port))
+            main.log.report("MACs are: " + "; ".join(MAC))            
+            result3 = main.FALSE
+        elif Reststatus == 0 and Switch == []:
+            main.log.report("\t FAILED - Host " + host + " with MAC:" + str(mac) + " does not exist. FAILED")
+            result3 = main.FALSE
+        else:# check if rest server is working
+            main.log.error("Issue with find host")
+            result3 = 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(t_topowait)
+        result = 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...")
+        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")
+        time.sleep(t_restwait)
+        Reststatus, Switch, Port, MAC = main.ONOS1.find_host(RestIP1,RestPort,url, hostip)
+
+        main.log.report("Number of host with IP=10.0.0.1 found by ONOS is: " + str(Reststatus))
+        if Reststatus == 1:
+            main.log.report("\tPASSED - Found host IP = " + hostip + "; MAC = " + "".join(MAC) + "; attached to switchDPID = " + "".join(Switch) + "; at port = " + "".join(Port))
+            result4 = main.TRUE
+        elif Reststatus > 1:
+            main.log.report("\t FAILED - Host " + host + " with MAC:" + str(mac) + " has " + str(Reststatuas) + " duplicated IP addresses. FAILED")
+            main.log.report("switches are: " + "; ".join(Switch))
+            main.log.report("Ports are: " + "; ".join(Port))
+            main.log.report("MACs are: " + "; ".join(MAC))            
+            result4 = main.FALSE
+        elif Reststatus == 0 and Switch == []:
+            main.log.report("\t FAILED -Host " + host + " with MAC:" + str(mac) + " does not exist. FAILED")
+            result4 = main.FALSE
+        else:# check if rest server is working
+            main.log.error("Issue with find host")
+            result4 = main.FALSE
+
+        result = result1 and result2 and result3 and result4
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="DEVICE DISCOVERY TEST PASSED PLUG/UNPLUG/MOVE TEST",onfail="DEVICE DISCOVERY TEST FAILED")
+
+# Run a pure ping test. 
+
+    def CASE31(self, main):
+        main.log.report("Performing Ping Test")        
+        count = 1
+        i = 6
+        while i < 16 :
+            main.log.info("\n\t\t\t\th"+str(i)+" IS PINGING h"+str(i+25) )
+            strtTime = time.time()
+            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 2 seconds")
+                time.sleep(2)
+            elif ping == main.FALSE and count ==6:
+                main.log.error("Ping test failed")
+                i = 17
+                result = main.FALSE
+            elif ping == main.TRUE:
+                i = i + 1
+                result = main.TRUE
+        endTime = time.time()
+        if result == main.TRUE:
+            main.log.report("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds")
+        else:
+            main.log.report("\tPING TEST FAIL")
+        utilities.assert_equals(expect=main.TRUE,actual=result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE")
+
diff --git a/TestON/tests/RRCOnosSanity4nodesJ/RRCOnosSanity4nodesJ.topo b/TestON/tests/RRCOnosSanity4nodesJ/RRCOnosSanity4nodesJ.topo
new file mode 100644
index 0000000..a03746a
--- /dev/null
+++ b/TestON/tests/RRCOnosSanity4nodesJ/RRCOnosSanity4nodesJ.topo
@@ -0,0 +1,139 @@
+<TOPOLOGY>
+
+    <COMPONENT>
+        <Zookeeper1>
+            <host>10.128.4.151</host>
+            <user>admin</user>
+            <password></password>
+            <type>ZookeeperCliDriver</type>
+            <connect_order>1</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </Zookeeper1>
+
+        <Zookeeper2>
+            <host>10.128.4.152</host>
+            <user>admin</user>
+            <password></password>
+            <type>ZookeeperCliDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </Zookeeper2>
+
+        <Zookeeper3>
+            <host>10.128.4.153</host>
+            <user>admin</user>
+            <password></password>
+            <type>ZookeeperCliDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </Zookeeper3>
+       
+        <Zookeeper4>
+            <host>10.128.4.154</host>
+            <user>admin</user>
+            <password></password>
+            <type>ZookeeperCliDriver</type>
+            <connect_order>4</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </Zookeeper4>
+
+        <RamCloud1>
+            <host>10.128.4.151</host>
+            <user>admin</user>
+            <password></password>
+            <type>RamCloudCliDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </RamCloud1>
+
+        <RamCloud2>
+            <host>10.128.4.152</host>
+            <user>admin</user>
+            <password></password>
+            <type>RamCloudCliDriver</type>
+            <connect_order>6</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </RamCloud2>
+       
+        <RamCloud3>
+            <host>10.128.4.153</host>
+            <user>admin</user>
+            <password></password>
+            <type>RamCloudCliDriver</type>
+            <connect_order>7</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </RamCloud3>
+       
+        <RamCloud4>
+            <host>10.128.4.154</host>
+            <user>admin</user>
+            <password></password>
+            <type>RamCloudCliDriver</type>
+            <connect_order>8</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </RamCloud4>
+
+        <ONOS1>
+            <host>10.128.4.151</host>
+            <user>admin</user>
+            <password></password>
+            <type>OnosCliDriver</type>
+            <connect_order>9</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </ONOS1>
+
+        <ONOS2>
+            <host>10.128.4.152</host>
+            <user>admin</user>
+            <password></password>
+            <type>OnosCliDriver</type>
+            <connect_order>10</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </ONOS2>
+
+        <ONOS3>
+            <host>10.128.4.153</host>
+            <user>admin</user>
+            <password></password>
+            <type>OnosCliDriver</type>
+            <connect_order>11</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </ONOS3>
+       
+        <ONOS4>
+            <host>10.128.4.154</host>
+            <user>admin</user>
+            <password></password>
+            <type>OnosCliDriver</type>
+            <connect_order>12</connect_order>
+            <COMPONENTS>
+             </COMPONENTS>
+        </ONOS4>
+
+        <Mininet1>
+            <host>10.128.4.159</host>
+            <user>admin</user>
+            <password></password>
+            <type>MininetCliDriver</type>
+            <connect_order>13</connect_order>
+            <COMPONENTS>
+                # Specify the Option for mininet
+                <arg1> --custom ~/mininet/custom/topo-onos4nodeNEW.py </arg1>
+                <arg2> --topo mytopo</arg2>
+                <controller> remote </controller>
+             </COMPONENTS>
+        </Mininet1>
+
+    </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/RRCOnosSanity4nodesJ/__init__.py b/TestON/tests/RRCOnosSanity4nodesJ/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/RRCOnosSanity4nodesJ/__init__.py