diff options
Diffstat (limited to 'test/parallel/test-fs-read-file-sync-hostname.js')
-rw-r--r-- | test/parallel/test-fs-read-file-sync-hostname.js | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/test/parallel/test-fs-read-file-sync-hostname.js b/test/parallel/test-fs-read-file-sync-hostname.js index de10573796..ca300819e7 100644 --- a/test/parallel/test-fs-read-file-sync-hostname.js +++ b/test/parallel/test-fs-read-file-sync-hostname.js @@ -1,10 +1,14 @@ 'use strict'; -require('../common'); -var assert = require('assert'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); -// test reading from hostname -if (process.platform === 'linux2') { - var hostname = fs.readFileSync('/proc/sys/kernel/hostname'); - assert.ok(hostname.length > 0); +if (!common.isLinux) { + common.skip('Test is linux specific.'); + return; } + +// 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); |