Skip to content

Commit

Permalink
test: Adds a test to check failure on FIPS
Browse files Browse the repository at this point in the history
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: #14746
  • Loading branch information
komawar committed Oct 20, 2017
1 parent 2fb7825 commit 5bf0d6a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/parallel/parallel.status
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ test-npm-install: PASS,FLAKY
[$system==freebsd]

[$system==aix]

# Sample test (test-negative-on-fips) has been added to check the
# skip-on-fips feature (issue 14746)
[$type==fips]
test-negative-on-fips: PASS,FLAKY
27 changes: 27 additions & 0 deletions test/parallel/test-negative-on-fips.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

// This test will fail on fips. The corresponding line in
// parallel.status file makes sure this is marked as flaky and passes.
'use strict';
const common = require('../common');
if (common.hasFipsCrypto)
assert.fail("Test is expected to fail with FIPS enabled")

0 comments on commit 5bf0d6a

Please sign in to comment.