mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
test-network: use assertIn()
This commit is contained in:
@@ -1618,12 +1618,12 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
|
||||
|
||||
output = check_output('ip -d link show test1')
|
||||
print(output)
|
||||
self.assertRegex(output, ' mtu 2000 ')
|
||||
self.assertIn(' mtu 2000 ', output)
|
||||
|
||||
output = check_output('ip -d link show macvlan99')
|
||||
print(output)
|
||||
self.assertRegex(output, ' mtu 2000 ')
|
||||
self.assertRegex(output, 'macvlan mode ' + mode + ' ')
|
||||
self.assertIn(' mtu 2000 ', output)
|
||||
self.assertIn(f' macvlan mode {mode} ', output)
|
||||
|
||||
remove_link('test1')
|
||||
time.sleep(1)
|
||||
@@ -1634,12 +1634,12 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
|
||||
|
||||
output = check_output('ip -d link show test1')
|
||||
print(output)
|
||||
self.assertRegex(output, ' mtu 2000 ')
|
||||
self.assertIn(' mtu 2000 ', output)
|
||||
|
||||
output = check_output('ip -d link show macvlan99')
|
||||
print(output)
|
||||
self.assertRegex(output, ' mtu 2000 ')
|
||||
self.assertRegex(output, 'macvlan mode ' + mode + ' ')
|
||||
self.assertIn(' mtu 2000 ', output)
|
||||
self.assertIn(f' macvlan mode {mode} ', output)
|
||||
|
||||
@expectedFailureIfModuleIsNotAvailable('ipvlan')
|
||||
def test_ipvlan(self):
|
||||
|
||||
Reference in New Issue
Block a user