fixes for LinkDelay test in test_hifi

This commit is contained in:
cody burkard
2014-08-26 22:34:34 -07:00
parent 92075113d8
commit c75ff7ecd9
2 changed files with 8 additions and 2 deletions
+3 -1
View File
@@ -888,7 +888,9 @@ class UserSwitch( Switch ):
def connected( self ):
"Is the switch connected to a controller?"
return 'remote.is-connected=true' in self.dpctl( 'status' )
status = self.dpctl( 'status' )
return ( 'remote.is-connected=true' in status and
'local.is-connected=true' in status )
@staticmethod
def TCReapply( intf ):
+5 -1
View File
@@ -97,11 +97,15 @@ class testOptionsTopoCommon( object ):
"Verify that link delays are accurate within a bound."
DELAY_MS = 15
DELAY_TOLERANCE = 0.8 # Delay fraction below which test should fail
REPS = 3
lopts = { 'delay': '%sms' % DELAY_MS, 'use_htb': True }
mn = Mininet( SingleSwitchOptionsTopo( n=N, lopts=lopts ),
link=TCLink, switch=self.switchClass, autoStaticArp=True,
waitConnected=True )
ping_delays = mn.run( mn.pingFull )
mn.start()
for _ in range( REPS ):
ping_delays = mn.pingFull()
mn.stop()
test_outputs = ping_delays[0]
# Ignore unused variables below
# pylint: disable-msg=W0612