Skip to content

Commit 38f55ea

Browse files
danbevjasnell
authored andcommitted
test: add crypto check to http2 tests
When building --without-ssl and running the tests some of the http2 test fail with the following error message: internal/util.js:82 throw new errors.Error('ERR_NO_CRYPTO'); ^ Error [ERR_NO_CRYPTO]: Node.js is not compiled with OpenSSL crypto support at Object.assertCrypto (internal/util.js:82:11) at internal/http2/core.js:5:26 at NativeModule.compile (bootstrap_node.js:586:7) at NativeModule.require (bootstrap_node.js:531:18) at http2.js:17:5 at NativeModule.compile (bootstrap_node.js:586:7) at Function.NativeModule.require (bootstrap_node.js:531:18) at Function.Module._load (module.js:449:25) at Module.require (module.js:517:17) at require (internal/module.js:11:18) This commit adds hasCrypto checks and skips the tests if there is no crypto support. PR-URL: nodejs#14657 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 79e14a9 commit 38f55ea

File tree

85 files changed

+178
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+178
-5
lines changed

test/parallel/test-http2-binding.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// Flags: --expose-http2
22
'use strict';
33

4-
require('../common');
4+
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68

79
assert.doesNotThrow(() => process.binding('http2'));

test/parallel/test-http2-client-data-end.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const http2 = require('http2');
79

test/parallel/test-http2-client-destroy-before-connect.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const h2 = require('http2');
68

79
const server = h2.createServer();

test/parallel/test-http2-client-destroy-before-request.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-client-destroy.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-client-priority-before-connect.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const h2 = require('http2');
68

79
const server = h2.createServer();

test/parallel/test-http2-client-rststream-before-connect.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-client-set-priority.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const http2 = require('http2');
79

test/parallel/test-http2-client-settings-before-connect.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-client-shutdown-before-connect.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const h2 = require('http2');
68

79
const server = h2.createServer();

test/parallel/test-http2-client-socket-destroy.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const h2 = require('http2');
68
const body =
79
'<html><head></head><body><h1>this is some data</h2></body></html>';

test/parallel/test-http2-client-stream-destroy-before-connect.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79
const NGHTTP2_INTERNAL_ERROR = h2.constants.NGHTTP2_INTERNAL_ERROR;

test/parallel/test-http2-client-unescaped-path.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const http2 = require('http2');
68

79
const server = http2.createServer();

test/parallel/test-http2-client-upload.js

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
// Verifies that uploading data from a client works
55

66
const common = require('../common');
7+
if (!common.hasCrypto)
8+
common.skip('missing crypto');
79
const assert = require('assert');
810
const http2 = require('http2');
911
const fs = require('fs');

test/parallel/test-http2-client-write-before-connect.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-compat-serverrequest-headers.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-compat-serverrequest.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79
const net = require('net');

test/parallel/test-http2-compat-serverresponse-createpushresponse.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-compat-serverresponse-end.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// Flags: --expose-http2
22
'use strict';
33

4-
const { mustCall, mustNotCall } = require('../common');
4+
const { mustCall, mustNotCall, hasCrypto, skip } = require('../common');
5+
if (!hasCrypto)
6+
skip('missing crypto');
57
const { strictEqual } = require('assert');
68
const {
79
createServer,

test/parallel/test-http2-compat-serverresponse-finished.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-compat-serverresponse-flushheaders.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-compat-serverresponse-headers.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-compat-serverresponse-statuscode.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-compat-serverresponse-statusmessage-property.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-compat-serverresponse-statusmessage.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-compat-serverresponse-trailers.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const http2 = require('http2');
79

test/parallel/test-http2-compat-serverresponse-write-no-cb.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
// Flags: --expose-http2
22
'use strict';
33

4-
const { mustCall, mustNotCall, expectsError } = require('../common');
4+
const { mustCall,
5+
mustNotCall,
6+
expectsError,
7+
hasCrypto, skip } = require('../common');
8+
if (!hasCrypto)
9+
skip('missing crypto');
510
const { throws } = require('assert');
611
const { createServer, connect } = require('http2');
712

test/parallel/test-http2-compat-serverresponse-writehead.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-connect-method.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const net = require('net');
79
const http2 = require('http2');

test/parallel/test-http2-connect.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// Flags: --expose-http2
22
'use strict';
33

4-
const { mustCall } = require('../common');
4+
const { mustCall, hasCrypto, skip } = require('../common');
5+
if (!hasCrypto)
6+
skip('missing crypto');
57
const { doesNotThrow } = require('assert');
68
const { createServer, connect } = require('http2');
79

test/parallel/test-http2-cookies.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-create-client-connect.js

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
// Tests http2.connect()
55

66
const common = require('../common');
7+
if (!common.hasCrypto)
8+
common.skip('missing crypto');
79
const fs = require('fs');
810
const h2 = require('http2');
911
const path = require('path');

test/parallel/test-http2-create-client-session.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79
const body =

test/parallel/test-http2-date-header.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const http2 = require('http2');
79

test/parallel/test-http2-dont-override.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const http2 = require('http2');
79

test/parallel/test-http2-getpackedsettings.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const http2 = require('http2');
79

test/parallel/test-http2-goaway-opaquedata.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const http2 = require('http2');
79

test/parallel/test-http2-head-request.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const http2 = require('http2');
79

test/parallel/test-http2-info-headers.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-max-concurrent-streams.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-methods.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-misused-pseudoheaders.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const assert = require('assert');
68
const h2 = require('http2');
79

test/parallel/test-http2-multi-content-length.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
'use strict';
33

44
const common = require('../common');
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
57
const http2 = require('http2');
68

79
const server = http2.createServer();

0 commit comments

Comments
 (0)