Skip to content

Commit e6492b6

Browse files
michal-josef-spacekoalders
authored andcommitted
test using loopback rather than internet accessible address
1 parent 563f8d0 commit e6492b6

5 files changed

Lines changed: 9 additions & 22 deletions

File tree

Changes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
Revision history for HTTP-Daemon
22

33
{{$NEXT}}
4-
- Use GH Perl helpers for build and coverage jobs (GH#53) (Olaf Alders)
4+
- Test using loopback rather than internet accessible address (GH#52)
5+
(Michal Josef Špaček)
6+
- Use GH Perl helpers for build and coverage jobs (GH#53) (Olaf Alders)
57

68
6.13 2022-02-09 20:39:12Z
79
- Bump minimum IO::Socket::IP version to 0.32 (GH#50) (Olaf Alders)

t/chunked.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ my $tests = @TESTS;
102102
my $tport = 8334;
103103

104104
my %addresses = (
105-
AF_INET6() => {server => '::', client => '::1'},
106-
AF_INET() => {server => '0.0.0.0', client => '127.0.0.1'}
105+
AF_INET6() => {server => '::1', client => '::1'},
106+
AF_INET() => {server => '127.0.0.1', client => '127.0.0.1'}
107107
);
108108
my $family;
109109
my $tsock = IO::Socket::IP->new(

t/local/http.t

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ if ($^O eq "MacOS") {
55
exit(0);
66
}
77

8-
unless (-f "CAN_TALK_TO_OURSELF") {
9-
print "1..0 # Skipped: Can't talk to ourself (misconfigured system)\n";
10-
exit;
11-
}
12-
138
$| = 1; # autoflush
149

1510
require IO::Socket::IP; # make sure this work before we try to make a HTTP::Daemon
@@ -20,7 +15,7 @@ if ($D eq 'daemon') {
2015

2116
require HTTP::Daemon;
2217

23-
my $d = HTTP::Daemon->new(Timeout => 10);
18+
my $d = HTTP::Daemon->new(Timeout => 10, LocalAddr => '127.0.0.1');
2419

2520
print "Please to meet you at: <URL:", $d->url, ">\n";
2621
open(STDOUT, $^O eq 'VMS' ? ">nl: " : ">/dev/null");
@@ -174,7 +169,7 @@ $res = $ua->request($req);
174169
175170
ok($res->is_success);
176171
ok($res->content_type, 'text/html');
177-
ok($res->content_length, 147);
172+
ok($res->content_length, 155);
178173
ok($res->title, 'En pr�ve');
179174
ok($res->content, qr/� v�re/);
180175

t/robot/ua-get.t

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ if ($^O eq "MacOS") {
55
exit(0);
66
}
77

8-
unless (-f "CAN_TALK_TO_OURSELF") {
9-
print "1..0 # Skipped: Can't talk to ourself (misconfigured system)\n";
10-
exit;
11-
}
12-
138
$| = 1; # autoflush
149
require IO::Socket::IP; # make sure this work before we try to make a HTTP::Daemon
1510

@@ -19,7 +14,7 @@ if ($D eq 'daemon') {
1914

2015
require HTTP::Daemon;
2116

22-
my $d = HTTP::Daemon->new(Timeout => 10);
17+
my $d = HTTP::Daemon->new(Timeout => 10, LocalAddr => '127.0.0.1');
2318

2419
print "Please to meet you at: <URL:", $d->url, ">\n";
2520
open(STDOUT,

t/robot/ua.t

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ if ($^O eq "MacOS") {
55
exit(0);
66
}
77

8-
unless (-f "CAN_TALK_TO_OURSELF") {
9-
print "1..0 # Skipped: Can't talk to ourself (misconfigured system)\n";
10-
exit;
11-
}
12-
138
$| = 1; # autoflush
149
require IO::Socket::IP; # make sure this work before we try to make a HTTP::Daemon
1510

@@ -19,7 +14,7 @@ if ($D eq 'daemon') {
1914

2015
require HTTP::Daemon;
2116

22-
my $d = HTTP::Daemon->new(Timeout => 10);
17+
my $d = HTTP::Daemon->new(Timeout => 10, LocalAddr => '127.0.0.1');
2318

2419
print "Please to meet you at: <URL:", $d->url, ">\n";
2520
open(STDOUT,

0 commit comments

Comments
 (0)