mirror of https://github.com/lukechilds/node.git
Browse Source
Use the common.isWindows, common.isFreeBSD and common.isSunOS where possible. Add common.isOSX and common.isLinux. Fix `test-fs-read-file-sync-hostname` as in its current form was not being run anywhere. PR-URL: https://github.com/nodejs/node/pull/7845 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>v7.x
26 changed files with 46 additions and 40 deletions
@ -1,10 +1,14 @@ |
|||||
'use strict'; |
'use strict'; |
||||
require('../common'); |
const common = require('../common'); |
||||
var assert = require('assert'); |
const assert = require('assert'); |
||||
var fs = require('fs'); |
const fs = require('fs'); |
||||
|
|
||||
// test reading from hostname
|
if (!common.isLinux) { |
||||
if (process.platform === 'linux2') { |
common.skip('Test is linux specific.'); |
||||
var hostname = fs.readFileSync('/proc/sys/kernel/hostname'); |
return; |
||||
assert.ok(hostname.length > 0); |
|
||||
} |
} |
||||
|
|
||||
|
// Test to make sure reading a file under the /proc directory works. See:
|
||||
|
// https://groups.google.com/forum/#!topic/nodejs-dev/rxZ_RoH1Gn0
|
||||
|
const hostname = fs.readFileSync('/proc/sys/kernel/hostname'); |
||||
|
assert.ok(hostname.length > 0); |
||||
|
Loading…
Reference in new issue