Skip to content

test: fix IPv6 checks on IBM i

This fix should help resolve some test failures:

That fail with:

AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ 'Unknown system error -42'
- 'EADDRNOTAVAIL'
    at Socket.<anonymous> (/home/IOJS/build/workspace/node-test-commit-ibmi/nodes/ibmi73-ppc64/test/parallel/test-net-autoselectfamilydefault.js:131:18)
    at Socket.<anonymous> (/home/IOJS/build/workspace/node-test-commit-ibmi/nodes/ibmi73-ppc64/test/common/index.js:448:15)
    at Socket.emit (node:events:518:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: 'Unknown system error -42',
  expected: 'EADDRNOTAVAIL',
  operator: 'strictEqual'
}

Node.js v20.0.0-pre

The issues I discovered were 2 fold:

  1. The hasIPv6 function cannot determine IPv6 on IBM i. The loop back interface on IBM i is named *LOOPBACK.

  2. When IPv6 is disabled IBM i returns EUNATCH (errno 42). For now, I've added an errno check in test case for. I believe that libuv needs to get updated to handle EUNATCH so that the error code can be addressed as EUNATCH. Similar to https://github.com/libuv/libuv/pull/3145

CC @nodejs/platform-ibmi CC @richardlau

Merge request reports

Loading