Skip to content

Commit 24f9bdb

Browse files
committed
Skip port forwarding tests for privileged ports on non-darwin platforms
Signed-off-by: Jan Dubois <[email protected]>
1 parent 494604a commit 24f9bdb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hack/test-port-forwarding.pl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use strict;
1616
use warnings;
1717

18+
use Config qw(%Config);
1819
use IO::Handle qw();
1920
use Socket qw(inet_ntoa);
2021
use Sys::Hostname qw(hostname);
@@ -76,7 +77,10 @@
7677
/^(forward|ignore):\s+([0-9.:]+)\s+(\d+)(?:\s+→)?(?:\s+([0-9.:]+)(?:\s+(\d+))?)?/;
7778
die "Cannot parse test '$_'" unless $1;
7879
my %test; @test{qw(mode guest_ip guest_port host_ip host_port)} = ($1, $2, $3, $4, $5);
79-
80+
if ($test{mode} eq "forward" && $test{host_port} < 1024 && $Config{osname} ne "darwin") {
81+
printf "🚧 Not supported on $Config{osname}: # $_\n";
82+
next;
83+
}
8084
$test{host_ip} ||= "127.0.0.1";
8185
$test{host_port} ||= $test{guest_port};
8286

0 commit comments

Comments
 (0)