8 from mininet.util import pexpect
10 class testScratchNet( unittest.TestCase ):
12 opts = [ "1 packets transmitted, 1 received, 0% packet loss", pexpect.EOF ]
14 def pingTest( self, name ):
15 "Verify that no ping packets were dropped"
16 p = pexpect.spawn( 'python -m %s' % name )
17 index = p.expect( self.opts, timeout=120 )
18 self.assertEqual( index, 0 )
20 def testPingKernel( self ):
21 self.pingTest( 'mininet.examples.scratchnet' )
23 def testPingUser( self ):
24 self.pingTest( 'mininet.examples.scratchnetuser' )
26 if __name__ == '__main__':