test: fix test-strace-openat-openssl for RISC-V

Recent architectures like RISC-V does not support open syscall,
which will cause strace to fail and thus test failure.

    AssertionError [ERR_ASSERTION]: strace: invalid system call 'open'

This patch disables tracing open syscall for RISC-V in the test to fix
the test failure.

PR-URL: https://github.com/nodejs/node/pull/60588
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
This commit is contained in:
Levi Zim
2025-11-11 20:54:04 +08:00
committed by GitHub
parent 96f7a2be44
commit 22a3eb00e8

View File

@@ -19,9 +19,13 @@ if (spawnSync('strace').error !== undefined) {
const allowedOpenCalls = new Set([
'/etc/ssl/openssl.cnf',
]);
const syscalls = ['openat'];
if (process.arch !== 'riscv64' && process.arch !== 'riscv32') {
syscalls.push('open');
}
const strace = spawn('strace', [
'-f', '-ff',
'-e', 'trace=open,openat',
'-e', `trace=${syscalls.join(',')}`,
'-s', '512',
'-D', process.execPath, '-e', 'require("crypto")',
]);