summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/configs/match-final14
-rw-r--r--tests/test_config.py16
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/configs/match-final b/tests/configs/match-final
new file mode 100644
index 00000000..18e48a92
--- /dev/null
+++ b/tests/configs/match-final
@@ -0,0 +1,14 @@
+Host jump
+ HostName jump.example.orig
+ Port 1003
+
+Host finally
+ HostName finally.example.org
+ Port 1001
+
+Host default-port
+ HostName default-port.example.org
+
+Match final host "*.example.org" !host jump.example.org
+ ProxyJump jump
+ Port 1002
diff --git a/tests/test_config.py b/tests/test_config.py
index fcb120b6..2e49aa3d 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -1030,3 +1030,19 @@ class TestComplexMatching:
# !canonical in a config that is canonicalized - does NOT match
result = load_config("match-canonical-yes").lookup("www")
assert result["user"] == "hidden"
+
+
+class TestFinalMatching(object):
+ def test_finally(self):
+ result = load_config("match-final").lookup("finally")
+ assert result["proxyjump"] == "jump"
+ assert result["port"] == "1001"
+
+ def test_default_port(self):
+ result = load_config("match-final").lookup("default-port")
+ assert result["proxyjump"] == "jump"
+ assert result["port"] == "1002"
+
+ def test_negated(self):
+ result = load_config("match-final").lookup("jump")
+ assert result["port"] == "1003"