Skip to content

Commit

Permalink
test:tunnels: skip WireGuard test if kernel module is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
slyon committed Jul 24, 2024
1 parent 586694b commit 0d95dea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/integration/tunnels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0d95dea

Please sign in to comment.