Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit db2ace1

Browse filesBrowse files
KrayzeeKevtargos
authored andcommitted
test: assume priv ports start at 1024 if it can't be changed
An update to test/parallel/test-cluster-bind-privileged-port.js checks the lowest privileged port to ensure 42 is privileged This only works on kernels > 4.1. On older kernels, this is locked at 1024 so the check is not needed. Fixes: #45838 PR-URL: #46536 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent fb1ac98 commit db2ace1
Copy full SHA for db2ace1

File tree

Expand file treeCollapse file tree

1 file changed

+8
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-3
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-cluster-bind-privileged-port.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-cluster-bind-privileged-port.js
+8-3Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@ const net = require('net');
2727
const { readFileSync } = require('fs');
2828

2929
if (common.isLinux) {
30-
const unprivilegedPortStart = parseInt(readFileSync('/proc/sys/net/ipv4/ip_unprivileged_port_start'));
31-
if (unprivilegedPortStart <= 42) {
32-
common.skip('Port 42 is unprivileged');
30+
try {
31+
const unprivilegedPortStart = parseInt(readFileSync('/proc/sys/net/ipv4/ip_unprivileged_port_start'));
32+
if (unprivilegedPortStart <= 42) {
33+
common.skip('Port 42 is unprivileged');
34+
}
35+
} catch {
36+
// Do nothing, feature doesn't exist, minimum is 1024 so 42 is usable.
37+
// Continue...
3338
}
3439
}
3540

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.