From 0d95dea027c153c9d86e549ad2f42755c109eed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=A4rdian?= Date: Wed, 24 Jul 2024 11:22:39 +0200 Subject: [PATCH] test:tunnels: skip WireGuard test if kernel module is not available --- tests/integration/tunnels.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/integration/tunnels.py b/tests/integration/tunnels.py index bdacb55fb..f784aa811 100644 --- a/tests/integration/tunnels.py +++ b/tests/integration/tunnels.py @@ -91,6 +91,11 @@ def test_tunnel_ipip_without_local_address(self): self.assert_iface('tun0', ['tun0@NONE', 'link.* 0.0.0.0 peer 99.99.99.99']) def test_tunnel_wireguard(self): + try: + subprocess.check_call(['modprobe', 'wireguard']) + except Exception: + raise unittest.SkipTest("wireguard module is unavailable, can't test") + self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'wg0'], stderr=subprocess.DEVNULL) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'wg1'], stderr=subprocess.DEVNULL) with open(self.config, 'w') as f: