Fix issues with master SR-stratum pipelines
Change-Id: I3eb04740228c9aa1c4cca8a651d532ec5b03d800
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 94664ad..682760a 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -360,7 +360,7 @@
self.handle.sendline( cmd )
startTime = time.time()
while True:
- i = self.handle.expect( [ "mininet>", "X",
+ i = self.handle.expect( [ self.mnPrompt, "X",
pexpect.EOF,
pexpect.TIMEOUT ],
timeout )
@@ -399,9 +399,9 @@
": " +
str( response ) )
# NOTE: Send ctrl-c to make sure pingall is done
- self.exitFromCmd( [ "Interrupt", "mininet>" ] )
+ self.exitFromCmd( [ "Interrupt", self.mnPrompt ] )
self.handle.sendline( "" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
break
pattern = "Results\:"
main.log.info( "Pingall output: " + str( response ) )
@@ -411,9 +411,9 @@
return returnValue
else:
# NOTE: Send ctrl-c to make sure pingall is done
- self.exitFromCmd( [ "Interrupt", "mininet>" ] )
+ self.exitFromCmd( [ "Interrupt", self.mnPrompt ] )
self.handle.sendline( "" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
return main.FALSE
else:
main.log.error( self.name + ": Connection failed to the host" )
@@ -487,7 +487,7 @@
# Current host pings all other hosts specified
pingCmd = str( host ) + cmd + str( temp )
self.handle.sendline( pingCmd )
- self.handle.expect( "mininet>", timeout=wait + 5 )
+ self.handle.expect( self.mnPrompt, timeout=wait + 5 )
response = self.handle.before
if re.search( ',\s0\%\spacket\sloss', response ):
pingResponse += str( " h" + str( temp[ 1: ] ) )
@@ -504,10 +504,10 @@
main.log.exception( self.name + ": TIMEOUT exception" )
response = self.handle.before
# NOTE: Send ctrl-c to make sure command is stopped
- self.exitFromCmd( [ "Interrupt", "mininet>" ] )
+ self.exitFromCmd( [ "Interrupt", self.mnPrompt ] )
response += self.handle.before + self.handle.after
self.handle.sendline( "" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response += self.handle.before + self.handle.after
main.log.debug( response )
return main.FALSE
@@ -550,7 +550,7 @@
while failedPings <= acceptableFailed:
main.log.debug( "Pinging from " + str( host ) + " to " + str( temp ) )
self.handle.sendline( pingCmd )
- self.handle.expect( "mininet>", timeout=wait + 5 )
+ self.handle.expect( self.mnPrompt, timeout=wait + 5 )
response = self.handle.before
if re.search( ',\s0\%\spacket\sloss', response ):
pingResponse += " " + str( temp )
@@ -572,10 +572,10 @@
main.log.exception( self.name + ": TIMEOUT exception" )
response = self.handle.before
# NOTE: Send ctrl-c to make sure command is stopped
- self.exitFromCmd( [ "Interrupt", "mininet>" ] )
+ self.exitFromCmd( [ "Interrupt", self.mnPrompt ] )
response += self.handle.before + self.handle.after
self.handle.sendline( "" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response += self.handle.before + self.handle.after
main.log.debug( response )
return main.FALSE
@@ -630,19 +630,19 @@
discoveryResult = main.FALSE
if flushCmd:
self.handle.sendline( flushCmd )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
for cmd in cmds:
self.handle.sendline( cmd )
- self.handle.expect( "mininet>", timeout=wait + 5 )
+ self.handle.expect( self.mnPrompt, timeout=wait + 5 )
return discoveryResult
except pexpect.TIMEOUT:
main.log.exception( self.name + ": TIMEOUT exception" )
response = self.handle.before
# NOTE: Send ctrl-c to make sure command is stopped
- self.exitFromCmd( [ "Interrupt", "mininet>" ] )
+ self.exitFromCmd( [ "Interrupt", self.mnPrompt ] )
response += self.handle.before + self.handle.after
self.handle.sendline( "" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response += self.handle.before + self.handle.after
main.log.debug( response )
return main.FALSE
@@ -680,7 +680,7 @@
while failedPings <= acceptableFailed:
main.log.debug( "Pinging from " + str( host ) + " to " + str( temp ) )
self.handle.sendline( pingCmd )
- self.handle.expect( "mininet>", timeout=wait + 5 )
+ self.handle.expect( self.mnPrompt, timeout=wait + 5 )
response = self.handle.before
if re.search( ',\s0\%\spacket\sloss', response ):
pingResponse += " " + str( temp )
@@ -703,10 +703,10 @@
main.log.exception( self.name + ": TIMEOUT exception" )
response = self.handle.before
# NOTE: Send ctrl-c to make sure command is stopped
- self.exitFromCmd( [ "Interrupt", "mininet>" ] )
+ self.exitFromCmd( [ "Interrupt", self.mnPrompt ] )
response += self.handle.before + self.handle.after
self.handle.sendline( "" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response += self.handle.before + self.handle.after
main.log.debug( response )
return main.FALSE
@@ -738,7 +738,7 @@
self.name +
": timeout when waiting for response from mininet" )
main.log.error( "response: " + str( self.handle.before ) )
- i = self.handle.expect( [ "mininet>", pexpect.TIMEOUT ] )
+ i = self.handle.expect( [ self.mnPrompt, pexpect.TIMEOUT ] )
if i == 1:
main.log.error(
self.name +
@@ -783,7 +783,7 @@
self.name +
": timeout when waiting for response from mininet" )
main.log.error( "response: " + str( self.handle.before ) )
- i = self.handle.expect( [ "mininet>", pexpect.TIMEOUT ] )
+ i = self.handle.expect( [ self.mnPrompt, pexpect.TIMEOUT ] )
if i == 1:
main.log.error(
self.name +
@@ -873,7 +873,7 @@
response = self.execute(
cmd=host +
" ifconfig",
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
@@ -904,17 +904,17 @@
try:
response = self.execute(
cmd="h1 /usr/sbin/sshd -D&",
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
response = self.execute(
cmd="h4 /usr/sbin/sshd -D&",
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
for key in connectargs:
vars( self )[ key ] = connectargs[ key ]
response = self.execute(
cmd="xterm h1 h4 ",
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
@@ -937,7 +937,7 @@
cmd = host + " ifconfig " + intf + " " + \
newIP + " " + 'netmask' + " " + newNetmask
self.handle.sendline( cmd )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
main.log.info( "response = " + response )
main.log.info(
@@ -966,7 +966,7 @@
try:
cmd = host + " route add default gw " + newGW
self.handle.sendline( cmd )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
main.log.info( "response = " + response )
main.log.info(
@@ -1001,7 +1001,7 @@
cmd += " route add -host "
cmd += str( dstIP ) + " " + str( interface )
self.handle.sendline( cmd )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
main.log.debug( "response = " + response )
return main.TRUE
@@ -1025,7 +1025,7 @@
# h1 arp -s 10.0.1.254 00:00:00:00:11:11
cmd = host + " arp -s " + GW + " " + macaddr
self.handle.sendline( cmd )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
main.log.info( "response = " + response )
main.log.info(
@@ -1054,7 +1054,7 @@
# h1 arp -an
cmd = host + " arp -an "
self.handle.sendline( cmd )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
main.log.info( host + " arp -an = " + response )
return main.TRUE
@@ -1078,7 +1078,7 @@
response = self.execute(
cmd=host +
" ifconfig",
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
@@ -1107,7 +1107,7 @@
if self.handle:
try:
response = self.execute( cmd=host + " ifconfig " + interface,
- prompt="mininet>", timeout=10 )
+ prompt=self.mnPrompt, timeout=10 )
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
main.log.error( self.name + ": " + self.handle.before )
@@ -1141,7 +1141,7 @@
response = self.execute(
cmd=host +
" ifconfig",
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
@@ -1181,7 +1181,7 @@
try:
response = self.execute(
cmd=cmd,
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
@@ -1204,14 +1204,14 @@
def getDPID( self, switch ):
if self.handle:
self.handle.sendline( "" )
- self.expect( "mininet>" )
+ self.expect( self.mnPrompt )
cmd = "py %s.dpid" % switch
try:
response = self.execute(
cmd=cmd,
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
return response
except pexpect.TIMEOUT:
@@ -1236,7 +1236,7 @@
try:
response = self.execute(
cmd=cmd,
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10,
logCmd=False )
except pexpect.EOF:
@@ -1341,7 +1341,7 @@
# Setup the mininet command
cmd1 = 'iperf ' + host1 + " " + host2
self.handle.sendline( cmd1 )
- outcome = self.handle.expect( "mininet>", timeout )
+ outcome = self.handle.expect( self.mnPrompt, timeout )
response = self.handle.before
# checks if there are results in the mininet response
@@ -1375,9 +1375,9 @@
main.log.error( self.name + " response: " +
repr( self.handle.before ) )
# NOTE: Send ctrl-c to make sure iperf is done
- self.exitFromCmd( [ "Interrupt", "mininet>" ] )
+ self.exitFromCmd( [ "Interrupt", self.mnPrompt ] )
self.handle.sendline( "" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
return main.FALSE
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
@@ -1393,10 +1393,10 @@
IP1 = self.getIPAddress( host1, proto='IPV6' )
cmd1 = host1 + ' iperf -V -sD -B ' + str( IP1 )
self.handle.sendline( cmd1 )
- outcome1 = self.handle.expect( "mininet>" )
+ outcome1 = self.handle.expect( self.mnPrompt )
cmd2 = host2 + ' iperf -V -c ' + str( IP1 ) + ' -t 5'
self.handle.sendline( cmd2 )
- outcome2 = self.handle.expect( "mininet>" )
+ outcome2 = self.handle.expect( self.mnPrompt )
response1 = self.handle.before
response2 = self.handle.after
print response1, response2
@@ -1410,9 +1410,9 @@
except pexpect.TIMEOUT:
main.log.error( self.name + ": TIMEOUT exception found" )
main.log.error( self.name + " response: " + repr( self.handle.before ) )
- self.exitFromCmd( [ "Interrupt", "mininet>" ] )
+ self.exitFromCmd( [ "Interrupt", self.mnPrompt ] )
self.handle.sendline( "" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
return main.FALSE
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
@@ -1456,7 +1456,7 @@
# setup the mininet command
cmd = 'iperfudp ' + bandwidth + " " + host1 + " " + host2
self.handle.sendline( cmd )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
# check if there are in results in the mininet response
@@ -1552,7 +1552,7 @@
main.log.info( "Bring link between " + str( end1 ) + " and " + str( end2 ) + " " + str( option ) )
cmd = "link {} {} {}".format( end1, end2, option )
self.handle.sendline( cmd )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
main.log.info( response )
if "not in network" in response:
@@ -1580,7 +1580,7 @@
main.log.info( command )
try:
self.handle.sendline( command )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
except pexpect.TIMEOUT:
main.log.error( self.name + ": TIMEOUT exception found" )
main.log.error( self.name + ": " + self.handle.before )
@@ -1603,7 +1603,7 @@
main.log.info( command )
try:
- response = self.execute( cmd = command, prompt = "mininet>" )
+ response = self.execute( cmd = command, prompt = self.mnPrompt )
if re.search( "Unknown command", response ):
main.log.warn( response )
return main.FALSE
@@ -1629,7 +1629,7 @@
try:
response = self.execute(
cmd=command,
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
@@ -1651,7 +1651,7 @@
try:
response = self.execute(
cmd=command,
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
@@ -1673,7 +1673,7 @@
try:
response = self.execute(
cmd=command,
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
@@ -1711,7 +1711,7 @@
try:
response = self.execute(
cmd=command,
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
if response:
if "no bridge named" in response:
@@ -1847,7 +1847,7 @@
for cmd in commandList:
try:
- self.execute( cmd=cmd, prompt="mininet>", timeout=5 )
+ self.execute( cmd=cmd, prompt=self.mnPrompt, timeout=5 )
if "no bridge named" in self.handle.before:
main.log.error( self.name + ": Error in assignSwController: " +
self.handle.before )
@@ -1874,7 +1874,7 @@
try:
response = self.execute(
cmd=command,
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
@@ -1903,7 +1903,7 @@
try:
response = self.execute(
cmd=command,
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
if re.search( "already exists!", response ):
main.log.warn( response )
@@ -1936,7 +1936,7 @@
try:
response = self.execute(
cmd=command,
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
if re.search( "no switch named", response ):
main.log.warn( response )
@@ -2041,7 +2041,7 @@
try:
response = self.execute(
cmd=command,
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
if re.search( "doesnt exist!", response ):
main.log.warn( response )
@@ -2076,7 +2076,7 @@
try:
response = self.execute(
cmd=command,
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
if re.search( "no node named", response ):
main.log.warn( response )
@@ -2188,7 +2188,7 @@
try:
response = self.execute(
cmd=command,
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
if re.search( "already exists!", response ):
main.log.warn( response )
@@ -2225,7 +2225,7 @@
try:
response = self.execute(
cmd=command,
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
if re.search( "no host named", response ):
main.log.warn( response )
@@ -2291,17 +2291,24 @@
if self.handle:
try:
self.handle.sendline( "" )
- i = self.handle.expect( [ 'mininet>',
- self.prompt,
+ i = self.handle.expect( [ self.mnPrompt,
+ self.bashPrompt,
pexpect.EOF,
pexpect.TIMEOUT ],
timeout )
if i == 0:
main.log.info( "Exiting mininet.." )
startTime = time.time()
- response = self.execute( cmd="exit",
- prompt=self.prompt,
- timeout=exitTimeout )
+ self.handle.sendline( "exit" )
+ exitRet = 1
+ while not exitRet:
+ exitRet = self.handle.expect( [ self.bashprompt,
+ "Traceback",
+ "AssertionError",
+ self.mnPrompt ],
+ timeout=exitTimeout )
+ response += self.handle.before + self.handle.after
+ main.log.debug( response )
main.log.info( self.name + ": Stopped\nTime Took : " + str( time.time() - startTime ) )
cmd = "mn -c"
if self.sudoRequired:
@@ -2371,12 +2378,12 @@
if output:
main.log.info( "Sending: " + cmd )
self.handle.sendline( cmd )
- i = self.handle.expect( [ "mininet>", "arping: " ] )
+ i = self.handle.expect( [ self.mnPrompt, "arping: " ] )
if i == 0:
return main.TRUE
elif i == 1:
response = self.handle.before + self.handle.after
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response += self.handle.before + self.handle.after
main.log.warn( "Error sending arping, output was: " +
response )
@@ -2404,7 +2411,7 @@
try:
response = self.execute(
cmd=cmd,
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
@@ -2433,7 +2440,7 @@
try:
response = self.execute(
cmd=command,
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10 )
return response
except pexpect.EOF:
@@ -2605,7 +2612,7 @@
main.log.info( "Sending: " + cmd )
self.handle.sendline( cmd )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
response = response.split( "\r\n" )
# dump the first two elements and the last
@@ -2689,7 +2696,7 @@
intf can be specified, or the default eth0 is used"""
try:
self.handle.sendline( "" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
if self.sudoRequired:
sudoStr = "sudo "
else:
@@ -2702,11 +2709,11 @@
i = self.handle.expect( [ 'No\ssuch\device',
'listening\son',
pexpect.TIMEOUT,
- "mininet>" ],
+ self.mnPrompt ],
timeout=10 )
main.log.warn( self.handle.before + self.handle.after )
self.handle.sendline( "" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
if i == 0:
main.log.error(
self.name +
@@ -2747,9 +2754,9 @@
else:
sudoStr = ""
self.handle.sendline( "sh " + sudoStr + " pkill tcpdump" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
self.handle.sendline( "" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
except pexpect.TIMEOUT:
main.log.error( self.name + ": TIMEOUT exception found" )
main.log.error( self.name + ": " + self.handle.before )
@@ -2826,7 +2833,7 @@
try:
response = self.execute(
cmd=command,
- prompt="mininet>",
+ prompt=self.mnPrompt,
timeout=10,
logCmd=False )
ports = []
@@ -3382,7 +3389,7 @@
continue
ipList = []
self.handle.sendline( str( hostName ) + " ip a" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
ipa = self.handle.before
ipv4Pattern = r'inet ((?:[0-9]{1,3}\.){3}[0-9]{1,3})/'
ipList += re.findall( ipv4Pattern, ipa )
@@ -3416,17 +3423,17 @@
Don't ask questions just use it"""
try:
self.handle.sendline( "" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
self.handle.sendline( "py [ host.name for host in net.hosts ]" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
handlePy = self.handle.before
handlePy = handlePy.split( "]\r\n", 1 )[ 1 ]
handlePy = handlePy.rstrip()
self.handle.sendline( "" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
hostStr = handlePy.replace( "]", "" )
hostStr = hostStr.replace( "'", "" )
@@ -3460,17 +3467,17 @@
# Getting all the nodes in mininet
self.handle.sendline( "" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
self.handle.sendline( "py [ node.name for node in net.values() ]" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
handlePy = self.handle.before
handlePy = handlePy.split( "]\r\n", 1 )[ 1 ]
handlePy = handlePy.rstrip()
self.handle.sendline( "" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
nodesStr = handlePy.replace( "]", "" )
nodesStr = nodesStr.replace( "'", "" )
@@ -3628,23 +3635,23 @@
main.log.info( "Updating MN port information" )
try:
self.handle.sendline( "" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
# If update command isn't available, do it manually
self.handle.sendline( "update" )
self.handle.expect( "update" )
- i = self.handle.expect( [ "Unknown command: update", "mininet>" ], timeout )
+ i = self.handle.expect( [ "Unknown command: update", self.mnPrompt ], timeout )
if i == 0:
main.log.debug( self.handle.before + self.handle.after )
main.log.warn( "Mininet cli does not have update command, attempting to update interfaces without it" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
self.handle.sendline( "px [i.updateAddr() for h in net.hosts for i in h.intfs.values() ] " )
- self.handle.expect( "mininet>", timeout )
+ self.handle.expect( self.mnPrompt, timeout )
self.handle.sendline( "px [i.updateAddr() for s in net.switches for i in h.intfs.values() ] " )
- self.handle.expect( "mininet>", timeout )
+ self.handle.expect( self.mnPrompt, timeout )
self.handle.sendline( "" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
return main.TRUE
except pexpect.TIMEOUT:
@@ -3684,7 +3691,7 @@
main.log.info( "Remove IP from interface " )
cmd2 = host + " ifconfig " + intf + " " + " inet 0 "
self.handle.sendline( cmd2 )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
main.log.info( "====> %s ", response )
@@ -3693,7 +3700,7 @@
main.log.info( "Create Vlan" )
cmd3 = host + " vconfig add " + intf + " " + vlan
self.handle.sendline( cmd3 )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
main.log.info( "====> %s ", response )
@@ -3703,7 +3710,7 @@
vintf = intf + "." + vlan
cmd4 = host + " ifconfig " + vintf + " " + " inet " + ipaddr
self.handle.sendline( cmd4 )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
main.log.info( "====> %s ", response )
@@ -3711,13 +3718,13 @@
main.log.info( "Update Mininet node variables" )
cmd5 = "px %s.defaultIntf().name='%s'" % ( host, vintf )
self.handle.sendline( cmd5 )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
main.log.info( "====> %s ", response )
cmd6 = "px %s.nameToIntf['%s']=%s.defaultIntf()" % ( host, vintf, host )
self.handle.sendline( cmd6 )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
main.log.info( "====> %s ", response )
@@ -3758,7 +3765,7 @@
main.log.info( "Remove Vlan interface" )
cmd2 = host + " vconfig rem " + intf
self.handle.sendline( cmd2 )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
main.log.info( "====> %s ", response )
@@ -3768,20 +3775,20 @@
original_intf = intf.split(".")[0]
cmd3 = host + " ifconfig " + original_intf + " " + " inet " + ipaddr
self.handle.sendline( cmd3 )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
main.log.info( "====> %s ", response )
# update Mininet node variables
cmd4 = "px %s.defaultIntf().name='%s'" % ( host, original_intf )
self.handle.sendline( cmd4 )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
main.log.info( "====> %s ", response )
cmd5 = "px %s.nameToIntf['%s']=%s.defaultIntf()" % ( host, original_intf, host )
self.handle.sendline( cmd5 )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
response = self.handle.before
main.log.info( "====> %s ", response )
@@ -3927,7 +3934,7 @@
try:
cmd = devicename + " ifconfig " + intf + " " + status
self.handle.sendline( cmd )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
return main.TRUE
except pexpect.TIMEOUT:
main.log.exception( self.name + ": Command timed out" )
@@ -4009,7 +4016,7 @@
for cmd in commands:
main.log.info( "cmd={}".format( cmd ) )
self.handle.sendline( cmd )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
main.log.info( "====> %s ", self.handle.before )
return main.TRUE
except pexpect.TIMEOUT:
@@ -4116,7 +4123,7 @@
for cmd in commands:
main.log.info( "cmd={}".format( cmd ) )
self.handle.sendline( cmd )
- self.handle.expect( "mininet>" )
+ self.handle.expect( self.mnPrompt )
main.log.info( "====> %s ", self.handle.before )
return main.TRUE
except pexpect.TIMEOUT:
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params
index 1d44485..7a2e9fa 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params
@@ -22,6 +22,7 @@
<lib>routinglib.py,trellislib.py</lib>
<conf>bgpdbgp1.conf,bgpdbgp2.conf,bgpdr1.conf,bgpdr2.conf,dhcpd6.conf,dhcpd.conf,zebradbgp1.conf,zebradbgp2.conf</conf>
<trellisOar>/home/sdn/segmentrouting-oar-3.0.0-SNAPSHOT.oar</trellisOar>
+ <t3Oar>/home/sdn/t3-app-3.0.0-SNAPSHOT.oar</t3Oar>
</DEPENDENCY>
<ENV>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params.stratum b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params.stratum
index f530cf9..f230714 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params.stratum
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params.stratum
@@ -22,6 +22,8 @@
<topology>trellis_fabric.py</topology>
<lib>routinglib.py,trellislib.py</lib>
<conf>bgpdbgp1.conf,bgpdbgp2.conf,bgpdr1.conf,bgpdr2.conf,dhcpd6.conf,dhcpd.conf,zebradbgp1.conf,zebradbgp2.conf</conf>
+ <trellisOar>/home/sdn/segmentrouting-oar-3.0.0-SNAPSHOT.oar</trellisOar>
+ <t3Oar>/home/sdn/t3-app-3.0.0-SNAPSHOT.oar</t3Oar>
</DEPENDENCY>
<MN_DOCKER>
@@ -32,7 +34,7 @@
<ENV>
<cellName>productionCell</cellName>
- <cellApps>drivers,segmentrouting,openflow,fpm,netcfghostprovider,drivers.bmv2,pipelines.fabric</cellApps>
+ <cellApps>drivers,openflow,fpm,netcfghostprovider,drivers.bmv2,pipelines.fabric</cellApps>
</ENV>
<ONOS_Configuration>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params.tofino b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params.tofino
index c495160..c512f4e 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params.tofino
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params.tofino
@@ -20,6 +20,8 @@
<stratumRoot>~/stratum</stratumRoot>
<topology>trellis_fabric.py</topology>
<lib>routinglib.py,trellislib.py</lib>
+ <trellisOar>/home/sdn/segmentrouting-oar-3.0.0-SNAPSHOT.oar</trellisOar>
+ <t3Oar>/home/sdn/t3-app-3.0.0-SNAPSHOT.oar</t3Oar>
</DEPENDENCY>
<jsonFileSuffix>.hw</jsonFileSuffix>
@@ -32,7 +34,7 @@
<ENV>
<cellName>productionCell</cellName>
- <cellApps>drivers,segmentrouting,openflow,fpm,netcfghostprovider,drivers.bmv2,pipelines.fabric,drivers.barefoot</cellApps>
+ <cellApps>drivers,openflow,fpm,netcfghostprovider,drivers.bmv2,pipelines.fabric,drivers.barefoot</cellApps>
</ENV>
<EXTERNAL_APPS>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params
index e52c4a7..0cddcd8 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params
@@ -19,6 +19,7 @@
<lib>routinglib.py,trellislib.py</lib>
<conf>dhcpd.conf,dhcpd6.conf,bgpdr1.conf,bgpdr2.conf,bgpdbgp1.conf,zebradbgp1.conf,bgpdbgp2.conf,zebradbgp2.conf</conf>
<trellisOar>/home/sdn/segmentrouting-oar-3.0.0-SNAPSHOT.oar</trellisOar>
+ <t3Oar>/home/sdn/t3-app-3.0.0-SNAPSHOT.oar</t3Oar>
</DEPENDENCY>
<ENV>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params.stratum b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params.stratum
index e727787..a20adb6 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params.stratum
+++ b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params.stratum
@@ -20,6 +20,8 @@
<topology>trellis_fabric.py</topology>
<lib>routinglib.py,trellislib.py</lib>
<conf>dhcpd.conf,dhcpd6.conf,bgpdr1.conf,bgpdr2.conf,bgpdbgp1.conf,zebradbgp1.conf,bgpdbgp2.conf,zebradbgp2.conf</conf>
+ <trellisOar>/home/sdn/segmentrouting-oar-3.0.0-SNAPSHOT.oar</trellisOar>
+ <t3Oar>/home/sdn/t3-app-3.0.0-SNAPSHOT.oar</t3Oar>
</DEPENDENCY>
<MN_DOCKER>
@@ -30,7 +32,7 @@
<ENV>
<cellName>productionCell</cellName>
- <cellApps>drivers,openflow,segmentrouting,fpm,dhcprelay,netcfghostprovider,routeradvertisement,drivers.bmv2,pipelines.fabric</cellApps>
+ <cellApps>drivers,openflow,fpm,dhcprelay,netcfghostprovider,routeradvertisement,drivers.bmv2,pipelines.fabric</cellApps>
</ENV>
<GIT>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDynamicConf/SRDynamicConf.params b/TestON/tests/USECASE/SegmentRouting/SRDynamicConf/SRDynamicConf.params
index ea42a59..89885f3 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRDynamicConf/SRDynamicConf.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRDynamicConf/SRDynamicConf.params
@@ -18,6 +18,7 @@
<topology>trellis_fabric.py</topology>
<lib>routinglib.py,trellislib.py</lib>
<trellisOar>/home/sdn/segmentrouting-oar-3.0.0-SNAPSHOT.oar</trellisOar>
+ <t3Oar>/home/sdn/t3-app-3.0.0-SNAPSHOT.oar</t3Oar>
</DEPENDENCY>
<ENV>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.params.flex b/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.params.flex
index ba58a59..1902cff 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.params.flex
+++ b/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.params.flex
@@ -18,11 +18,13 @@
<topology>hagg_fabric.py</topology>
<lib>routinglib.py,trellislib.py</lib>
<conf>bgpdbgp1.conf,bgpdbgp2.conf,bgpdr1.conf,bgpdr2.conf,dhcpd6.conf,dhcpd.conf,zebradbgp1.conf,zebradbgp2.conf</conf>
+ <trellisOar>/home/sdn/segmentrouting-oar-3.0.0-SNAPSHOT.oar</trellisOar>
+ <t3Oar>/home/sdn/t3-app-3.0.0-SNAPSHOT.oar</t3Oar>
</DEPENDENCY>
<ENV>
<cellName>productionCell</cellName>
- <cellApps>drivers,segmentrouting,openflow,fpm,dhcprelay,netcfghostprovider,routeradvertisement,t3,mcast,hostprobingprovider</cellApps>
+ <cellApps>drivers,openflow,fpm,dhcprelay,netcfghostprovider,routeradvertisement,mcast,hostprobingprovider</cellApps>
</ENV>
<GIT>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params.flex b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params.flex
index 4b26f3b..5351709 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params.flex
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params.flex
@@ -18,11 +18,13 @@
<topology>hagg_fabric.py</topology>
<lib>routinglib.py,trellislib.py,trellis_fabric.py</lib>
<conf>bgpdbgp1.conf,bgpdbgp2.conf,bgpdr1.conf,bgpdr2.conf,dhcpd6.conf,dhcpd.conf,zebradbgp1.conf,zebradbgp2.conf</conf>
+ <trellisOar>/home/sdn/segmentrouting-oar-3.0.0-SNAPSHOT.oar</trellisOar>
+ <t3Oar>/home/sdn/t3-app-3.0.0-SNAPSHOT.oar</t3Oar>
</DEPENDENCY>
<ENV>
<cellName>productionCell</cellName>
- <cellApps>drivers,openflow,segmentrouting,fpm,dhcprelay,netcfghostprovider,routeradvertisement,t3,hostprobingprovider</cellApps>
+ <cellApps>drivers,openflow,fpm,dhcprelay,netcfghostprovider,routeradvertisement,hostprobingprovider</cellApps>
</ENV>
<GIT>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params.stratum b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params.stratum
index f01fbf2..1490932 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params.stratum
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params.stratum
@@ -20,6 +20,8 @@
<topology>hagg_fabric.py</topology>
<lib>routinglib.py,trellislib.py,trellis_fabric.py</lib>
<conf>bgpdbgp1.conf,bgpdbgp2.conf,bgpdr1.conf,bgpdr2.conf,dhcpd6.conf,dhcpd.conf,zebradbgp1.conf,zebradbgp2.conf</conf>
+ <trellisOar>/home/sdn/segmentrouting-oar-3.0.0-SNAPSHOT.oar</trellisOar>
+ <t3Oar>/home/sdn/t3-app-3.0.0-SNAPSHOT.oar</t3Oar>
</DEPENDENCY>
<MN_DOCKER>
@@ -30,7 +32,7 @@
<ENV>
<cellName>productionCell</cellName>
- <cellApps>drivers,openflow,segmentrouting,fpm,dhcprelay,netcfghostprovider,routeradvertisement,t3,hostprobingprovider,drivers.bmv2,pipelines.fabric</cellApps>
+ <cellApps>drivers,openflow,fpm,dhcprelay,netcfghostprovider,routeradvertisement,hostprobingprovider,drivers.bmv2,pipelines.fabric</cellApps>
</ENV>
<GIT>
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
index dd2b870..9c85477 100644
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -23,6 +23,7 @@
import json
import urllib
import re
+import pexpect
from core import utilities
@@ -1594,6 +1595,20 @@
main.log.info( "Creating Mininet Docker" )
handle = main.Mininet1.handle
main.Mininet1.dockerPrompt = '#'
+ # build docker image
+ buildOutput = ""
+ try:
+ handle.sendline( " docker build -t trellis_mininet %s/../dependencies/" % main.testDir )
+ handle.expect( "Successfully built", timeout=600 )
+ buildOutput = handle.before + str( handle.after )
+ handle.expect( main.Mininet1.prompt )
+ buildOutput += handle.before
+ main.log.debug( buildOutput )
+ except pexpect.TIMEOUT as e:
+ main.log.error( e )
+ buildOutput += handle.before
+ main.log.debug( buildOutput )
+
confDir = "/tmp/mn_conf/"
# Try to ensure the destination exists
@@ -1603,14 +1618,19 @@
main.log.debug( handle.before + handle.after )
# Make sure permissions are correct
handle.sendline( "sudo chown %s:%s %s" % ( main.Mininet1.user_name, main.Mininet1.user_name, confDir ) )
+ handle.expect( main.Mininet1.prompt )
handle.sendline( "sudo chmod -R a+rwx %s" % ( confDir ) )
handle.expect( main.Mininet1.prompt )
main.log.debug( handle.before + handle.after )
# Start docker container
handle.sendline( "docker run --name trellis_mininet %s %s" % ( main.params[ 'MN_DOCKER' ][ 'args' ], main.params[ 'MN_DOCKER' ][ 'name' ] ) )
- handle.expect( main.Mininet1.bashPrompt )
+ i = handle.expect( [ main.Mininet1.bashPrompt, "Error response from daemon: Conflict. The container name" ] )
output = handle.before + handle.after
main.log.debug( repr(output) )
+ if i == 1:
+ main.log.error( "Docker container already running, aborting test" )
+ main.cleanup()
+ main.exit()
handle.sendline( "docker attach trellis_mininet" )
handle.expect( main.Mininet1.dockerPrompt )