Fixed new mininet driver completed Ping2topoExample test
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 785aa86..c9b39ea 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -129,7 +129,7 @@
": Something while cleaning MN took too long... " )
"""
- def startNet( self, topoFile = None, args = None ):
+ def startNet( self, topoFile = '', args = '', timeout = 120 ):
self.name = self.options[ 'name' ]
if self.handle:
@@ -141,7 +141,7 @@
'Cleanup\scomplete',
pexpect.EOF,
pexpect.TIMEOUT ],
- 120 )
+ timeout )
if i == 0:
main.log.info( self.name + ": Sending sudo password" )
self.handle.sendline( self.pwd )
@@ -149,7 +149,7 @@
'\$',
pexpect.EOF,
pexpect.TIMEOUT ],
- 120 )
+ timeout )
if i == 1:
main.log.info( self.name + ": Clean" )
elif i == 2:
@@ -158,7 +158,7 @@
main.log.error(
self.name +
": Something while cleaning MN took too long... " )
- if topoFile == None and args == None:
+ if topoFile == '' and args == '':
main.log.info( self.name + ": building fresh mininet" )
# for reactive/PARP enabled tests
cmdString = "sudo mn " + self.options[ 'arg1' ] +\
@@ -183,7 +183,7 @@
'Exception',
pexpect.EOF,
pexpect.TIMEOUT ],
- 300 )
+ timeout )
if i == 0:
main.log.info( self.name + ": mininet built" )
return main.TRUE
@@ -206,14 +206,17 @@
return main.FALSE
return main.TRUE
else:
- self.handle.sendline('sudo ' + topoFile + ' ' + args)
- self.handle.sendline('')
+ main.log.info( "Starting topo file " + topoFile )
+ if args == None:
+ args = ''
+ else:
+ main.log.info( "args = " + args)
+ self.handle.sendline( 'sudo ' + topoFile + ' ' + args)
i = 1
i = self.handle.expect( [ 'mininet>',
pexpect.EOF ,
- pexpect.TIMEOUT ],
- timeout = 2)
- self.handle.expect('mininet>')
+ pexpect.TIMEOUT ],
+ timeout)
main.log.info(self.name + ": Network started")
return main.TRUE
diff --git a/TestON/tests/Ping2topoExample/Ping2topoExample.params b/TestON/tests/Ping2topoExample/Ping2topoExample.params
index 79fa317..651bd4e 100644
--- a/TestON/tests/Ping2topoExample/Ping2topoExample.params
+++ b/TestON/tests/Ping2topoExample/Ping2topoExample.params
@@ -1,13 +1,12 @@
<PARAMS>
- <testcases>1,2,3,4,5,3</testcases>
+ <testcases>1,4,5,3</testcases>
<ENV>
<cellName>kelvin</cellName>
</ENV>
<Git>True</Git>
-
<TOPO1>
<file>~/mininet/examples/attTopo.py</file>
- <args>--mac</args>
+ <args></args>
</TOPO1>
<TOPO2>
diff --git a/TestON/tests/Ping2topoExample/Ping2topoExample.py b/TestON/tests/Ping2topoExample/Ping2topoExample.py
index f2c7062..cbf2cc0 100644
--- a/TestON/tests/Ping2topoExample/Ping2topoExample.py
+++ b/TestON/tests/Ping2topoExample/Ping2topoExample.py
@@ -1,10 +1,12 @@
"""
Description: This test is an example of a simple single node ONOS test
-
+with 2 different topology on one test test
List of test cases:
-CASE1: Compile ONOS and push it to the test machine
-CASE2: Assign mastership to controller
+CASE1: Compile ONOS and push it to the test machine: Also starts first topology
+CASE2: Assign mastership to controller: first topology
CASE3: Pingall
+CASE4: Creates new topology: second topology
+CASE5: Assign mastership to controller: second topology
"""
class Ping2topoExample:
@@ -104,7 +106,7 @@
def CASE2( self, main ):
"""
- Assign mastership to controller
+ Assign mastership to controller : topology 1 has 13 switches
"""
import re
@@ -172,6 +174,7 @@
"""
Stop mininet and start a new one using different topology
"""
+ main.log.info ("Starts new topology")
main.log.info( "Stopping Mininet..." )
main.Mininet1.stopNet()
@@ -191,7 +194,7 @@
def CASE5( self, main ):
"""
- Assign mastership to controller
+ Assign mastership to controller: topology 2 has 25 switches
"""
import re
@@ -202,14 +205,14 @@
ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- for i in range( 1, 25 ):
+ for i in range( 1, 26 ):
main.Mininet1.assignSwController(
sw=str( i ),
ip1=ONOS1Ip,
port1=ONOS1Port )
mastershipCheck = main.TRUE
- for i in range( 1, 25 ):
+ for i in range( 1, 26 ):
response = main.Mininet1.getSwController( "s" + str( i ) )
try:
main.log.info( str( response ) )
diff --git a/TestON/tests/PingallExample/PingallExample.params b/TestON/tests/PingallExample/PingallExample.params
index 09a6adc..85a576e 100644
--- a/TestON/tests/PingallExample/PingallExample.params
+++ b/TestON/tests/PingallExample/PingallExample.params
@@ -1,5 +1,5 @@
<PARAMS>
- <testcases>1,2,3,4</testcases>
+ <testcases>1,2,3</testcases>
<ENV>
<cellName>kelvin</cellName>
</ENV>