Skip to content

Commit 570fecb

Browse files
committed
test:routing:tunnels: Improve vrf/wireguard modprobe check inside containers
1 parent e87ae1b commit 570fecb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

tests/integration/routing.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,10 @@ def test_link_route_v4(self):
287287

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

294295
self.setup_eth('slaac')
295296
self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'vrf0'], stderr=subprocess.DEVNULL)

tests/integration/tunnels.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,10 @@ def test_tunnel_ipip_without_local_address(self):
9292

9393
def test_tunnel_wireguard(self):
9494
try:
95-
subprocess.check_call(['modprobe', 'wireguard'])
95+
subprocess.check_call(['ip', 'link', 'add', 'dev', 'modprobe-check', 'type', 'wireguard'])
96+
subprocess.check_call(['ip', 'link', 'del', 'modprobe-check'])
9697
except Exception:
97-
raise unittest.SkipTest("wireguard module is unavailable, can't test")
98+
raise unittest.SkipTest('wireguard module is unavailable, can\'t test')
9899

99100
self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'wg0'], stderr=subprocess.DEVNULL)
100101
self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'wg1'], stderr=subprocess.DEVNULL)

0 commit comments

Comments
 (0)