| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,6 +45,7 @@ exports.isLinuxPPCBE = (process.platform === 'linux') && | |||
| 45 | 45 | (os.endianness() === 'BE'); | |
| 46 | 46 | exports.isSunOS = process.platform === 'sunos'; | |
| 47 | 47 | exports.isFreeBSD = process.platform === 'freebsd'; | |
| 48 | + exports.isOpenBSD = process.platform === 'openbsd'; | ||
| 48 | 49 | exports.isLinux = process.platform === 'linux'; | |
| 49 | 50 | exports.isOSX = process.platform === 'darwin'; | |
| 50 | 51 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,15 +16,22 @@ const cmd = `"${process.execPath}" "${__filename}" child`; | |||
| 16 | 16 | ||
| 17 | 17 | // Test the case where a timeout is set, and it expires. | |
| 18 | 18 | cp.exec(cmd, { timeout: 1 }, common.mustCall((err, stdout, stderr) => { | |
| 19 | + let sigterm = 'SIGTERM'; | ||
| 19 | 20 | assert.strictEqual(err.killed, true); | |
| 20 | - assert.strictEqual(err.code, null); | ||
| 21 | + // TODO OpenBSD returns a null signal and 143 for code | ||
| 22 | + if (common.isOpenBSD) { | ||
| 23 | + assert.strictEqual(err.code, 143); | ||
| 24 | + sigterm = null; | ||
| 25 | + } else { | ||
| 26 | + assert.strictEqual(err.code, null); | ||
| 27 | + } | ||
| 21 | 28 | // At least starting with Darwin Kernel Version 16.4.0, sending a SIGTERM to a | |
| 22 | 29 | // process that is still starting up kills it with SIGKILL instead of SIGTERM. | |
| 23 | 30 | // See: https://github.com/libuv/libuv/issues/1226 | |
| 24 | 31 | if (common.isOSX) | |
| 25 | 32 | assert.ok(err.signal === 'SIGTERM' || err.signal === 'SIGKILL'); | |
| 26 | 33 | else | |
| 27 | - assert.strictEqual(err.signal, 'SIGTERM'); | ||
| 34 | + assert.strictEqual(err.signal, sigterm); | ||
| 28 | 35 | assert.strictEqual(err.cmd, cmd); | |
| 29 | 36 | assert.strictEqual(stdout.trim(), ''); | |
| 30 | 37 | assert.strictEqual(stderr.trim(), ''); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -172,8 +172,8 @@ process.on('exit', function() { | |||
| 172 | 172 | const path = `${tmpdir.path}/test-utimes-precision`; | |
| 173 | 173 | fs.writeFileSync(path, ''); | |
| 174 | 174 | ||
| 175 | - // test Y2K38 for all platforms [except 'arm', and 'SunOS'] | ||
| 176 | - if (!process.arch.includes('arm') && !common.isSunOS) { | ||
| 175 | + // test Y2K38 for all platforms [except 'arm', 'OpenBSD' and 'SunOS'] | ||
| 176 | + if (!process.arch.includes('arm') && !common.isOpenBSD && !common.isSunOS) { | ||
| 177 | 177 | // because 2 ** 31 doesn't look right | |
| 178 | 178 | // eslint-disable-next-line space-infix-ops | |
| 179 | 179 | const Y2K38_mtime = 2**31; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,6 +32,10 @@ const https = require('https'); | |||
| 32 | 32 | const host = '*'.repeat(256); | |
| 33 | 33 | const MAX_TRIES = 5; | |
| 34 | 34 | ||
| 35 | + let errCode = 'ENOTFOUND'; | ||
| 36 | + if (common.isOpenBSD) | ||
| 37 | + errCode = 'EAI_FAIL'; | ||
| 38 | + | ||
| 35 | 39 | function tryGet(mod, tries) { | |
| 36 | 40 | // Bad host name should not throw an uncatchable exception. | |
| 37 | 41 | // Ensure that there is time to attach an error listener. | |
@@ -41,7 +45,7 @@ function tryGet(mod, tries) { | |||
| 41 | 45 | tryGet(mod, ++tries); | |
| 42 | 46 | return; | |
| 43 | 47 | } | |
| 44 | - assert.strictEqual(err.code, 'ENOTFOUND'); | ||
| 48 | + assert.strictEqual(err.code, errCode); | ||
| 45 | 49 | })); | |
| 46 | 50 | // http.get() called req1.end() for us | |
| 47 | 51 | } | |
@@ -57,7 +61,7 @@ function tryRequest(mod, tries) { | |||
| 57 | 61 | tryRequest(mod, ++tries); | |
| 58 | 62 | return; | |
| 59 | 63 | } | |
| 60 | - assert.strictEqual(err.code, 'ENOTFOUND'); | ||
| 64 | + assert.strictEqual(err.code, errCode); | ||
| 61 | 65 | })); | |
| 62 | 66 | req.end(); | |
| 63 | 67 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,17 +27,21 @@ const net = require('net'); | |||
| 27 | 27 | ||
| 28 | 28 | const host = '*'.repeat(256); | |
| 29 | 29 | ||
| 30 | + let errCode = 'ENOTFOUND'; | ||
| 31 | + if (common.isOpenBSD) | ||
| 32 | + errCode = 'EAI_FAIL'; | ||
| 33 | + | ||
| 30 | 34 | function do_not_call() { | |
| 31 | 35 | throw new Error('This function should not have been called.'); | |
| 32 | 36 | } | |
| 33 | 37 | ||
| 34 | 38 | const socket = net.connect(42, host, do_not_call); | |
| 35 | 39 | socket.on('error', common.mustCall(function(err) { | |
| 36 | - assert.strictEqual(err.code, 'ENOTFOUND'); | ||
| 40 | + assert.strictEqual(err.code, errCode); | ||
| 37 | 41 | })); | |
| 38 | 42 | socket.on('lookup', function(err, ip, type) { | |
| 39 | 43 | assert(err instanceof Error); | |
| 40 | - assert.strictEqual(err.code, 'ENOTFOUND'); | ||
| 44 | + assert.strictEqual(err.code, errCode); | ||
| 41 | 45 | assert.strictEqual(ip, undefined); | |
| 42 | 46 | assert.strictEqual(type, undefined); | |
| 43 | 47 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,7 +34,7 @@ exec(cmd, common.mustCall((error, stdout, stderr) => { | |||
| 34 | 34 | assert.strictEqual(stderr, ''); | |
| 35 | 35 | ||
| 36 | 36 | // freebsd always add ' (procname)' to the process title | |
| 37 | - if (common.isFreeBSD) | ||
| 37 | + if (common.isFreeBSD || common.isOpenBSD) | ||
| 38 | 38 | title += ` (${path.basename(process.execPath)})`; | |
| 39 | 39 | ||
| 40 | 40 | // omitting trailing whitespace and \n | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ | |||
| 20 | 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. | |
| 21 | 21 | ||
| 22 | 22 | 'use strict'; | |
| 23 | - require('../common'); | ||
| 23 | + const common = require('../common'); | ||
| 24 | 24 | const assert = require('assert'); | |
| 25 | 25 | const path = require('path'); | |
| 26 | 26 | const fs = require('fs'); | |
@@ -197,15 +197,21 @@ try { | |||
| 197 | 197 | require(`${loadOrder}file3`); | |
| 198 | 198 | } catch (e) { | |
| 199 | 199 | // Not a real .node module, but we know we require'd the right thing. | |
| 200 | - assert.ok(/file3\.node/.test(e.message.replace(backslash, '/'))); | ||
| 200 | + if (common.isOpenBSD) // OpenBSD errors with non-ELF object error | ||
| 201 | + assert.ok(/File not an ELF object/.test(e.message.replace(backslash, '/'))); | ||
| 202 | + else | ||
| 203 | + assert.ok(/file3\.node/.test(e.message.replace(backslash, '/'))); | ||
| 201 | 204 | } | |
| 202 | 205 | assert.strictEqual(require(`${loadOrder}file4`).file4, 'file4.reg', msg); | |
| 203 | 206 | assert.strictEqual(require(`${loadOrder}file5`).file5, 'file5.reg2', msg); | |
| 204 | 207 | assert.strictEqual(require(`${loadOrder}file6`).file6, 'file6/index.js', msg); | |
| 205 | 208 | try { | |
| 206 | 209 | require(`${loadOrder}file7`); | |
| 207 | 210 | } catch (e) { | |
| 208 | - assert.ok(/file7\/index\.node/.test(e.message.replace(backslash, '/'))); | ||
| 211 | + if (common.isOpenBSD) | ||
| 212 | + assert.ok(/File not an ELF object/.test(e.message.replace(backslash, '/'))); | ||
| 213 | + else | ||
| 214 | + assert.ok(/file7\/index\.node/.test(e.message.replace(backslash, '/'))); | ||
| 209 | 215 | } | |
| 210 | 216 | assert.strictEqual(require(`${loadOrder}file8`).file8, 'file8/index.reg', | |
| 211 | 217 | msg); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments