From f530c99415d8215a0ab7dba4b55e7a64297dd268 Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Fri, 9 Sep 2016 14:54:38 -0700 Subject: [PATCH] testHostCommands: accept both ethX and en.*X interfaces systemd (Ubuntu 16) names interfaces like this: enp1s3 for "ethernet, PCI bus 1, slot 3" We now accept both in testHostCommands Fixes #665 --- mininet/test/test_walkthrough.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mininet/test/test_walkthrough.py b/mininet/test/test_walkthrough.py index 2e57c64..e2f18cb 100755 --- a/mininet/test/test_walkthrough.py +++ b/mininet/test/test_walkthrough.py @@ -91,7 +91,8 @@ class testWalkthrough( unittest.TestCase ): "Test ifconfig and ps on h1 and s1" p = pexpect.spawn( 'mn' ) p.expect( self.prompt ) - interfaces = [ 'h1-eth0', 's1-eth1', '[^-]eth0', 'lo', self.prompt ] + # Third pattern is a local interface beginning with 'eth' or 'en' + interfaces = [ 'h1-eth0', 's1-eth1', '[^-](eth|en)\w*\d', 'lo', self.prompt ] # h1 ifconfig p.sendline( 'h1 ifconfig -a' ) ifcount = 0 @@ -117,7 +118,7 @@ class testWalkthrough( unittest.TestCase ): ifcount += 1 else: break - self.assertEqual( ifcount, 3, 'Missing interfaces on s1') + self.assertTrue( ifcount >= 3, 'Missing interfaces on s1') # h1 ps p.sendline( "h1 ps -a | egrep -v 'ps|grep'" ) p.expect( self.prompt )