summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/cli/test_interfaces_wireguard.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/cli/test_interfaces_wireguard.py b/scripts/cli/test_interfaces_wireguard.py
index 159be02f1..0c32a4696 100755
--- a/scripts/cli/test_interfaces_wireguard.py
+++ b/scripts/cli/test_interfaces_wireguard.py
@@ -22,7 +22,7 @@ from base_interfaces_test import BasicInterfaceTest
# Generate WireGuard default keypair
if not os.path.isdir('/config/auth/wireguard/default'):
- os.system('/usr/libexec/vyos/op_mode/wireguard.py --genkey')
+ os.system('sudo /usr/libexec/vyos/op_mode/wireguard.py --genkey')
base_path = ['interfaces', 'wireguard']
@@ -54,7 +54,7 @@ class WireGuardInterfaceTest(unittest.TestCase):
self.session.set(base_path + [intf, 'peer', peer, 'port', '1337'])
# Allow different prefixes to traverse the tunnel
- allowed_ips = ['0.0.0.0/0']
+ allowed_ips = ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16']
for ip in allowed_ips:
self.session.set(base_path + [intf, 'peer', peer, 'allowed-ips', ip])
@@ -62,5 +62,7 @@ class WireGuardInterfaceTest(unittest.TestCase):
self.session.set(base_path + [intf, 'peer', peer, 'pubkey', pubkey])
self.session.commit()
+ self.assertTrue(os.path.isdir(f'/sys/class/net/{intf}'))
+
if __name__ == '__main__':
unittest.main()