8 from mininet.util import pexpect
11 class testTree1024( unittest.TestCase ):
15 @unittest.skipIf( '-quick' in sys.argv, 'long test' )
16 def testTree1024( self ):
17 "Run the example and do a simple ping test from h1 to h1024"
18 p = pexpect.spawn( 'python -m mininet.examples.tree1024' )
19 p.expect( self.prompt, timeout=6000 ) # it takes awhile to set up
20 p.sendline( 'h1 ping -c 20 h1024' )
21 p.expect ( '(\d+)% packet loss' )
22 packetLossPercent = int( p.match.group( 1 ) ) if p.match else -1
23 p.expect( self.prompt )
26 # Tolerate slow startup on some systems - we should revisit this
27 # and determine the root cause.
28 self.assertLess( packetLossPercent, 60 )
30 if __name__ == '__main__':