Skip to content

Commit c747dfa

Browse files
committed
Tests: skip proxy_implicit.t on exotic /etc/hosts.
1 parent b9337d8 commit c747dfa

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

proxy_implicit.t

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,21 @@ http {
6464
6565
EOF
6666

67-
$t->try_run('no inet6 support')->plan(3);
67+
$t->try_run('no inet6 support');
6868

69-
###############################################################################
69+
my @addrs = resolve('localhost');
70+
71+
plan(skip_all => 'unexpected localhost') if @addrs > 2
72+
|| grep { $_ ne '127.0.0.1' && $_ ne '[::1]' } @addrs;
7073

7174
my $p = port(8080);
72-
my @addrs = resolve('localhost');
7375
my $exp = qr/$addrs[0]:$p/ if @addrs == 1;
7476
my $v1 = "$addrs[0]:$p", my $v2 = "$addrs[1]:$p" if @addrs == 2;
7577
$exp = qr/\Q$v1, $v2\E|\Q$v2, $v1\E/ if @addrs == 2;
76-
die "too many addresses in localhost" if @addrs > 2;
78+
79+
$t->plan(3);
80+
81+
###############################################################################
7782

7883
like(http_get('/'), qr/Not Found/, 'implicit upstream');
7984
like(http_get('/'), $exp, 'implicit upstream all tried');

0 commit comments

Comments
 (0)