GeezerVison is showing github.com — test: fix test-tls-env-extra-ca-file-load · nodejs/node@7060ed1
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: test/parallel/test-tls-env-extra-ca-file-load.js +9-8Lines changed: 9 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -16,14 +16,7 @@ const { fork } = require('child_process'); |
16 | 16 |
|
17 | 17 | // This test ensures that extra certificates are loaded at startup. |
18 | 18 | if (process.argv[2] !== 'child') { |
19 | | - if (process.env.CHILD_USE_EXTRA_CA_CERTS === 'yes') { |
20 | | - assert.strictEqual(binding.isExtraRootCertsFileLoaded(), true); |
21 | | - } else if (process.env.CHILD_USE_EXTRA_CA_CERTS === 'no') { |
22 | | - assert.strictEqual(binding.isExtraRootCertsFileLoaded(), false); |
23 | | - tls.createServer({}); |
24 | | - assert.strictEqual(binding.isExtraRootCertsFileLoaded(), false); |
25 | | - } |
26 | | -} else { |
| 19 | + // Parent |
27 | 20 | const NODE_EXTRA_CA_CERTS = fixtures.path('keys', 'ca1-cert.pem'); |
28 | 21 | const extendsEnv = (obj) => ({ ...process.env, ...obj }); |
29 | 22 |
|
@@ -37,4 +30,12 @@ if (process.argv[2] !== 'child') { |
37 | 30 | assert.strictEqual(status, 0); |
38 | 31 | })); |
39 | 32 | }); |
| 33 | +} else if (process.env.CHILD_USE_EXTRA_CA_CERTS === 'yes') { |
| 34 | + // Child with extra certificates loaded at startup. |
| 35 | + assert.strictEqual(binding.isExtraRootCertsFileLoaded(), true); |
| 36 | +} else { |
| 37 | + // Child without extra certificates. |
| 38 | + assert.strictEqual(binding.isExtraRootCertsFileLoaded(), false); |
| 39 | + tls.createServer({}); |
| 40 | + assert.strictEqual(binding.isExtraRootCertsFileLoaded(), false); |
40 | 41 | } |