]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
policy.TLS_FORWARD tests: add cases from Tomas
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 12 Feb 2018 14:49:43 +0000 (15:49 +0100)
committerPetr Špaček <petr.spacek@nic.cz>
Thu, 15 Feb 2018 09:09:23 +0000 (10:09 +0100)
modules/policy/policy.test.lua

index 02f607d666c3bc1d8f2d900223bedf4ab62aa649..ef0fff9aacf9624f9d58de215442aef412395300 100644 (file)
@@ -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 {