diff options
author | Evgeny Vereshchagin <evvers@ya.ru> | 2018-11-02 22:08:30 +0100 |
---|---|---|
committer | Evgeny Vereshchagin <evvers@ya.ru> | 2018-11-03 00:12:01 +0100 |
commit | 7a0a37b283217de8e724942d7f96590affb70b48 (patch) | |
tree | ead7eb8c8334f9eba94c8f469019d5093a984e05 /test/test-network/systemd-networkd-tests.py | |
parent | tests: make NetworkdNetWorkTests.test_routing_policy_rule pass on CentOS (diff) | |
download | systemd-7a0a37b283217de8e724942d7f96590affb70b48.tar.xz systemd-7a0a37b283217de8e724942d7f96590affb70b48.zip |
tests: mark a few tests as expected failures when the required modules aren't available
Closes https://github.com/systemd/systemd/issues/10617.
Diffstat (limited to '')
-rwxr-xr-x | test/test-network/systemd-networkd-tests.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 82d10ddc43..ff632740fc 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -22,6 +22,17 @@ dnsmasq_config_file='/var/run/networkd-ci/test-dnsmasq.conf' dnsmasq_pid_file='/var/run/networkd-ci/test-test-dnsmasq.pid' dnsmasq_log_file='/var/run/networkd-ci/test-dnsmasq-log-file' +def is_module_available(module_name): + return not subprocess.call(["modprobe", module_name]) + +def expectedFailureIfModuleIsNotAvailable(module_name): + def f(func): + if not is_module_available(module_name): + return unittest.expectedFailure(func) + return func + + return f + def setUpModule(): os.makedirs(network_unit_file_path, exist_ok=True) @@ -213,6 +224,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): self.assertTrue(self.link_exits('macvlan99')) + @expectedFailureIfModuleIsNotAvailable('ipvlan') def test_ipvlan(self): self.copy_unit_to_networkd_unit_path('25-ipvlan.netdev', '11-dummy.netdev', 'ipvlan.network') @@ -248,6 +260,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): self.assertTrue(self.link_exits('tap99')) + @expectedFailureIfModuleIsNotAvailable('vrf') def test_vrf(self): self.copy_unit_to_networkd_unit_path('25-vrf.netdev') @@ -255,6 +268,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): self.assertTrue(self.link_exits('vrf99')) + @expectedFailureIfModuleIsNotAvailable('vcan') def test_vcan(self): self.copy_unit_to_networkd_unit_path('25-vcan.netdev') |