Merging conflicts
Merge branch 'ONOS-Next' of https://github.com/OPENNETWORKINGLAB/ONLabTest into ONOS-Next
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index a003f1b..095bae7 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -115,7 +115,10 @@
                 main.log.error(self.name + ":     " + self.handle.before)
                 main.cleanup()
                 main.exit()
-            pattern = 'Results\:\s0\%\sdropped\s\(0\/\d+\slost\)\s*$'
+            pattern = 'Results\:\s0\%\sdropped\s'
+            #FIXME:Pending Mininet Pull Request #408
+            #pattern = 'Results\:\s0\.00\%\sdropped\s'
+            print response
             #if utilities.assert_matches(expect=pattern,actual=response,onpass="All hosts are reaching",onfail="Unable to reach all the hosts"):
             if re.search(pattern,response):
                 main.log.info(self.name+": All hosts are reachable")
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index ba3f34f..9c225f1 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -140,7 +140,6 @@
                     'BUILD\sSUCCESS',
                     'ONOS\$',
                     pexpect.TIMEOUT],timeout=600)
-                #TODO: log the build time
                 if i == 0:
                     main.log.error(self.name + ":There is insufficient memory \
                             for the Java Runtime Environment to continue.")
@@ -156,6 +155,10 @@
                     main.log.info(self.name + ": Build success!")
                 elif i == 3:
                     main.log.info(self.name + ": Build complete")
+                    #Print the build time
+                    for line in self.handle.before.splitlines():
+                        if "Total time:" in line:
+                            main.log.info(line)
                     self.handle.sendline("\n")
                     self.handle.expect("\$", timeout=60)
                     return main.TRUE
diff --git a/TestON/tests/ONOSNextTest/ONOSNextTest.params b/TestON/tests/ONOSNextTest/ONOSNextTest.params
index 92727b5..0d7ff11 100755
--- a/TestON/tests/ONOSNextTest/ONOSNextTest.params
+++ b/TestON/tests/ONOSNextTest/ONOSNextTest.params
@@ -9,6 +9,7 @@
 
     <CTRL>
         <ip1>10.128.20.11</ip1>
+        <port1>6633</port1>
     </CTRL>
 
 </PARAMS>
diff --git a/TestON/tests/ONOSNextTest/ONOSNextTest.py b/TestON/tests/ONOSNextTest/ONOSNextTest.py
index c5df1ce..c812295 100755
--- a/TestON/tests/ONOSNextTest/ONOSNextTest.py
+++ b/TestON/tests/ONOSNextTest/ONOSNextTest.py
@@ -21,15 +21,23 @@
         onos-install -f
         onos-wait-for-start
         '''
+        import re
+        import time
         
         cell_name = main.params['ENV']['cellName']
         ONOS1_ip = main.params['CTRL']['ip1']
+        ONOS1_port = main.params['CTRL']['port1']
         
         main.case("Setting up test environment")
+        
+        main.step("Git checkout and pull master")
+        main.ONOSbench.git_checkout("master")
+        git_pull_result = main.ONOSbench.git_pull()
+
 
         main.step("Using mvn clean & install")
-        #clean_install_result = main.ONOSbench.clean_install()
-        clean_install_result = main.TRUE
+        clean_install_result = main.ONOSbench.clean_install()
+        #clean_install_result = main.TRUE
 
         main.step("Creating ONOS package")
         package_result = main.ONOSbench.onos_package()
@@ -45,9 +53,33 @@
         main.step("Starting ONOS service")
         start_result = main.ONOSbench.onos_start(ONOS1_ip)
 
+        main.step("Assigning switches to controllers")
+        for i in range(1,29):
+            main.Mininet1.assign_sw_controller(sw=str(i), 
+                    ip1=ONOS1_ip, port1=ONOS1_port)
+        switch_mastership = main.TRUE
+        for i in range (1,29):
+            response = main.Mininet1.get_sw_controller("s"+str(i))
+            print("Response is " + str(response))
+            if re.search("tcp:"+ONOS1_ip,response):
+                switch_mastership = switch_mastership and main.TRUE
+            else:
+                switch_mastership = main.FALSE
+
+        #REACTIVE FWD test
+        main.step("Pingall")
+        ping_result = main.FALSE
+        while ping_result == main.FALSE:
+            time1 = time.time()
+            ping_result = main.Mininet1.pingall()
+            time2 = time.time()
+            print "Time for pingall: %2f seconds" % (time2 - time1)
+        
+
         case1_result = (clean_install_result and package_result and\
                 cell_result and verify_result and onos_install_result and\
-                onos1_isup and start_result)
+                onos1_isup and start_result and ping_result and\
+                switch_mastership)
         utilities.assert_equals(expect=main.TRUE, actual=case1_result,
                 onpass="Test startup successful",
                 onfail="Test startup NOT successful")
diff --git a/TestON/tests/ONOSNextTest/ONOSNextTest.topo b/TestON/tests/ONOSNextTest/ONOSNextTest.topo
index a5c6237..03647fc 100755
--- a/TestON/tests/ONOSNextTest/ONOSNextTest.topo
+++ b/TestON/tests/ONOSNextTest/ONOSNextTest.topo
@@ -24,11 +24,12 @@
             <user>admin</user>
             <password>onos_test</password>
             <type>MininetCliDriver</type>
-            <connect_order>2</connect_order>
+            <connect_order>3</connect_order>
             <COMPONENTS>
-                <arg1> </arg1>
-                <arg2> </arg2>
-                <controller>remote</controller>
+                #Specify the Option for mininet
+                <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
+                <arg2> --topo mytopo</arg2>
+                <controller> remote </controller>
             </COMPONENTS>
         </Mininet1>