Skip to content

Commit

Permalink
test:routing:tunnels: Improve vrf/wireguard modprobe check inside con…
Browse files Browse the repository at this point in the history
…tainers
  • Loading branch information
slyon committed Aug 28, 2024
1 parent b2c9005 commit 492f649
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tests/integration/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,10 @@ def test_link_route_v4(self):

def test_vrf_basic(self):
try:
subprocess.check_call(['modprobe', 'vrf'])
subprocess.check_call(['ip', 'link', 'add', 'dev', 'modprobe-check', 'type', 'vrf', 'table', '666'])
subprocess.check_call(['ip', 'link', 'del', 'modprobe-check'])
except Exception:
raise unittest.SkipTest("vrf module is unavailable, can't test")
raise unittest.SkipTest('vrf module is unavailable, can\'t test')

self.setup_eth('slaac')
self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'vrf0'], stderr=subprocess.DEVNULL)
Expand Down
5 changes: 3 additions & 2 deletions tests/integration/tunnels.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ def test_tunnel_ipip_without_local_address(self):

def test_tunnel_wireguard(self):
try:
subprocess.check_call(['modprobe', 'wireguard'])
subprocess.check_call(['ip', 'link', 'add', 'dev', 'modprobe-check', 'type', 'wireguard'])
subprocess.check_call(['ip', 'link', 'del', 'modprobe-check'])
except Exception:
raise unittest.SkipTest("wireguard module is unavailable, can't test")
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)
Expand Down

0 comments on commit 492f649

Please sign in to comment.