Skip to content

Commit

Permalink
Skip port forwarding tests for privileged ports on non-darwin platforms
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Dubois <[email protected]>
  • Loading branch information
jandubois committed Jul 27, 2021
1 parent 494604a commit 24f9bdb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hack/test-port-forwarding.pl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use strict;
use warnings;

use Config qw(%Config);
use IO::Handle qw();
use Socket qw(inet_ntoa);
use Sys::Hostname qw(hostname);
Expand Down Expand Up @@ -76,7 +77,10 @@
/^(forward|ignore):\s+([0-9.:]+)\s+(\d+)(?:\s+→)?(?:\s+([0-9.:]+)(?:\s+(\d+))?)?/;
die "Cannot parse test '$_'" unless $1;
my %test; @test{qw(mode guest_ip guest_port host_ip host_port)} = ($1, $2, $3, $4, $5);

if ($test{mode} eq "forward" && $test{host_port} < 1024 && $Config{osname} ne "darwin") {
printf "🚧 Not supported on $Config{osname}: # $_\n";
next;
}
$test{host_ip} ||= "127.0.0.1";
$test{host_port} ||= $test{guest_port};

Expand Down

0 comments on commit 24f9bdb

Please sign in to comment.