Skip to content

Commit 5bf0d6a

Browse files
committed
test: Adds a test to check failure on FIPS
A test has been added to the parallel directory which merely exits with the specified error message on fips. The parallel.status file also has been modified to mark this test as flaky on fips so, the default test suite will work without any modifications. This test also serves as documentation of the added feature metioned below. Inline documentation has been added to both the files. Fixes: nodejs#14746
1 parent 2fb7825 commit 5bf0d6a

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

test/parallel/parallel.status

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,8 @@ test-npm-install: PASS,FLAKY
2020
[$system==freebsd]
2121

2222
[$system==aix]
23+
24+
# Sample test (test-negative-on-fips) has been added to check the
25+
# skip-on-fips feature (issue 14746)
26+
[$type==fips]
27+
test-negative-on-fips: PASS,FLAKY
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright Node contributors.
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a
4+
// copy of this software and associated documentation files (the
5+
// "Software"), to deal in the Software without restriction, including
6+
// without limitation the rights to use, copy, modify, merge, publish,
7+
// distribute, sublicense, and/or sell copies of the Software, and to permit
8+
// persons to whom the Software is furnished to do so, subject to the
9+
// following conditions:
10+
//
11+
// The above copyright notice and this permission notice shall be included
12+
// in all copies or substantial portions of the Software.
13+
//
14+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
21+
22+
// This test will fail on fips. The corresponding line in
23+
// parallel.status file makes sure this is marked as flaky and passes.
24+
'use strict';
25+
const common = require('../common');
26+
if (common.hasFipsCrypto)
27+
assert.fail("Test is expected to fail with FIPS enabled")

0 commit comments

Comments
 (0)