Update and rename MantenerFIFO to MantenerFIFO.md
[vsorcdistro/.git] / mininet / examples / test / test_clusterSanity.py
1 #!/usr/bin/env python
2
3 '''
4 A simple sanity check test for cluster edition
5 '''
6
7 import unittest
8 from mininet.util import pexpect
9
10 class clusterSanityCheck( unittest.TestCase ):
11
12     prompt = 'mininet>'
13
14     def testClusterPingAll( self ):
15         p = pexpect.spawn( 'python -m mininet.examples.clusterSanity' )
16         p.expect( self.prompt )
17         p.sendline( 'pingall' )
18         p.expect ( '(\d+)% dropped' )
19         percent = int( p.match.group( 1 ) ) if p.match else -1
20         self.assertEqual( percent, 0 )
21         p.expect( self.prompt )
22         p.sendline( 'exit' )
23         p.wait()
24
25
26 if __name__  == '__main__':
27     unittest.main()