Skip to content

Commit

Permalink
test: relax version check with shared OpenSSL
Browse files Browse the repository at this point in the history
Relax the OpenSSL version check when Node.js is built with the
`--shared-openssl` option. Verify only that `process.versions.openssl`
is truthy.

Fixes: nodejs/node#43078
PR-URL: nodejs/node#50505
Reviewed-By: Richard Lau <rlau@redhat.com>
  • Loading branch information
sercher committed Apr 24, 2024
1 parent 1b391ba commit 2daf5a8
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions graal-nodejs/test/parallel/test-process-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 2daf5a8

Please sign in to comment.