test: simplify test skipping
* Make common.skip() exit. Also add common.printSkipMessage() for partial skips. * Don't make needless things before skip PR-URL: https://github.com/nodejs/node/pull/14021 Fixes: https://github.com/nodejs/node/issues/14016 Reviewed-By: Refael Ackermann <refack@gmail.com>
This commit is contained in:
parent
cc1a47dc6b
commit
2d2986ae72
@ -1,13 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (common.isWindows)
|
||||||
|
common.skip('Backtraces unimplemented on Windows.');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const cp = require('child_process');
|
const cp = require('child_process');
|
||||||
|
|
||||||
if (common.isWindows) {
|
|
||||||
common.skip('Backtraces unimplemented on Windows.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process.argv[2] === 'child') {
|
if (process.argv[2] === 'child') {
|
||||||
process.abort();
|
process.abort();
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
|
if (common.isWOW64)
|
||||||
|
common.skip('doesn\'t work on WOW64');
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
if (common.isWOW64) {
|
|
||||||
common.skip('doesn\'t work on WOW64');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
common.refreshTmpDir();
|
common.refreshTmpDir();
|
||||||
|
|
||||||
// make a path that is more than 260 chars long.
|
// make a path that is more than 260 chars long.
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
process.exit(0);
|
|
||||||
}
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const binding = require(`./build/${common.buildType}/binding`);
|
const binding = require(`./build/${common.buildType}/binding`);
|
||||||
const bytes = new Uint8Array(1024);
|
const bytes = new Uint8Array(1024);
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
|
const skipMessage = 'intensive toString tests due to memory confinements';
|
||||||
|
if (!common.enoughTestMem)
|
||||||
|
common.skip(skipMessage);
|
||||||
|
|
||||||
const binding = require(`./build/${common.buildType}/binding`);
|
const binding = require(`./build/${common.buildType}/binding`);
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
@ -8,12 +12,6 @@ const assert = require('assert');
|
|||||||
// v8::String::kMaxLength defined in v8.h
|
// v8::String::kMaxLength defined in v8.h
|
||||||
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
||||||
|
|
||||||
const skipMessage = 'intensive toString tests due to memory confinements';
|
|
||||||
if (!common.enoughTestMem) {
|
|
||||||
common.skip(skipMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let buf;
|
let buf;
|
||||||
try {
|
try {
|
||||||
buf = Buffer.allocUnsafe(kStringMaxLength);
|
buf = Buffer.allocUnsafe(kStringMaxLength);
|
||||||
@ -21,14 +19,11 @@ try {
|
|||||||
// If the exception is not due to memory confinement then rethrow it.
|
// If the exception is not due to memory confinement then rethrow it.
|
||||||
if (e.message !== 'Array buffer allocation failed') throw (e);
|
if (e.message !== 'Array buffer allocation failed') throw (e);
|
||||||
common.skip(skipMessage);
|
common.skip(skipMessage);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure we have enough memory available for future allocations to succeed.
|
// Ensure we have enough memory available for future allocations to succeed.
|
||||||
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
|
if (!binding.ensureAllocation(2 * kStringMaxLength))
|
||||||
common.skip(skipMessage);
|
common.skip(skipMessage);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const maxString = buf.toString('latin1');
|
const maxString = buf.toString('latin1');
|
||||||
assert.strictEqual(maxString.length, kStringMaxLength);
|
assert.strictEqual(maxString.length, kStringMaxLength);
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
|
const skipMessage = 'intensive toString tests due to memory confinements';
|
||||||
|
if (!common.enoughTestMem)
|
||||||
|
common.skip(skipMessage);
|
||||||
|
|
||||||
const binding = require(`./build/${common.buildType}/binding`);
|
const binding = require(`./build/${common.buildType}/binding`);
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
const skipMessage = 'intensive toString tests due to memory confinements';
|
|
||||||
if (!common.enoughTestMem) {
|
|
||||||
common.skip(skipMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// v8 fails silently if string length > v8::String::kMaxLength
|
// v8 fails silently if string length > v8::String::kMaxLength
|
||||||
// v8::String::kMaxLength defined in v8.h
|
// v8::String::kMaxLength defined in v8.h
|
||||||
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
||||||
@ -21,14 +19,11 @@ try {
|
|||||||
// If the exception is not due to memory confinement then rethrow it.
|
// If the exception is not due to memory confinement then rethrow it.
|
||||||
if (e.message !== 'Array buffer allocation failed') throw (e);
|
if (e.message !== 'Array buffer allocation failed') throw (e);
|
||||||
common.skip(skipMessage);
|
common.skip(skipMessage);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure we have enough memory available for future allocations to succeed.
|
// Ensure we have enough memory available for future allocations to succeed.
|
||||||
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
|
if (!binding.ensureAllocation(2 * kStringMaxLength))
|
||||||
common.skip(skipMessage);
|
common.skip(skipMessage);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
assert.throws(function() {
|
assert.throws(function() {
|
||||||
buf.toString('ascii');
|
buf.toString('ascii');
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
|
const skipMessage = 'intensive toString tests due to memory confinements';
|
||||||
|
if (!common.enoughTestMem)
|
||||||
|
common.skip(skipMessage);
|
||||||
|
|
||||||
const binding = require(`./build/${common.buildType}/binding`);
|
const binding = require(`./build/${common.buildType}/binding`);
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
const skipMessage = 'intensive toString tests due to memory confinements';
|
|
||||||
if (!common.enoughTestMem) {
|
|
||||||
common.skip(skipMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// v8 fails silently if string length > v8::String::kMaxLength
|
// v8 fails silently if string length > v8::String::kMaxLength
|
||||||
// v8::String::kMaxLength defined in v8.h
|
// v8::String::kMaxLength defined in v8.h
|
||||||
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
||||||
@ -21,14 +19,11 @@ try {
|
|||||||
// If the exception is not due to memory confinement then rethrow it.
|
// If the exception is not due to memory confinement then rethrow it.
|
||||||
if (e.message !== 'Array buffer allocation failed') throw (e);
|
if (e.message !== 'Array buffer allocation failed') throw (e);
|
||||||
common.skip(skipMessage);
|
common.skip(skipMessage);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure we have enough memory available for future allocations to succeed.
|
// Ensure we have enough memory available for future allocations to succeed.
|
||||||
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
|
if (!binding.ensureAllocation(2 * kStringMaxLength))
|
||||||
common.skip(skipMessage);
|
common.skip(skipMessage);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
assert.throws(function() {
|
assert.throws(function() {
|
||||||
buf.toString('base64');
|
buf.toString('base64');
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
|
const skipMessage = 'intensive toString tests due to memory confinements';
|
||||||
|
if (!common.enoughTestMem)
|
||||||
|
common.skip(skipMessage);
|
||||||
|
|
||||||
const binding = require(`./build/${common.buildType}/binding`);
|
const binding = require(`./build/${common.buildType}/binding`);
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
const skipMessage = 'intensive toString tests due to memory confinements';
|
|
||||||
if (!common.enoughTestMem) {
|
|
||||||
common.skip(skipMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// v8 fails silently if string length > v8::String::kMaxLength
|
// v8 fails silently if string length > v8::String::kMaxLength
|
||||||
// v8::String::kMaxLength defined in v8.h
|
// v8::String::kMaxLength defined in v8.h
|
||||||
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
||||||
@ -21,14 +19,11 @@ try {
|
|||||||
// If the exception is not due to memory confinement then rethrow it.
|
// If the exception is not due to memory confinement then rethrow it.
|
||||||
if (e.message !== 'Array buffer allocation failed') throw (e);
|
if (e.message !== 'Array buffer allocation failed') throw (e);
|
||||||
common.skip(skipMessage);
|
common.skip(skipMessage);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure we have enough memory available for future allocations to succeed.
|
// Ensure we have enough memory available for future allocations to succeed.
|
||||||
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
|
if (!binding.ensureAllocation(2 * kStringMaxLength))
|
||||||
common.skip(skipMessage);
|
common.skip(skipMessage);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
assert.throws(function() {
|
assert.throws(function() {
|
||||||
buf.toString('latin1');
|
buf.toString('latin1');
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
|
const skipMessage = 'intensive toString tests due to memory confinements';
|
||||||
|
if (!common.enoughTestMem)
|
||||||
|
common.skip(skipMessage);
|
||||||
|
|
||||||
const binding = require(`./build/${common.buildType}/binding`);
|
const binding = require(`./build/${common.buildType}/binding`);
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
const skipMessage = 'intensive toString tests due to memory confinements';
|
|
||||||
if (!common.enoughTestMem) {
|
|
||||||
common.skip(skipMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// v8 fails silently if string length > v8::String::kMaxLength
|
// v8 fails silently if string length > v8::String::kMaxLength
|
||||||
// v8::String::kMaxLength defined in v8.h
|
// v8::String::kMaxLength defined in v8.h
|
||||||
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
||||||
@ -21,14 +19,11 @@ try {
|
|||||||
// If the exception is not due to memory confinement then rethrow it.
|
// If the exception is not due to memory confinement then rethrow it.
|
||||||
if (e.message !== 'Array buffer allocation failed') throw (e);
|
if (e.message !== 'Array buffer allocation failed') throw (e);
|
||||||
common.skip(skipMessage);
|
common.skip(skipMessage);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure we have enough memory available for future allocations to succeed.
|
// Ensure we have enough memory available for future allocations to succeed.
|
||||||
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
|
if (!binding.ensureAllocation(2 * kStringMaxLength))
|
||||||
common.skip(skipMessage);
|
common.skip(skipMessage);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
assert.throws(function() {
|
assert.throws(function() {
|
||||||
buf.toString('hex');
|
buf.toString('hex');
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
|
const skipMessage = 'intensive toString tests due to memory confinements';
|
||||||
|
if (!common.enoughTestMem)
|
||||||
|
common.skip(skipMessage);
|
||||||
|
|
||||||
const binding = require(`./build/${common.buildType}/binding`);
|
const binding = require(`./build/${common.buildType}/binding`);
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
const skipMessage = 'intensive toString tests due to memory confinements';
|
|
||||||
if (!common.enoughTestMem) {
|
|
||||||
common.skip(skipMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// v8 fails silently if string length > v8::String::kMaxLength
|
// v8 fails silently if string length > v8::String::kMaxLength
|
||||||
// v8::String::kMaxLength defined in v8.h
|
// v8::String::kMaxLength defined in v8.h
|
||||||
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
||||||
@ -21,14 +19,11 @@ try {
|
|||||||
// If the exception is not due to memory confinement then rethrow it.
|
// If the exception is not due to memory confinement then rethrow it.
|
||||||
if (e.message !== 'Array buffer allocation failed') throw (e);
|
if (e.message !== 'Array buffer allocation failed') throw (e);
|
||||||
common.skip(skipMessage);
|
common.skip(skipMessage);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure we have enough memory available for future allocations to succeed.
|
// Ensure we have enough memory available for future allocations to succeed.
|
||||||
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
|
if (!binding.ensureAllocation(2 * kStringMaxLength))
|
||||||
common.skip(skipMessage);
|
common.skip(skipMessage);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
assert.throws(function() {
|
assert.throws(function() {
|
||||||
buf.toString();
|
buf.toString();
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
|
const skipMessage = 'intensive toString tests due to memory confinements';
|
||||||
|
if (!common.enoughTestMem)
|
||||||
|
common.skip(skipMessage);
|
||||||
|
|
||||||
const binding = require(`./build/${common.buildType}/binding`);
|
const binding = require(`./build/${common.buildType}/binding`);
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
const skipMessage = 'intensive toString tests due to memory confinements';
|
|
||||||
if (!common.enoughTestMem) {
|
|
||||||
common.skip(skipMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// v8 fails silently if string length > v8::String::kMaxLength
|
// v8 fails silently if string length > v8::String::kMaxLength
|
||||||
// v8::String::kMaxLength defined in v8.h
|
// v8::String::kMaxLength defined in v8.h
|
||||||
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
||||||
@ -21,14 +19,11 @@ try {
|
|||||||
// If the exception is not due to memory confinement then rethrow it.
|
// If the exception is not due to memory confinement then rethrow it.
|
||||||
if (e.message !== 'Array buffer allocation failed') throw (e);
|
if (e.message !== 'Array buffer allocation failed') throw (e);
|
||||||
common.skip(skipMessage);
|
common.skip(skipMessage);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure we have enough memory available for future allocations to succeed.
|
// Ensure we have enough memory available for future allocations to succeed.
|
||||||
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
|
if (!binding.ensureAllocation(2 * kStringMaxLength))
|
||||||
common.skip(skipMessage);
|
common.skip(skipMessage);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const maxString = buf.toString('utf16le');
|
const maxString = buf.toString('utf16le');
|
||||||
assert.strictEqual(maxString.length, (kStringMaxLength + 2) / 2);
|
assert.strictEqual(maxString.length, (kStringMaxLength + 2) / 2);
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
|
const skipMessage = 'intensive toString tests due to memory confinements';
|
||||||
|
if (!common.enoughTestMem)
|
||||||
|
common.skip(skipMessage);
|
||||||
|
|
||||||
const binding = require(`./build/${common.buildType}/binding`);
|
const binding = require(`./build/${common.buildType}/binding`);
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
const skipMessage = 'intensive toString tests due to memory confinements';
|
|
||||||
if (!common.enoughTestMem) {
|
|
||||||
common.skip(skipMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// v8 fails silently if string length > v8::String::kMaxLength
|
// v8 fails silently if string length > v8::String::kMaxLength
|
||||||
// v8::String::kMaxLength defined in v8.h
|
// v8::String::kMaxLength defined in v8.h
|
||||||
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
||||||
@ -21,14 +19,11 @@ try {
|
|||||||
// If the exception is not due to memory confinement then rethrow it.
|
// If the exception is not due to memory confinement then rethrow it.
|
||||||
if (e.message !== 'Array buffer allocation failed') throw (e);
|
if (e.message !== 'Array buffer allocation failed') throw (e);
|
||||||
common.skip(skipMessage);
|
common.skip(skipMessage);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure we have enough memory available for future allocations to succeed.
|
// Ensure we have enough memory available for future allocations to succeed.
|
||||||
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
|
if (!binding.ensureAllocation(2 * kStringMaxLength))
|
||||||
common.skip(skipMessage);
|
common.skip(skipMessage);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
assert.throws(function() {
|
assert.throws(function() {
|
||||||
buf.toString('utf16le');
|
buf.toString('utf16le');
|
||||||
|
@ -22,7 +22,6 @@ try {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.code !== 'EPERM') throw err;
|
if (err.code !== 'EPERM') throw err;
|
||||||
common.skip('module identity test (no privs for symlinks)');
|
common.skip('module identity test (no privs for symlinks)');
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const sub = require('./submodule');
|
const sub = require('./submodule');
|
||||||
|
@ -1,16 +1,14 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const common = require('../common');
|
||||||
|
if (!common.hasCrypto)
|
||||||
|
common.skip('missing crypto');
|
||||||
|
|
||||||
const initHooks = require('./init-hooks');
|
const initHooks = require('./init-hooks');
|
||||||
const tick = require('./tick');
|
const tick = require('./tick');
|
||||||
const common = require('../common');
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const { checkInvocations } = require('./hook-checks');
|
const { checkInvocations } = require('./hook-checks');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const tls = require('tls');
|
const tls = require('tls');
|
||||||
const Connection = process.binding('crypto').Connection;
|
const Connection = process.binding('crypto').Connection;
|
||||||
const hooks = initHooks();
|
const hooks = initHooks();
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const tick = require('./tick');
|
const tick = require('./tick');
|
||||||
const initHooks = require('./init-hooks');
|
const initHooks = require('./init-hooks');
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const tick = require('./tick');
|
const tick = require('./tick');
|
||||||
const initHooks = require('./init-hooks');
|
const initHooks = require('./init-hooks');
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const initHooks = require('./init-hooks');
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const verifyGraph = require('./verify-graph');
|
if (!common.hasCrypto)
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
const initHooks = require('./init-hooks');
|
||||||
|
const verifyGraph = require('./verify-graph');
|
||||||
|
|
||||||
const tls = require('tls');
|
const tls = require('tls');
|
||||||
const Connection = process.binding('crypto').Connection;
|
const Connection = process.binding('crypto').Connection;
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.hasIPv6)
|
||||||
|
common.skip('IPv6 support required');
|
||||||
|
|
||||||
const initHooks = require('./init-hooks');
|
const initHooks = require('./init-hooks');
|
||||||
const verifyGraph = require('./verify-graph');
|
const verifyGraph = require('./verify-graph');
|
||||||
|
|
||||||
if (!common.hasIPv6) {
|
|
||||||
common.skip('IPv6 support required');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const net = require('net');
|
const net = require('net');
|
||||||
|
|
||||||
const hooks = initHooks();
|
const hooks = initHooks();
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.hasIPv6)
|
||||||
|
common.skip('IPv6 support required');
|
||||||
|
|
||||||
const initHooks = require('./init-hooks');
|
const initHooks = require('./init-hooks');
|
||||||
const verifyGraph = require('./verify-graph');
|
const verifyGraph = require('./verify-graph');
|
||||||
|
|
||||||
if (!common.hasIPv6) {
|
|
||||||
common.skip('IPv6 support required');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const net = require('net');
|
const net = require('net');
|
||||||
|
|
||||||
const hooks = initHooks();
|
const hooks = initHooks();
|
||||||
|
@ -1,21 +1,17 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.hasCrypto)
|
||||||
|
common.skip('missing crypto');
|
||||||
|
|
||||||
|
if (!common.hasIPv6)
|
||||||
|
common.skip('IPv6 support required');
|
||||||
|
|
||||||
const initHooks = require('./init-hooks');
|
const initHooks = require('./init-hooks');
|
||||||
const verifyGraph = require('./verify-graph');
|
const verifyGraph = require('./verify-graph');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!common.hasIPv6) {
|
|
||||||
common.skip('IPv6 support required');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const tls = require('tls');
|
const tls = require('tls');
|
||||||
|
|
||||||
const hooks = initHooks();
|
const hooks = initHooks();
|
||||||
hooks.enable();
|
hooks.enable();
|
||||||
|
|
||||||
|
@ -2,16 +2,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.hasIPv6)
|
||||||
|
common.skip('IPv6 support required');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const tick = require('./tick');
|
const tick = require('./tick');
|
||||||
const initHooks = require('./init-hooks');
|
const initHooks = require('./init-hooks');
|
||||||
const { checkInvocations } = require('./hook-checks');
|
const { checkInvocations } = require('./hook-checks');
|
||||||
|
|
||||||
if (!common.hasIPv6) {
|
|
||||||
common.skip('IPv6 support required');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const net = require('net');
|
const net = require('net');
|
||||||
|
|
||||||
let tcp1, tcp2, tcp3;
|
let tcp1, tcp2, tcp3;
|
||||||
|
@ -1,18 +1,16 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.hasCrypto)
|
||||||
|
common.skip('missing crypto');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const tick = require('./tick');
|
const tick = require('./tick');
|
||||||
const initHooks = require('./init-hooks');
|
const initHooks = require('./init-hooks');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const { checkInvocations } = require('./hook-checks');
|
const { checkInvocations } = require('./hook-checks');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const tls = require('tls');
|
const tls = require('tls');
|
||||||
|
|
||||||
const hooks = initHooks();
|
const hooks = initHooks();
|
||||||
hooks.enable();
|
hooks.enable();
|
||||||
|
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
|
const tty_fd = common.getTTYfd();
|
||||||
|
if (tty_fd < 0)
|
||||||
|
common.skip('no valid TTY fd available');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const tick = require('./tick');
|
const tick = require('./tick');
|
||||||
const initHooks = require('./init-hooks');
|
const initHooks = require('./init-hooks');
|
||||||
const { checkInvocations } = require('./hook-checks');
|
const { checkInvocations } = require('./hook-checks');
|
||||||
const tty_fd = common.getTTYfd();
|
|
||||||
|
|
||||||
if (tty_fd < 0)
|
|
||||||
return common.skip('no valid TTY fd available');
|
|
||||||
const ttyStream = (() => {
|
const ttyStream = (() => {
|
||||||
try {
|
try {
|
||||||
return new (require('tty').WriteStream)(tty_fd);
|
return new (require('tty').WriteStream)(tty_fd);
|
||||||
@ -17,7 +19,7 @@ const ttyStream = (() => {
|
|||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
if (ttyStream === null)
|
if (ttyStream === null)
|
||||||
return common.skip('no valid TTY fd available');
|
common.skip('no valid TTY fd available');
|
||||||
|
|
||||||
const hooks = initHooks();
|
const hooks = initHooks();
|
||||||
hooks.enable();
|
hooks.enable();
|
||||||
|
@ -1,17 +1,15 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.hasCrypto)
|
||||||
|
common.skip('missing crypto');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const initHooks = require('./init-hooks');
|
const initHooks = require('./init-hooks');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const { checkInvocations } = require('./hook-checks');
|
const { checkInvocations } = require('./hook-checks');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const tls = require('tls');
|
const tls = require('tls');
|
||||||
|
|
||||||
const hooks = initHooks();
|
const hooks = initHooks();
|
||||||
hooks.enable();
|
hooks.enable();
|
||||||
|
|
||||||
|
@ -264,6 +264,11 @@ Path to the test sock.
|
|||||||
|
|
||||||
Port tests are running on.
|
Port tests are running on.
|
||||||
|
|
||||||
|
### printSkipMessage(msg)
|
||||||
|
* `msg` [<String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)
|
||||||
|
|
||||||
|
Logs '1..0 # Skipped: ' + `msg`
|
||||||
|
|
||||||
### refreshTmpDir
|
### refreshTmpDir
|
||||||
* return [<String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)
|
* return [<String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)
|
||||||
|
|
||||||
@ -285,7 +290,7 @@ Path to the 'root' directory. either `/` or `c:\\` (windows)
|
|||||||
### skip(msg)
|
### skip(msg)
|
||||||
* `msg` [<String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)
|
* `msg` [<String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)
|
||||||
|
|
||||||
Logs '1..0 # Skipped: ' + `msg`
|
Logs '1..0 # Skipped: ' + `msg` and exits with exit code `0`.
|
||||||
|
|
||||||
### spawnPwd(options)
|
### spawnPwd(options)
|
||||||
* `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
* `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
||||||
|
@ -570,10 +570,15 @@ exports.mustNotCall = function(msg) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.skip = function(msg) {
|
exports.printSkipMessage = function(msg) {
|
||||||
console.log(`1..0 # Skipped: ${msg}`);
|
console.log(`1..0 # Skipped: ${msg}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.skip = function(msg) {
|
||||||
|
exports.printSkipMessage(msg);
|
||||||
|
process.exit(0);
|
||||||
|
};
|
||||||
|
|
||||||
// A stream to push an array into a REPL
|
// A stream to push an array into a REPL
|
||||||
function ArrayStream() {
|
function ArrayStream() {
|
||||||
this.run = function(data) {
|
this.run = function(data) {
|
||||||
@ -717,7 +722,6 @@ exports.expectsError = function expectsError({code, type, message}) {
|
|||||||
exports.skipIfInspectorDisabled = function skipIfInspectorDisabled() {
|
exports.skipIfInspectorDisabled = function skipIfInspectorDisabled() {
|
||||||
if (process.config.variables.v8_enable_inspector === 0) {
|
if (process.config.variables.v8_enable_inspector === 0) {
|
||||||
exports.skip('V8 inspector is disabled');
|
exports.skip('V8 inspector is disabled');
|
||||||
process.exit(0);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
|
||||||
const fs = require('fs');
|
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
// The doctool currently uses js-yaml from the tool/eslint/ tree.
|
// The doctool currently uses js-yaml from the tool/eslint/ tree.
|
||||||
try {
|
try {
|
||||||
require('../../tools/eslint/node_modules/js-yaml');
|
require('../../tools/eslint/node_modules/js-yaml');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return common.skip('missing js-yaml (eslint not present)');
|
common.skip('missing js-yaml (eslint not present)');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const assert = require('assert');
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
const processIncludes = require('../../tools/doc/preprocess.js');
|
const processIncludes = require('../../tools/doc/preprocess.js');
|
||||||
const html = require('../../tools/doc/html.js');
|
const html = require('../../tools/doc/html.js');
|
||||||
|
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
|
||||||
const fs = require('fs');
|
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
// The doctool currently uses js-yaml from the tool/eslint/ tree.
|
// The doctool currently uses js-yaml from the tool/eslint/ tree.
|
||||||
try {
|
try {
|
||||||
require('../../tools/eslint/node_modules/js-yaml');
|
require('../../tools/eslint/node_modules/js-yaml');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return common.skip('missing js-yaml (eslint not present)');
|
common.skip('missing js-yaml (eslint not present)');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const assert = require('assert');
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
const json = require('../../tools/doc/json.js');
|
const json = require('../../tools/doc/json.js');
|
||||||
|
|
||||||
// Outputs valid json with the expected fields when given simple markdown
|
// Outputs valid json with the expected fields when given simple markdown
|
||||||
|
9
test/fixtures/tls-connect.js
vendored
9
test/fixtures/tls-connect.js
vendored
@ -4,14 +4,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const fs = require('fs');
|
|
||||||
const join = require('path').join;
|
|
||||||
// Check if Node was compiled --without-ssl and if so exit early
|
// Check if Node was compiled --without-ssl and if so exit early
|
||||||
// as the require of tls will otherwise throw an Error.
|
// as the require of tls will otherwise throw an Error.
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
process.exit(0);
|
|
||||||
}
|
const fs = require('fs');
|
||||||
|
const join = require('path').join;
|
||||||
const tls = require('tls');
|
const tls = require('tls');
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
|
|
||||||
|
@ -9,10 +9,8 @@ const os = require('os');
|
|||||||
|
|
||||||
const ip = pickIPv4Address();
|
const ip = pickIPv4Address();
|
||||||
|
|
||||||
if (!ip) {
|
if (!ip)
|
||||||
common.skip('No IP address found');
|
common.skip('No IP address found');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkListResponse(instance, err, response) {
|
function checkListResponse(instance, err, response) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
@ -29,7 +27,7 @@ function checkListResponse(instance, err, response) {
|
|||||||
function checkError(instance, error) {
|
function checkError(instance, error) {
|
||||||
// Some OSes will not allow us to connect
|
// Some OSes will not allow us to connect
|
||||||
if (error.code === 'EHOSTUNREACH') {
|
if (error.code === 'EHOSTUNREACH') {
|
||||||
common.skip('Unable to connect to self');
|
common.printSkipMessage('Unable to connect to self');
|
||||||
} else {
|
} else {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,9 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (common.inFreeBSDJail)
|
||||||
|
common.skip('in a FreeBSD jail');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const dgram = require('dgram');
|
const dgram = require('dgram');
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
@ -35,11 +38,6 @@ const messages = [
|
|||||||
Buffer.from('Fourth message to send')
|
Buffer.from('Fourth message to send')
|
||||||
];
|
];
|
||||||
|
|
||||||
if (common.inFreeBSDJail) {
|
|
||||||
common.skip('in a FreeBSD jail');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let bindAddress = null;
|
let bindAddress = null;
|
||||||
|
|
||||||
// Take the first non-internal interface as the address for binding.
|
// Take the first non-internal interface as the address for binding.
|
||||||
|
@ -21,6 +21,10 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
// Skip test in FreeBSD jails.
|
||||||
|
if (common.inFreeBSDJail)
|
||||||
|
common.skip('In a FreeBSD jail');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const dgram = require('dgram');
|
const dgram = require('dgram');
|
||||||
const fork = require('child_process').fork;
|
const fork = require('child_process').fork;
|
||||||
@ -37,12 +41,6 @@ const listeners = 3;
|
|||||||
let listening, sendSocket, done, timer, dead;
|
let listening, sendSocket, done, timer, dead;
|
||||||
|
|
||||||
|
|
||||||
// Skip test in FreeBSD jails.
|
|
||||||
if (common.inFreeBSDJail) {
|
|
||||||
common.skip('In a FreeBSD jail');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
function launchChildProcess() {
|
function launchChildProcess() {
|
||||||
const worker = fork(__filename, ['child']);
|
const worker = fork(__filename, ['child']);
|
||||||
workers[worker.pid] = worker;
|
workers[worker.pid] = worker;
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.hasIPv6)
|
||||||
|
common.skip('this test, no IPv6 support');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const dns = require('dns');
|
const dns = require('dns');
|
||||||
const net = require('net');
|
const net = require('net');
|
||||||
@ -8,11 +11,6 @@ const isIPv6 = net.isIPv6;
|
|||||||
let running = false;
|
let running = false;
|
||||||
const queue = [];
|
const queue = [];
|
||||||
|
|
||||||
if (!common.hasIPv6) {
|
|
||||||
common.skip('this test, no IPv6 support');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
function TEST(f) {
|
function TEST(f) {
|
||||||
function next() {
|
function next() {
|
||||||
const f = queue.shift();
|
const f = queue.shift();
|
||||||
|
@ -22,10 +22,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
|
||||||
const https = require('https');
|
const https = require('https');
|
||||||
|
|
||||||
const http = require('http');
|
const http = require('http');
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test interaction of compiled-in CAs with user-provided CAs.
|
// Test interaction of compiled-in CAs with user-provided CAs.
|
||||||
|
|
||||||
|
@ -3,10 +3,8 @@
|
|||||||
// certification between Starfield Class 2 and ValiCert Class 2
|
// certification between Starfield Class 2 and ValiCert Class 2
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const tls = require('tls');
|
const tls = require('tls');
|
||||||
const socket = tls.connect(443, 'address.melissadata.net', function() {
|
const socket = tls.connect(443, 'address.melissadata.net', function() {
|
||||||
|
@ -22,10 +22,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
|
||||||
const tls = require('tls');
|
const tls = require('tls');
|
||||||
|
|
||||||
const net = require('net');
|
const net = require('net');
|
||||||
|
@ -9,7 +9,6 @@ if (common.isSunOS || common.isWindows || common.isAix) {
|
|||||||
// The current working directory cannot be removed on these platforms.
|
// The current working directory cannot be removed on these platforms.
|
||||||
// Change this to common.skip() when this is no longer a known issue test.
|
// Change this to common.skip() when this is no longer a known issue test.
|
||||||
assert.fail('cannot rmdir current working directory');
|
assert.fail('cannot rmdir current working directory');
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const cp = require('child_process');
|
const cp = require('child_process');
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Refs: https://github.com/nodejs/node/issues/13045
|
// Refs: https://github.com/nodejs/node/issues/13045
|
||||||
// An HTTP Agent reuses a TLSSocket, and makes a failed call to `asyncReset`.
|
// An HTTP Agent reuses a TLSSocket, and makes a failed call to `asyncReset`.
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const async_hooks = require('async_hooks');
|
const async_hooks = require('async_hooks');
|
||||||
const call_log = [0, 0, 0, 0]; // [before, callback, exception, after];
|
const call_log = [0, 0, 0, 0]; // [before, callback, exception, after];
|
||||||
|
@ -2,15 +2,11 @@
|
|||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (common.hasFipsCrypto) {
|
if (common.hasFipsCrypto)
|
||||||
common.skip('some benchmarks are FIPS-incompatible');
|
common.skip('some benchmarks are FIPS-incompatible');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Minimal test for crypto benchmarks. This makes sure the benchmarks aren't
|
// Minimal test for crypto benchmarks. This makes sure the benchmarks aren't
|
||||||
// horribly broken but nothing more than that.
|
// horribly broken but nothing more than that.
|
||||||
|
@ -917,7 +917,7 @@ if (common.hasCrypto) {
|
|||||||
crypto.createHash('sha1').update(b2).digest('hex')
|
crypto.createHash('sha1').update(b2).digest('hex')
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
common.skip('missing crypto');
|
common.printSkipMessage('missing crypto');
|
||||||
}
|
}
|
||||||
|
|
||||||
const ps = Buffer.poolSize;
|
const ps = Buffer.poolSize;
|
||||||
|
@ -28,15 +28,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (common.isWindows)
|
||||||
|
common.skip('Sending dgram sockets to child processes is not supported');
|
||||||
|
|
||||||
const dgram = require('dgram');
|
const dgram = require('dgram');
|
||||||
const fork = require('child_process').fork;
|
const fork = require('child_process').fork;
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
if (common.isWindows) {
|
|
||||||
common.skip('Sending dgram sockets to child processes is not supported');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process.argv[2] === 'child') {
|
if (process.argv[2] === 'child') {
|
||||||
let childServer;
|
let childServer;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
if (process.config.variables.node_without_node_options)
|
if (process.config.variables.node_without_node_options)
|
||||||
return common.skip('missing NODE_OPTIONS support');
|
common.skip('missing NODE_OPTIONS support');
|
||||||
|
|
||||||
// Test options specified by env variable.
|
// Test options specified by env variable.
|
||||||
|
|
||||||
|
@ -21,20 +21,16 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (common.isWindows)
|
||||||
|
common.skip('not reliable on Windows.');
|
||||||
|
|
||||||
|
if (process.getuid() === 0)
|
||||||
|
common.skip('Test is not supposed to be run as root.');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const cluster = require('cluster');
|
const cluster = require('cluster');
|
||||||
const net = require('net');
|
const net = require('net');
|
||||||
|
|
||||||
if (common.isWindows) {
|
|
||||||
common.skip('not reliable on Windows.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process.getuid() === 0) {
|
|
||||||
common.skip('Test is not supposed to be run as root.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cluster.isMaster) {
|
if (cluster.isMaster) {
|
||||||
cluster.fork().on('exit', common.mustCall((exitCode) => {
|
cluster.fork().on('exit', common.mustCall((exitCode) => {
|
||||||
assert.strictEqual(exitCode, 0);
|
assert.strictEqual(exitCode, 0);
|
||||||
|
@ -21,6 +21,9 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (common.isWindows)
|
||||||
|
common.skip('dgram clustering is currently not supported on Windows.');
|
||||||
|
|
||||||
const NUM_WORKERS = 4;
|
const NUM_WORKERS = 4;
|
||||||
const PACKETS_PER_WORKER = 10;
|
const PACKETS_PER_WORKER = 10;
|
||||||
|
|
||||||
@ -28,12 +31,6 @@ const assert = require('assert');
|
|||||||
const cluster = require('cluster');
|
const cluster = require('cluster');
|
||||||
const dgram = require('dgram');
|
const dgram = require('dgram');
|
||||||
|
|
||||||
|
|
||||||
if (common.isWindows) {
|
|
||||||
common.skip('dgram clustering is currently not supported on Windows.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cluster.isMaster)
|
if (cluster.isMaster)
|
||||||
master();
|
master();
|
||||||
else
|
else
|
||||||
|
@ -21,6 +21,9 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (common.isWindows)
|
||||||
|
common.skip('dgram clustering is currently not supported on Windows.');
|
||||||
|
|
||||||
const NUM_WORKERS = 4;
|
const NUM_WORKERS = 4;
|
||||||
const PACKETS_PER_WORKER = 10;
|
const PACKETS_PER_WORKER = 10;
|
||||||
|
|
||||||
@ -28,12 +31,6 @@ const cluster = require('cluster');
|
|||||||
const dgram = require('dgram');
|
const dgram = require('dgram');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
|
|
||||||
if (common.isWindows) {
|
|
||||||
common.skip('dgram clustering is currently not supported on Windows.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cluster.isMaster)
|
if (cluster.isMaster)
|
||||||
master();
|
master();
|
||||||
else
|
else
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (common.isWindows)
|
||||||
|
common.skip('dgram clustering is currently not supported on windows.');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const cluster = require('cluster');
|
const cluster = require('cluster');
|
||||||
const dgram = require('dgram');
|
const dgram = require('dgram');
|
||||||
|
|
||||||
if (common.isWindows) {
|
|
||||||
common.skip('dgram clustering is currently not supported on windows.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cluster.isMaster) {
|
if (cluster.isMaster) {
|
||||||
cluster.fork().on('exit', common.mustCall((code) => {
|
cluster.fork().on('exit', common.mustCall((code) => {
|
||||||
assert.strictEqual(code, 0);
|
assert.strictEqual(code, 0);
|
||||||
|
@ -4,15 +4,13 @@
|
|||||||
// Ref: https://github.com/nodejs/node/issues/4205
|
// Ref: https://github.com/nodejs/node/issues/4205
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (common.isWindows)
|
||||||
|
common.skip('This test does not apply to Windows.');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const net = require('net');
|
const net = require('net');
|
||||||
const cluster = require('cluster');
|
const cluster = require('cluster');
|
||||||
|
|
||||||
if (common.isWindows) {
|
|
||||||
common.skip('This test does not apply to Windows.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
cluster.schedulingPolicy = cluster.SCHED_NONE;
|
cluster.schedulingPolicy = cluster.SCHED_NONE;
|
||||||
|
|
||||||
if (cluster.isMaster) {
|
if (cluster.isMaster) {
|
||||||
|
@ -23,10 +23,8 @@
|
|||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
if (common.isWindows) {
|
if (common.isWindows)
|
||||||
common.skip('on windows, because clustered dgram is ENOTSUP');
|
common.skip('on windows, because clustered dgram is ENOTSUP');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const cluster = require('cluster');
|
const cluster = require('cluster');
|
||||||
const dgram = require('dgram');
|
const dgram = require('dgram');
|
||||||
|
@ -22,16 +22,15 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
|
||||||
const cluster = require('cluster');
|
|
||||||
const http = require('http');
|
|
||||||
|
|
||||||
if (common.isWindows) {
|
if (common.isWindows) {
|
||||||
common.skip(
|
common.skip(
|
||||||
'It is not possible to send pipe handles over the IPC pipe on Windows');
|
'It is not possible to send pipe handles over the IPC pipe on Windows');
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const assert = require('assert');
|
||||||
|
const cluster = require('cluster');
|
||||||
|
const http = require('http');
|
||||||
|
|
||||||
if (cluster.isMaster) {
|
if (cluster.isMaster) {
|
||||||
common.refreshTmpDir();
|
common.refreshTmpDir();
|
||||||
const worker = cluster.fork();
|
const worker = cluster.fork();
|
||||||
|
@ -21,20 +21,16 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (common.isWindows)
|
||||||
|
common.skip('not reliable on Windows');
|
||||||
|
|
||||||
|
if (process.getuid() === 0)
|
||||||
|
common.skip('as this test should not be run as `root`');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const cluster = require('cluster');
|
const cluster = require('cluster');
|
||||||
const net = require('net');
|
const net = require('net');
|
||||||
|
|
||||||
if (common.isWindows) {
|
|
||||||
common.skip('not reliable on Windows');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process.getuid() === 0) {
|
|
||||||
common.skip('as this test should not be run as `root`');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cluster.isMaster) {
|
if (cluster.isMaster) {
|
||||||
// Master opens and binds the socket and shares it with the worker.
|
// Master opens and binds the socket and shares it with the worker.
|
||||||
cluster.schedulingPolicy = cluster.SCHED_NONE;
|
cluster.schedulingPolicy = cluster.SCHED_NONE;
|
||||||
|
@ -21,12 +21,10 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
if (!common.hasCrypto)
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
crypto.DEFAULT_ENCODING = 'buffer';
|
crypto.DEFAULT_ENCODING = 'buffer';
|
||||||
@ -341,12 +339,12 @@ for (const i in TEST_CASES) {
|
|||||||
const test = TEST_CASES[i];
|
const test = TEST_CASES[i];
|
||||||
|
|
||||||
if (!ciphers.includes(test.algo)) {
|
if (!ciphers.includes(test.algo)) {
|
||||||
common.skip(`unsupported ${test.algo} test`);
|
common.printSkipMessage(`unsupported ${test.algo} test`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (common.hasFipsCrypto && test.iv.length < 24) {
|
if (common.hasFipsCrypto && test.iv.length < 24) {
|
||||||
common.skip('IV len < 12 bytes unsupported in FIPS mode');
|
common.printSkipMessage('IV len < 12 bytes unsupported in FIPS mode');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,10 +26,8 @@
|
|||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
@ -21,12 +21,10 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
if (!common.hasCrypto)
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
crypto.DEFAULT_ENCODING = 'buffer';
|
crypto.DEFAULT_ENCODING = 'buffer';
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
if (common.hasFipsCrypto)
|
||||||
if (common.hasFipsCrypto) {
|
|
||||||
common.skip('not supported in FIPS mode');
|
common.skip('not supported in FIPS mode');
|
||||||
return;
|
|
||||||
}
|
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
if (!common.hasCrypto)
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
function testCipher1(key, iv) {
|
function testCipher1(key, iv) {
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
if (!common.hasCrypto)
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
const tls = require('tls');
|
const tls = require('tls');
|
||||||
|
|
||||||
|
@ -21,12 +21,10 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
if (!common.hasCrypto)
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
if (!common.hasCrypto)
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
const DH_NOT_SUITABLE_GENERATOR = crypto.constants.DH_NOT_SUITABLE_GENERATOR;
|
const DH_NOT_SUITABLE_GENERATOR = crypto.constants.DH_NOT_SUITABLE_GENERATOR;
|
||||||
|
|
||||||
// Test Diffie-Hellman with two parties sharing a secret,
|
// Test Diffie-Hellman with two parties sharing a secret,
|
||||||
|
@ -21,13 +21,11 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.hasCrypto)
|
||||||
|
common.skip('missing crypto');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const domain = require('domain');
|
const domain = require('domain');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
function test(fn) {
|
function test(fn) {
|
||||||
|
@ -21,17 +21,16 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.hasCrypto)
|
||||||
|
common.skip('missing crypto');
|
||||||
|
|
||||||
const domain = require('domain');
|
const domain = require('domain');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
const crypto = require('crypto');
|
||||||
|
|
||||||
const d = domain.create();
|
const d = domain.create();
|
||||||
const expect = ['pbkdf2', 'randomBytes', 'pseudoRandomBytes'];
|
const expect = ['pbkdf2', 'randomBytes', 'pseudoRandomBytes'];
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const crypto = require('crypto');
|
|
||||||
|
|
||||||
d.on('error', common.mustCall(function(e) {
|
d.on('error', common.mustCall(function(e) {
|
||||||
assert.strictEqual(e.message, expect.shift());
|
assert.strictEqual(e.message, expect.shift());
|
||||||
}, 3));
|
}, 3));
|
||||||
|
@ -21,16 +21,13 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
if (!common.hasCrypto)
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
if (common.hasFipsCrypto)
|
||||||
if (common.hasFipsCrypto) {
|
|
||||||
common.skip('BF-ECB is not FIPS 140-2 compatible');
|
common.skip('BF-ECB is not FIPS 140-2 compatible');
|
||||||
return;
|
|
||||||
}
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
crypto.DEFAULT_ENCODING = 'buffer';
|
crypto.DEFAULT_ENCODING = 'buffer';
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.hasCrypto)
|
||||||
|
common.skip('missing crypto');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const spawnSync = require('child_process').spawnSync;
|
const spawnSync = require('child_process').spawnSync;
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const FIPS_ENABLED = 1;
|
const FIPS_ENABLED = 1;
|
||||||
const FIPS_DISABLED = 0;
|
const FIPS_DISABLED = 0;
|
||||||
const FIPS_ERROR_STRING = 'Error: Cannot set FIPS mode';
|
const FIPS_ERROR_STRING = 'Error: Cannot set FIPS mode';
|
||||||
|
@ -25,12 +25,10 @@
|
|||||||
|
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
if (!common.hasCrypto)
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
const EXTERN_APEX = 0xFBEE9;
|
const EXTERN_APEX = 0xFBEE9;
|
||||||
|
@ -22,10 +22,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.hasCrypto)
|
||||||
|
common.skip('missing crypto');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
// Test hashing
|
// Test hashing
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
if (!common.hasCrypto)
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
// Test for binding layer robustness
|
// Test for binding layer robustness
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
const Stream = require('stream');
|
const Stream = require('stream');
|
||||||
|
@ -21,12 +21,10 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
if (!common.hasCrypto)
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
crypto.DEFAULT_ENCODING = 'buffer';
|
crypto.DEFAULT_ENCODING = 'buffer';
|
||||||
|
@ -21,12 +21,10 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
if (!common.hasCrypto)
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
crypto.DEFAULT_ENCODING = 'buffer';
|
crypto.DEFAULT_ENCODING = 'buffer';
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.hasCrypto)
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
@ -22,10 +22,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.hasCrypto)
|
||||||
|
common.skip('missing crypto');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const constants = require('crypto').constants;
|
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
|
const constants = crypto.constants;
|
||||||
const fixtDir = common.fixturesDir;
|
const fixtDir = common.fixturesDir;
|
||||||
|
|
||||||
// Test certificates
|
// Test certificates
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.hasCrypto)
|
||||||
|
common.skip('missing crypto');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const exec = require('child_process').exec;
|
const exec = require('child_process').exec;
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
// Test certificates
|
// Test certificates
|
||||||
@ -245,10 +243,8 @@ const modSize = 1024;
|
|||||||
|
|
||||||
// RSA-PSS Sign test by verifying with 'openssl dgst -verify'
|
// RSA-PSS Sign test by verifying with 'openssl dgst -verify'
|
||||||
{
|
{
|
||||||
if (!common.opensslCli) {
|
if (!common.opensslCli)
|
||||||
common.skip('node compiled without OpenSSL CLI.');
|
common.skip('node compiled without OpenSSL CLI.');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const pubfile = path.join(common.fixturesDir, 'keys/rsa_public_2048.pem');
|
const pubfile = path.join(common.fixturesDir, 'keys/rsa_public_2048.pem');
|
||||||
const privfile = path.join(common.fixturesDir, 'keys/rsa_private_2048.pem');
|
const privfile = path.join(common.fixturesDir, 'keys/rsa_private_2048.pem');
|
||||||
|
@ -21,14 +21,12 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.hasCrypto)
|
||||||
|
common.skip('missing crypto');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const stream = require('stream');
|
const stream = require('stream');
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
// Small stream to buffer converter
|
// Small stream to buffer converter
|
||||||
|
@ -22,10 +22,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
const tls = require('tls');
|
const tls = require('tls');
|
||||||
|
|
||||||
|
@ -22,10 +22,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
|
||||||
|
if (common.isSunOS || common.isWindows || common.isAix)
|
||||||
|
common.skip('cannot rmdir current working directory');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const spawn = require('child_process').spawn;
|
const spawn = require('child_process').spawn;
|
||||||
|
|
||||||
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
|
|
||||||
if (common.isSunOS || common.isWindows || common.isAix) {
|
|
||||||
common.skip('cannot rmdir current working directory');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const dirname = `${common.tmpDir}/cwd-does-not-exist-${process.pid}`;
|
const dirname = `${common.tmpDir}/cwd-does-not-exist-${process.pid}`;
|
||||||
const abspathFile = require('path').join(common.fixturesDir, 'a.js');
|
const abspathFile = require('path').join(common.fixturesDir, 'a.js');
|
||||||
common.refreshTmpDir();
|
common.refreshTmpDir();
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
|
||||||
|
if (common.isSunOS || common.isWindows || common.isAix)
|
||||||
|
common.skip('cannot rmdir current working directory');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const spawn = require('child_process').spawn;
|
const spawn = require('child_process').spawn;
|
||||||
|
|
||||||
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
|
|
||||||
if (common.isSunOS || common.isWindows || common.isAix) {
|
|
||||||
common.skip('cannot rmdir current working directory');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const dirname = `${common.tmpDir}/cwd-does-not-exist-${process.pid}`;
|
const dirname = `${common.tmpDir}/cwd-does-not-exist-${process.pid}`;
|
||||||
common.refreshTmpDir();
|
common.refreshTmpDir();
|
||||||
fs.mkdirSync(dirname);
|
fs.mkdirSync(dirname);
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
|
||||||
|
if (common.isSunOS || common.isWindows || common.isAix)
|
||||||
|
common.skip('cannot rmdir current working directory');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const spawn = require('child_process').spawn;
|
const spawn = require('child_process').spawn;
|
||||||
|
|
||||||
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
|
|
||||||
if (common.isSunOS || common.isWindows || common.isAix) {
|
|
||||||
common.skip('cannot rmdir current working directory');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const dirname = `${common.tmpDir}/cwd-does-not-exist-${process.pid}`;
|
const dirname = `${common.tmpDir}/cwd-does-not-exist-${process.pid}`;
|
||||||
common.refreshTmpDir();
|
common.refreshTmpDir();
|
||||||
fs.mkdirSync(dirname);
|
fs.mkdirSync(dirname);
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.hasCrypto)
|
||||||
|
common.skip('missing crypto');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const spawn = require('child_process').spawn;
|
const spawn = require('child_process').spawn;
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
|
||||||
common.skip('missing crypto');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const child = spawn(process.execPath, ['debug']);
|
const child = spawn(process.execPath, ['debug']);
|
||||||
child.stderr.setEncoding('utf8');
|
child.stderr.setEncoding('utf8');
|
||||||
|
|
||||||
|
@ -21,15 +21,13 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
// skip test in FreeBSD jails since 0.0.0.0 will resolve to default interface
|
||||||
|
if (common.inFreeBSDJail)
|
||||||
|
common.skip('In a FreeBSD jail');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const dgram = require('dgram');
|
const dgram = require('dgram');
|
||||||
|
|
||||||
// skip test in FreeBSD jails since 0.0.0.0 will resolve to default interface
|
|
||||||
if (common.inFreeBSDJail) {
|
|
||||||
common.skip('In a FreeBSD jail');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
dgram.createSocket('udp4').bind(0, common.mustCall(function() {
|
dgram.createSocket('udp4').bind(0, common.mustCall(function() {
|
||||||
assert.strictEqual(typeof this.address().port, 'number');
|
assert.strictEqual(typeof this.address().port, 'number');
|
||||||
assert.ok(isFinite(this.address().port));
|
assert.ok(isFinite(this.address().port));
|
||||||
@ -39,7 +37,7 @@ dgram.createSocket('udp4').bind(0, common.mustCall(function() {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
if (!common.hasIPv6) {
|
if (!common.hasIPv6) {
|
||||||
common.skip('udp6 part of test, because no IPv6 support');
|
common.printSkipMessage('udp6 part of test, because no IPv6 support');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (common.isWindows)
|
||||||
|
common.skip('dgram clustering is currently not supported on windows.');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const cluster = require('cluster');
|
const cluster = require('cluster');
|
||||||
const dgram = require('dgram');
|
const dgram = require('dgram');
|
||||||
|
|
||||||
if (common.isWindows) {
|
|
||||||
common.skip('dgram clustering is currently not supported on windows.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cluster.isMaster) {
|
if (cluster.isMaster) {
|
||||||
cluster.fork();
|
cluster.fork();
|
||||||
} else {
|
} else {
|
||||||
|
@ -2,10 +2,8 @@
|
|||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
if (common.isOSX) {
|
if (common.isOSX)
|
||||||
common.skip('because of 17894467 Apple bug');
|
common.skip('because of 17894467 Apple bug');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const dgram = require('dgram');
|
const dgram = require('dgram');
|
||||||
|
@ -21,13 +21,10 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
if (common.isOSX)
|
||||||
|
|
||||||
if (common.isOSX) {
|
|
||||||
common.skip('because of 17894467 Apple bug');
|
common.skip('because of 17894467 Apple bug');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
const assert = require('assert');
|
||||||
const dgram = require('dgram');
|
const dgram = require('dgram');
|
||||||
|
|
||||||
const client = dgram.createSocket('udp4');
|
const client = dgram.createSocket('udp4');
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
if (common.isOSX)
|
||||||
|
|
||||||
if (common.isOSX) {
|
|
||||||
common.skip('because of 17894467 Apple bug');
|
common.skip('because of 17894467 Apple bug');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
const assert = require('assert');
|
||||||
const dgram = require('dgram');
|
const dgram = require('dgram');
|
||||||
|
|
||||||
const client = dgram.createSocket('udp4');
|
const client = dgram.createSocket('udp4');
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.hasIPv6)
|
||||||
|
common.skip('no IPv6 support');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const dgram = require('dgram');
|
const dgram = require('dgram');
|
||||||
|
|
||||||
if (!common.hasIPv6) {
|
|
||||||
common.skip('no IPv6 support');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const client = dgram.createSocket('udp6');
|
const client = dgram.createSocket('udp6');
|
||||||
|
|
||||||
const toSend = [Buffer.alloc(256, 'x'),
|
const toSend = [Buffer.alloc(256, 'x'),
|
||||||
|
@ -22,10 +22,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('node compiled without OpenSSL.');
|
common.skip('node compiled without OpenSSL.');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
@ -23,10 +23,8 @@
|
|||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto)
|
||||||
common.skip('node compiled without OpenSSL.');
|
common.skip('node compiled without OpenSSL.');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
if (!common.hasFipsCrypto)
|
||||||
|
|
||||||
if (!common.hasFipsCrypto) {
|
|
||||||
common.skip('node compiled without FIPS OpenSSL.');
|
common.skip('node compiled without FIPS OpenSSL.');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
const assert = require('assert');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
|
@ -21,15 +21,13 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.isWindows)
|
||||||
|
common.skip('this test is Windows-specific.');
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
if (!common.isWindows) {
|
|
||||||
common.skip('this test is Windows-specific.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// make a path that will be at least 260 chars long.
|
// make a path that will be at least 260 chars long.
|
||||||
const fileNameLen = Math.max(260 - common.tmpDir.length - 1, 1);
|
const fileNameLen = Math.max(260 - common.tmpDir.length - 1, 1);
|
||||||
const fileName = path.join(common.tmpDir, 'x'.repeat(fileNameLen));
|
const fileName = path.join(common.tmpDir, 'x'.repeat(fileNameLen));
|
||||||
|
@ -21,14 +21,12 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.isLinux)
|
||||||
|
common.skip('Test is linux specific.');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
if (!common.isLinux) {
|
|
||||||
common.skip('Test is linux specific.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test to make sure reading a file under the /proc directory works. See:
|
// Test to make sure reading a file under the /proc directory works. See:
|
||||||
// https://groups.google.com/forum/#!topic/nodejs-dev/rxZ_RoH1Gn0
|
// https://groups.google.com/forum/#!topic/nodejs-dev/rxZ_RoH1Gn0
|
||||||
const hostname = fs.readFileSync('/proc/sys/kernel/hostname');
|
const hostname = fs.readFileSync('/proc/sys/kernel/hostname');
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.isLinux)
|
||||||
|
common.skip('Test is linux specific.');
|
||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
if (!common.isLinux) {
|
|
||||||
common.skip('Test is linux specific.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
common.refreshTmpDir();
|
common.refreshTmpDir();
|
||||||
const filename = '\uD83D\uDC04';
|
const filename = '\uD83D\uDC04';
|
||||||
const root = Buffer.from(`${common.tmpDir}${path.sep}`);
|
const root = Buffer.from(`${common.tmpDir}${path.sep}`);
|
||||||
|
@ -21,17 +21,15 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
// `fs.readFile('/')` does not fail on FreeBSD, because you can open and read
|
||||||
|
// the directory there.
|
||||||
|
if (common.isFreeBSD)
|
||||||
|
common.skip('platform not supported.');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const exec = require('child_process').exec;
|
const exec = require('child_process').exec;
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
// `fs.readFile('/')` does not fail on FreeBSD, because you can open and read
|
|
||||||
// the directory there.
|
|
||||||
if (common.isFreeBSD) {
|
|
||||||
common.skip('platform not supported.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
function test(env, cb) {
|
function test(env, cb) {
|
||||||
const filename = path.join(common.fixturesDir, 'test-fs-readfile-error.js');
|
const filename = path.join(common.fixturesDir, 'test-fs-readfile-error.js');
|
||||||
const execPath = `"${process.execPath}" "${filename}"`;
|
const execPath = `"${process.execPath}" "${filename}"`;
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
// simulate `cat readfile.js | node readfile.js`
|
// simulate `cat readfile.js | node readfile.js`
|
||||||
|
|
||||||
if (common.isWindows || common.isAix) {
|
if (common.isWindows || common.isAix)
|
||||||
common.skip(`No /dev/stdin on ${process.platform}.`);
|
common.skip(`No /dev/stdin on ${process.platform}.`);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
const assert = require('assert');
|
||||||
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
if (process.argv[2] === 'child') {
|
if (process.argv[2] === 'child') {
|
||||||
|
@ -21,15 +21,13 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
|
||||||
|
|
||||||
// simulate `cat readfile.js | node readfile.js`
|
// simulate `cat readfile.js | node readfile.js`
|
||||||
|
|
||||||
if (common.isWindows || common.isAix) {
|
if (common.isWindows || common.isAix)
|
||||||
common.skip(`No /dev/stdin on ${process.platform}.`);
|
common.skip(`No /dev/stdin on ${process.platform}.`);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
const assert = require('assert');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
const dataExpected = fs.readFileSync(__filename, 'utf8');
|
const dataExpected = fs.readFileSync(__filename, 'utf8');
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
// simulate `cat readfile.js | node readfile.js`
|
// simulate `cat readfile.js | node readfile.js`
|
||||||
|
|
||||||
if (common.isWindows || common.isAix) {
|
if (common.isWindows || common.isAix)
|
||||||
common.skip(`No /dev/stdin on ${process.platform}.`);
|
common.skip(`No /dev/stdin on ${process.platform}.`);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
const assert = require('assert');
|
||||||
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
if (process.argv[2] === 'child') {
|
if (process.argv[2] === 'child') {
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
if (!common.isWindows)
|
||||||
|
common.skip('Test for Windows only');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const spawnSync = require('child_process').spawnSync;
|
const spawnSync = require('child_process').spawnSync;
|
||||||
|
|
||||||
if (!common.isWindows) {
|
|
||||||
common.skip('Test for Windows only');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let result;
|
let result;
|
||||||
|
|
||||||
// create a subst drive
|
// create a subst drive
|
||||||
@ -21,10 +20,8 @@ for (i = 0; i < driveLetters.length; ++i) {
|
|||||||
if (result.status === 0)
|
if (result.status === 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i === driveLetters.length) {
|
if (i === driveLetters.length)
|
||||||
common.skip('Cannot create subst drive');
|
common.skip('Cannot create subst drive');
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// schedule cleanup (and check if all callbacks where called)
|
// schedule cleanup (and check if all callbacks where called)
|
||||||
process.on('exit', function() {
|
process.on('exit', function() {
|
||||||
|
@ -2,10 +2,8 @@
|
|||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
if (common.isWindows || common.isAix) {
|
if (common.isWindows || common.isAix)
|
||||||
common.skip(`No /dev/stdin on ${process.platform}.`);
|
common.skip(`No /dev/stdin on ${process.platform}.`);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user