add test fixtures

This commit is contained in:
Yaksh Bariya 2023-04-29 18:01:46 +05:30
parent ba686ff3f5
commit 6e179c8c53
No known key found for this signature in database
GPG Key ID: F7486BA7D3D27581
3 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,13 @@
--- ./test/parallel/test-child-process-uid-gid.js.orig 2023-04-29 17:23:04.494870309 +0530
+++ ./test/parallel/test-child-process-uid-gid.js 2023-04-29 17:42:33.075531699 +0530
@@ -4,6 +4,10 @@
const spawn = require('child_process').spawn;
const expectedError = common.isWindows ? /\bENOTSUP\b/ : /\bEPERM\b/;
+if (process.platform === 'android') {
+ common.skip('We are patching node to not use setuid/setgid with child_process.spawn in anyway');
+}
+
if (common.isIBMi)
common.skip('IBMi has a different behavior');

View File

@ -0,0 +1,13 @@
--- ./test/parallel/test-cluster-bind-privileged-port.js.orig 2023-04-27 18:55:33.412729481 +0530
+++ ./test/parallel/test-cluster-bind-privileged-port.js 2023-04-27 18:57:07.626113300 +0530
@@ -25,8 +25,9 @@
const cluster = require('cluster');
const net = require('net');
const { readFileSync } = require('fs');
+const { platform } = require('os');
-if (common.isLinux) {
+if (common.isLinux || platform() === 'android') {
try {
const unprivilegedPortStart = parseInt(readFileSync('/proc/sys/net/ipv4/ip_unprivileged_port_start'));
if (unprivilegedPortStart <= 42) {

View File

@ -0,0 +1,22 @@
--- test/parallel/test-cluster-shared-handle-bind-privileged-port.js.orig 2023-04-29 17:47:19.747195574 +0530
+++ test/parallel/test-cluster-shared-handle-bind-privileged-port.js 2023-04-29 17:56:19.539332466 +0530
@@ -21,6 +21,19 @@
'use strict';
const common = require('../common');
+const {readFileSync} = require('fs');
+
+if (common.isLinux || process.platform === 'android') {
+ try {
+ const unprivilegedPortStart = parseInt(readFileSync('/proc/sys/net/ipv4/ip_unprivileged_port_start'));
+ if (unprivilegedPortStart <= 42) {
+ common.skip('Port 42 is unprivileged');
+ }
+ } catch {
+ // Do nothing, feature doesn't exist, minimum is 1024 so 42 is usable.
+ // Continue...
+ }
+}
// Skip on OS X Mojave. https://github.com/nodejs/node/issues/21679
if (common.isOSX)