Permalink
Browse files

test: improve check in test-os

The check for `os.networkInterfaces()` in `test-os.js` may be too
strict. It's apparently possible for a machine to be configured with
multiple IPv4 loopback interfaces. Increase specificity of filter to
check on only the object we expect.

PR-URL: #14655
Fixes: #14654
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
Trott authored and MylesBorins committed Aug 7, 2017
1 parent fc49cf4 commit 28b77d1f8be8a81a0ae53512be963707533ca046
Showing with 2 additions and 1 deletion.
  1. +2 −1 test/parallel/test-os.js
View
@@ -104,7 +104,8 @@ console.error(interfaces);
switch (platform) {
case 'linux':
{
const filter = (e) => e.address === '127.0.0.1';
const filter =
(e) => e.address === '127.0.0.1' && e.netmask === '255.0.0.0';
const actual = interfaces.lo.filter(filter);
const expected = [{ address: '127.0.0.1', netmask: '255.0.0.0',
mac: '00:00:00:00:00:00', family: 'IPv4',

0 comments on commit 28b77d1

Please sign in to comment.