Skip to content

Commit 4e52b07

Browse files
danbevaddaleax
authored andcommitted
test: use fipsMode instead of common.hasFipsCrypto
Currently, test-cli-node-print-help uses common.hasFipsCrypto to determine if the test should check for the existence of FIPS related options (--enable-fips, and --force-fips). The FIPS options are available when node has been compiled against an OpenSSL library with FIPS support in which case the test would verify that these options are available. But by using crypto.fips (which uses crypto.getFips()) this would only be checked when fips has been enabled, but these options are available regardless if FIPS is enabled or disabled. This commit updates the test to use fipsMode from config to determine if the FIPS options existence should be checked. PR-URL: #25510 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 338f456 commit 4e52b07

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎test/parallel/test-cli-node-print-help.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Flags: --expose-internals
12
'use strict';
23

34
constcommon=require('../common');
@@ -7,6 +8,8 @@ const common = require('../common');
78

89
constassert=require('assert');
910
const{ exec }=require('child_process');
11+
const{ internalBinding }=require('internal/test/binding');
12+
const{ fipsMode }=internalBinding('config');
1013
letstdOut;
1114

1215

@@ -21,15 +24,14 @@ function startPrintHelpTest() {
2124
functionvalidateNodePrintHelp(){
2225
constconfig=process.config;
2326
constHAVE_OPENSSL=common.hasCrypto;
24-
constNODE_FIPS_MODE=common.hasFipsCrypto;
2527
constNODE_HAVE_I18N_SUPPORT=common.hasIntl;
2628
constHAVE_INSPECTOR=config.variables.v8_enable_inspector===1;
2729

2830
constcliHelpOptions=[
2931
{compileConstant: HAVE_OPENSSL,
3032
flags: ['--openssl-config=...','--tls-cipher-list=...',
3133
'--use-bundled-ca','--use-openssl-ca']},
32-
{compileConstant: NODE_FIPS_MODE,
34+
{compileConstant: fipsMode,
3335
flags: ['--enable-fips','--force-fips']},
3436
{compileConstant: NODE_HAVE_I18N_SUPPORT,
3537
flags: ['--icu-data-dir=...','NODE_ICU_DATA']},

0 commit comments

Comments
 (0)