From f3d48f1c6afc67620ec3a698c0f1ba43930b6891 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 12 Feb 2018 15:49:43 +0100 Subject: [PATCH] policy.TLS_FORWARD tests: add cases from Tomas --- modules/policy/policy.test.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/policy/policy.test.lua b/modules/policy/policy.test.lua index 02f607d66..ef0fff9aa 100644 --- a/modules/policy/policy.test.lua +++ b/modules/policy/policy.test.lua @@ -20,6 +20,12 @@ local function test_tls_forward() ok(policy.TLS_FORWARD({{'100:dead::', insecure=true}, {'100:dead::@443', insecure=true} }), 'TLS_FORWARD with duplicate IP addresses but different ports is allowed') + ok(policy.TLS_FORWARD({{'100:dead::', insecure=true}, + {'100:beef::', insecure=true} + }), 'TLS_FORWARD with different IPv6 addresses is allowed') + ok(policy.TLS_FORWARD({{'127.0.0.1', insecure=true}, + {'127.0.0.2', insecure=true} + }), 'TLS_FORWARD with different IPv4 addresses is allowed') boom(policy.TLS_FORWARD, {{{'::1', pin_sha256=''}}}, 'TLS_FORWARD with empty pin_sha256') -- boom(policy.TLS_FORWARD, {{{'::1', pin_sha256='č'}}}, 'TLS_FORWARD with bad pin_sha256') @@ -38,6 +44,7 @@ local function test_tls_forward() boom(policy.TLS_FORWARD, {{{'::1', hostname='', ca_file='/tmp/ca.crt'}}}, 'TLS_FORWARD with empty hostname + CA cert') boom(policy.TLS_FORWARD, {{{'::1', hostname='test.', ca_file='/dev/a_file_which_surely_does_NOT_exist!'}}}, 'TLS_FORWARD with hostname + unreadable CA cert') + end return { -- 2.47.2