feat/wip: better awg to outbounds config
This commit is contained in:
26 files changed
+805
-218
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
import unittest
|
||||
|
||||
from warp_outbound import ConfigError, build
|
||||
from warp_outbound import ConfigError, build, obfuscation_keys
|
||||
|
||||
WGCF = """[Interface]
|
||||
PrivateKey = priv=
|
||||
@@ -38,6 +38,12 @@ class WarpOutboundTest(unittest.TestCase):
|
||||
ob = build(WGCF.replace("[Peer]", "RekeyAfterTime = 100-120\n[Peer]\nPersistentKeepalive = 25-35"), "warp", None)
|
||||
self.assertEqual(ob["peers"][0]["persistent_keepalive_interval"], 25)
|
||||
|
||||
def test_obfuscation_keys(self):
|
||||
self.assertEqual(obfuscation_keys(WGCF), [])
|
||||
awg = WGCF.replace("[Peer]", "Jc = 4\nH1 = 1-2\n[Peer]")
|
||||
self.assertEqual(obfuscation_keys(awg), ["h1", "jc"])
|
||||
self.assertNotIn("jc", build(awg, "warp", None))
|
||||
|
||||
def test_rejects_missing_peer(self):
|
||||
with self.assertRaises(ConfigError):
|
||||
build(WGCF.split("[Peer]")[0], "warp", None)
|
||||
|
||||
Reference in new issue
Block a user