• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* eslint-disable node-core/require-common-first, node-core/required-modules */
2'use strict';
3
4// Utilities for internet-related tests
5
6const addresses = {
7  // A generic host that has registered common DNS records,
8  // supports both IPv4 and IPv6, and provides basic HTTP/HTTPS services
9  INET_HOST: 'nodejs.org',
10  // A host that provides IPv4 services
11  INET4_HOST: 'nodejs.org',
12  // A host that provides IPv6 services
13  INET6_HOST: 'nodejs.org',
14  // An accessible IPv4 IP,
15  // defaults to the Google Public DNS IPv4 address
16  INET4_IP: '8.8.8.8',
17  // An accessible IPv6 IP,
18  // defaults to the Google Public DNS IPv6 address
19  INET6_IP: '2001:4860:4860::8888',
20  // An invalid host that cannot be resolved
21  // See https://tools.ietf.org/html/rfc2606#section-2
22  INVALID_HOST: 'something.invalid',
23  // A host with MX records registered
24  MX_HOST: 'nodejs.org',
25  // A host with SRV records registered
26  SRV_HOST: '_jabber._tcp.google.com',
27  // A host with PTR records registered
28  PTR_HOST: '8.8.8.8.in-addr.arpa',
29  // A host with NAPTR records registered
30  NAPTR_HOST: 'sip2sip.info',
31  // A host with SOA records registered
32  SOA_HOST: 'nodejs.org',
33  // A host with CNAME records registered
34  CNAME_HOST: 'blog.nodejs.org',
35  // A host with NS records registered
36  NS_HOST: 'nodejs.org',
37  // A host with TXT records registered
38  TXT_HOST: 'nodejs.org',
39  // An accessible IPv4 DNS server
40  DNS4_SERVER: '8.8.8.8',
41  // An accessible IPv4 DNS server
42  DNS6_SERVER: '2001:4860:4860::8888'
43};
44
45for (const key of Object.keys(addresses)) {
46  const envName = `NODE_TEST_${key}`;
47  if (process.env[envName]) {
48    addresses[key] = process.env[envName];
49  }
50}
51
52module.exports = {
53  addresses
54};
55