Skip to content

Commit

Permalink
Merge pull request #2785 from Mr-Sunglasses/fix/#2707
Browse files Browse the repository at this point in the history
`[test-port-forwarding.pl]` fix: add human-readable error when nc is not installed on the host
  • Loading branch information
AkihiroSuda authored Oct 23, 2024
2 parents 14447a8 + bea4868 commit cabe59d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hack/test-port-forwarding.pl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@
exit;
}

# Check if netcat is available before running tests
my $nc_path = `command -v nc 2>/dev/null`;
chomp $nc_path;
unless ($nc_path) {
die "Error: 'nc' (netcat) is not installed on the host system.\n" .
"Please install netcat to run this test script:\n" .
" - On macOS: brew install netcat\n" .
" - On Ubuntu/Debian: sudo apt-get install netcat\n" .
" - On RHEL/CentOS: sudo yum install nmap-ncat\n";
}

# Otherwise $instance must be the name of an already running instance that has been
# configured with our portForwards settings.

Expand Down

0 comments on commit cabe59d

Please sign in to comment.