Skip to content

Commit

Permalink
test: use valid hostnames
Browse files Browse the repository at this point in the history
Use valid hostnames in
`test/sequential/test-net-server-listen-ipv6-link-local.js`.

Refs: nodejs#54554
PR-URL: nodejs#54556
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
  • Loading branch information
lpinca authored and louwers committed Nov 2, 2024
1 parent 19aff86 commit 5af7faf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/sequential/test-net-server-listen-ipv6-link-local.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (!common.hasIPv6) {
mock.method(dns, 'lookup', (hostname, options, callback) => {
callback(new Error('Mocked error'));
});
const host = 'ipv6_link_local';
const host = 'ipv6-link-local';

const server = net.createServer();

Expand All @@ -30,13 +30,13 @@ if (!common.hasIPv6) {
// Test on IPv6 Server, server.listen throws an error
{
mock.method(dns, 'lookup', (hostname, options, callback) => {
if (hostname === 'ipv6_link_local') {
if (hostname === 'ipv6-link-local') {
callback(null, [{ address: 'fe80::1', family: 6 }]);
} else {
dns.lookup.wrappedMethod(hostname, options, callback);
}
});
const host = 'ipv6_link_local';
const host = 'ipv6-link-local';

const server = net.createServer();

Expand All @@ -52,7 +52,7 @@ if (!common.hasIPv6) {
{

mock.method(dns, 'lookup', (hostname, options, callback) => {
if (hostname === 'ipv6_link_local_with_many_entries') {
if (hostname === 'ipv6-link-local-with-many-entries') {
callback(null, [
{ address: 'fe80::1', family: 6 },
{ address: 'fe80::abcd:1234', family: 6 },
Expand Down Expand Up @@ -84,7 +84,7 @@ if (!common.hasIPv6) {
}
});

const host = 'ipv6_link_local_with_many_entries';
const host = 'ipv6-link-local-with-many-entries';

const server = net.createServer();

Expand All @@ -103,11 +103,11 @@ if (!common.hasIPv6) {
// Test on IPv6 Server, picks ::1 because the other address is a link-local address
{

const host = 'ipv6_link_local_with_double_entry';
const host = 'ipv6-link-local-with-double-entry';
const validIpv6Address = '::1';

mock.method(dns, 'lookup', (hostname, options, callback) => {
if (hostname === 'ipv6_link_local_with_double_entry') {
if (hostname === 'ipv6-link-local-with-double-entry') {
callback(null, [
{ address: 'fe80::1', family: 6 },
{ address: validIpv6Address, family: 6 },
Expand Down

0 comments on commit 5af7faf

Please sign in to comment.