Update and rename MantenerFIFO to MantenerFIFO.md
[vsorcdistro/.git] / mininet / examples / test / test_scratchnet.py
1 #!/usr/bin/env python
2
3 """
4 Test for scratchnet.py
5 """
6
7 import unittest
8 from mininet.util import pexpect
9
10 class testScratchNet( unittest.TestCase ):
11
12     opts = [ "1 packets transmitted, 1 received, 0% packet loss", pexpect.EOF ]
13
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 )
19
20     def testPingKernel( self ):
21         self.pingTest( 'mininet.examples.scratchnet' )
22
23     def testPingUser( self ):
24         self.pingTest( 'mininet.examples.scratchnetuser' )
25
26 if __name__ == '__main__':
27     unittest.main()