Skip to content

Commit

Permalink
test: adds linux-only test for abstract sockets
Browse files Browse the repository at this point in the history
Introduce a new linux-only test for binding to an abstract unix socket
and then making an http request against that socket.

Refs: nodejs#49656
  • Loading branch information
ggoodman committed Sep 15, 2023
1 parent 6c2c61f commit 420c22b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/parallel/test-pipe-abstract-socket-http.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const http = require('http');

if (!common.isLinux) common.skip();

const server = http.createServer(
common.mustCall((req, res) => {
res.end('ok');
})
);

server.listen(
'\0abstract',
common.mustCall(() => {
http.get(
{
socketPath: server.address(),
},
common.mustCall((res) => {
assert.strictEqual(res.statusCode, 200);
server.close();
})
);
})
);

0 comments on commit 420c22b

Please sign in to comment.