From 2daf5a8b97a6a681e9525ed35f699681fb916b2b Mon Sep 17 00:00:00 2001 From: Sergey Chernyshev Date: Thu, 25 Apr 2024 01:54:27 +0200 Subject: [PATCH] test: relax version check with shared OpenSSL Relax the OpenSSL version check when Node.js is built with the `--shared-openssl` option. Verify only that `process.versions.openssl` is truthy. Fixes: https://github.com/nodejs/node/issues/43078 PR-URL: https://github.com/nodejs/node/pull/50505 Reviewed-By: Richard Lau --- .../test/parallel/test-process-versions.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/graal-nodejs/test/parallel/test-process-versions.js b/graal-nodejs/test/parallel/test-process-versions.js index 1a4f6fbff07..98dbda9ee8f 100644 --- a/graal-nodejs/test/parallel/test-process-versions.js +++ b/graal-nodejs/test/parallel/test-process-versions.js @@ -75,13 +75,17 @@ assert.match(process.versions.modules, /^\d+$/); assert.match(process.versions.cjs_module_lexer, commonTemplate); if (common.hasCrypto) { - const versionRegex = common.hasOpenSSL3 ? - // The following also matches a development version of OpenSSL 3.x which - // can be in the format '3.0.0-alpha4-dev'. This can be handy when building - // and linking against the main development branch of OpenSSL. - /^\d+\.\d+\.\d+(?:[-+][a-z0-9]+)*$/ : - /^\d+\.\d+\.\d+[a-z]?(\+quic)?(-fips)?$/; - assert.match(process.versions.openssl, versionRegex); + if (process.config.variables.node_shared_openssl) { + assert.ok(process.versions.openssl); + } else { + const versionRegex = common.hasOpenSSL3 ? + // The following also matches a development version of OpenSSL 3.x which + // can be in the format '3.0.0-alpha4-dev'. This can be handy when + // building and linking against the main development branch of OpenSSL. + /^\d+\.\d+\.\d+(?:[-+][a-z0-9]+)*$/ : + /^\d+\.\d+\.\d+[a-z]?(\+quic)?(-fips)?$/; + assert.match(process.versions.openssl, versionRegex); + } } for (let i = 0; i < expected_keys.length; i++) {