test-network: use assertIn()

This commit is contained in:
Yu Watanabe
2024-02-22 09:46:45 +09:00
parent 9adafeddac
commit 0183d48ddb

View File

@@ -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):