Skip to content

Commit dbb9c37

Browse files
danbevaddaleax
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: #14657 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 47bf705 commit dbb9c37

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

Lines changed: 3 additions & 1 deletion
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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();

0 commit comments

Comments
 (0)