1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-08 20:58:20 +03:00

Merge pull request #11759 from yuwata/fix-test-dropin

test-network: check whether ethtool support driver field for dummy interfaces
This commit is contained in:
Yu Watanabe 2019-02-20 06:11:11 +09:00 committed by GitHub
commit 71064bd5ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -289,7 +289,13 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
output = subprocess.check_output(['networkctl', 'status', 'dropin-*']).rstrip().decode('utf-8')
self.assertNotRegex(output, '1: lo ')
self.assertRegex(output, 'dropin-test')
#self.assertRegex(output, 'Driver: dummy')
ret = subprocess.run(['ethtool', '--driver', 'dropin-test'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
print(ret.stdout.rstrip().decode('utf-8'))
if ret.returncode == 0 and re.search('driver: dummy', ret.stdout.rstrip().decode('utf-8')) != None:
self.assertRegex(output, 'Driver: dummy')
else:
print('ethtool does not support driver field at least for dummy interfaces, skipping test for Driver field of networkctl.')
def test_bridge(self):
self.copy_unit_to_networkd_unit_path('25-bridge.netdev')