Revision 18aab5b7 mininet/test/test_walkthrough.py

View differences:

mininet/test/test_walkthrough.py
19 19
    versionMatch = re.findall( r'TShark \d+.\d+.\d+', versionStr )[0]
20 20
    return versionMatch.split()[ 1 ]
21 21

  
22
# pylint doesn't understand pexpect.match, unfortunately!
23
# pylint:disable=maybe-no-member
24

  
22 25
class testWalkthrough( unittest.TestCase ):
23 26
    "Test Mininet walkthrough"
24 27

  
......
33 36

  
34 37
    def testWireshark( self ):
35 38
        "Use tshark to test the of dissector"
36
        # Satisfy pylint:
39
        # Satisfy pylint
37 40
        assert self
38 41
        if StrictVersion( tsharkVersion() ) < StrictVersion( '1.12.0' ):
39 42
            tshark = pexpect.spawn( 'tshark -i lo -R of' )
......
78 81
            node = p.match.group( 1 )
79 82
            actual.append( node )
80 83
            p.expect( '\n' )
81
        self.assertEqual( actual.sort(), nodes.sort(), '"nodes" and "dump" differ' )
84
        self.assertEqual( actual.sort(), nodes.sort(),
85
                          '"nodes" and "dump" differ' )
82 86
        p.expect( self.prompt )
83 87
        p.sendline( 'exit' )
84 88
        p.wait()
......
202 206
        p.expect( self.prompt )
203 207
        # test delay
204 208
        p.sendline( 'h1 ping -c 4 h2' )
205
        p.expect( r'rtt min/avg/max/mdev = ([\d\.]+)/([\d\.]+)/([\d\.]+)/([\d\.]+) ms' )
209
        p.expect( r'rtt min/avg/max/mdev = '
210
                  r'([\d\.]+)/([\d\.]+)/([\d\.]+)/([\d\.]+) ms' )
206 211
        delay = float( p.match.group( 2 ) )
207 212
        self.assertTrue( delay > 40, 'Delay < 40ms' )
208 213
        self.assertTrue( delay < 45, 'Delay > 40ms' )
......
226 231

  
227 232
    def testCustomTopo( self ):
228 233
        "Start Mininet using a custom topo, then run pingall"
234
        # Satisfy pylint
235
        assert self
229 236
        custom = os.path.dirname( os.path.realpath( __file__ ) )
230 237
        custom = os.path.join( custom, '../../custom/topo-2sw-2host.py' )
231 238
        custom = os.path.normpath( custom )
232
        p = pexpect.spawn( 'mn --custom %s --topo mytopo --test pingall' % custom )
239
        p = pexpect.spawn(
240
            'mn --custom %s --topo mytopo --test pingall' % custom )
233 241
        p.expect( '0% dropped' )
234 242
        p.expect( pexpect.EOF )
235 243

  
......
331 339
                          'Github is not reachable; cannot download Pox' )
332 340
    def testRemoteController( self ):
333 341
        "Test Mininet using Pox controller"
342
        # Satisfy pylint
343
        assert self
334 344
        if not os.path.exists( '/tmp/pox' ):
335
            p = pexpect.spawn( 'git clone https://github.com/noxrepo/pox.git /tmp/pox' )
345
            p = pexpect.spawn(
346
                'git clone https://github.com/noxrepo/pox.git /tmp/pox' )
336 347
            p.expect( pexpect.EOF )
337 348
        pox = pexpect.spawn( '/tmp/pox/pox.py forwarding.l2_learning' )
338
        net = pexpect.spawn( 'mn --controller=remote,ip=127.0.0.1,port=6633 --test pingall' )
349
        net = pexpect.spawn(
350
            'mn --controller=remote,ip=127.0.0.1,port=6633 --test pingall' )
339 351
        net.expect( '0% dropped' )
340 352
        net.expect( pexpect.EOF )
341 353
        pox.sendintr()

Also available in: Unified diff