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
This commit is contained in:
Bob Lantz
2016-09-09 14:54:38 -07:00
parent 5470415bfc
commit f530c99415
+3 -2
View File
@@ -91,7 +91,8 @@ class testWalkthrough( unittest.TestCase ):
"Test ifconfig and ps on h1 and s1" "Test ifconfig and ps on h1 and s1"
p = pexpect.spawn( 'mn' ) p = pexpect.spawn( 'mn' )
p.expect( self.prompt ) 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 # h1 ifconfig
p.sendline( 'h1 ifconfig -a' ) p.sendline( 'h1 ifconfig -a' )
ifcount = 0 ifcount = 0
@@ -117,7 +118,7 @@ class testWalkthrough( unittest.TestCase ):
ifcount += 1 ifcount += 1
else: else:
break break
self.assertEqual( ifcount, 3, 'Missing interfaces on s1') self.assertTrue( ifcount >= 3, 'Missing interfaces on s1')
# h1 ps # h1 ps
p.sendline( "h1 ps -a | egrep -v 'ps|grep'" ) p.sendline( "h1 ps -a | egrep -v 'ps|grep'" )
p.expect( self.prompt ) p.expect( self.prompt )