From 82247e7a7f0cf3536c7e4bcd8eaac8ac34e7ac77 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Mon, 16 Aug 2021 22:35:06 +0100 Subject: [PATCH] Revert "Revert "update acl test to work in github action container env"" This reverts commit 2abaa92e97ea422194bf211d04ed070a6632678b. --- xt/21-check_acl_no_ipaddr_only.t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xt/21-check_acl_no_ipaddr_only.t b/xt/21-check_acl_no_ipaddr_only.t index e0c95532..7ea3a820 100644 --- a/xt/21-check_acl_no_ipaddr_only.t +++ b/xt/21-check_acl_no_ipaddr_only.t @@ -13,10 +13,14 @@ BEGIN { use Dancer qw/:script !pass/; -config->{'dns'} = {no => ['::1','fe80::/10','127.0.0.0/8','169.254.0.0/16']}; +# this is needed so that test works in github action container +# and actually ends up cutting out live DNS anyway 👍 +config->{'dns'} = { 'ETCHOSTS' => { localhost => [ [ '127.0.0.1' ] ] } }; + +config->{'dns'}->{'no'} = ['::1','fe80::/10','127.0.0.0/8','169.254.0.0/16']; is(hostname_from_ip('127.0.0.1'), undef, '127.0.0.1 blocked'); -config->{'dns'} = {no => ['::1','fe80::/10','169.254.0.0/16']}; +config->{'dns'}->{'no'} = ['::1','fe80::/10','169.254.0.0/16']; is(hostname_from_ip('127.0.0.1'), 'localhost', '127.0.0.1 allowed'); done_testing;