| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 15dcb96 commit a465f2b
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,6 +10,7 @@ This directory contains modules used to test the Node.js implementation. | |||
| 10 | 10 | * [DNS module](#dns-module) | |
| 11 | 11 | * [Duplex pair helper](#duplex-pair-helper) | |
| 12 | 12 | * [Fixtures module](#fixtures-module) | |
| 13 | + * [Internet module](#internet-module) | ||
| 13 | 14 | * [WPT module](#wpt-module) | |
| 14 | 15 | ||
| 15 | 16 | ## Benchmark Module | |
@@ -498,6 +499,40 @@ Returns the result of | |||
| 498 | 499 | Returns the result of | |
| 499 | 500 | `fs.readFileSync(path.join(fixtures.fixturesDir, 'keys', arg), 'enc')`. | |
| 500 | 501 | ||
| 502 | + ## Internet Module | ||
| 503 | + | ||
| 504 | + The `common/internet` module provides utilities for working with | ||
| 505 | + internet-related tests. | ||
| 506 | + | ||
| 507 | + ### internet.addresses | ||
| 508 | + | ||
| 509 | + * [<Object>] | ||
| 510 | + * `INET_HOST` [<String>] A generic host that has registered common | ||
| 511 | + DNS records, supports both IPv4 and IPv6, and provides basic HTTP/HTTPS | ||
| 512 | + services | ||
| 513 | + * `INET4_HOST` [<String>] A host that provides IPv4 services | ||
| 514 | + * `INET6_HOST` [<String>] A host that provides IPv6 services | ||
| 515 | + * `INET4_IP` [<String>] An accessible IPv4 IP, defaults to the | ||
| 516 | + Google Public DNS IPv4 address | ||
| 517 | + * `INET6_IP` [<String>] An accessible IPv6 IP, defaults to the | ||
| 518 | + Google Public DNS IPv6 address | ||
| 519 | + * `INVALID_HOST` [<String>] An invalid host that cannot be resolved | ||
| 520 | + * `MX_HOST` [<String>] A host with MX records registered | ||
| 521 | + * `SRV_HOST` [<String>] A host with SRV records registered | ||
| 522 | + * `PTR_HOST` [<String>] A host with PTR records registered | ||
| 523 | + * `NAPTR_HOST` [<String>] A host with NAPTR records registered | ||
| 524 | + * `SOA_HOST` [<String>] A host with SOA records registered | ||
| 525 | + * `CNAME_HOST` [<String>] A host with CNAME records registered | ||
| 526 | + * `NS_HOST` [<String>] A host with NS records registered | ||
| 527 | + * `TXT_HOST` [<String>] A host with TXT records registered | ||
| 528 | + * `DNS4_SERVER` [<String>] An accessible IPv4 DNS server | ||
| 529 | + * `DNS6_SERVER` [<String>] An accessible IPv6 DNS server | ||
| 530 | + | ||
| 531 | + A set of addresses for internet-related tests. All properties are configurable | ||
| 532 | + via `NODE_TEST_*` environment variables. For example, to configure | ||
| 533 | + `internet.addresses.INET_HOST`, set the environment | ||
| 534 | + vairable `NODE_TEST_INET_HOST` to a specified host. | ||
| 535 | + | ||
| 501 | 536 | ## WPT Module | |
| 502 | 537 | ||
| 503 | 538 | The wpt.js module is a port of parts of | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -287,4 +287,6 @@ function writeDNSPacket(parsed) { | |||
| 287 | 287 | })); | |
| 288 | 288 | } | |
| 289 | 289 | ||
| 290 | - module.exports = { types, classes, writeDNSPacket, parseDNSPacket }; | ||
| 290 | + module.exports = { | ||
| 291 | + types, classes, writeDNSPacket, parseDNSPacket | ||
| 292 | + }; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,54 @@ | |||
| 1 | + /* eslint-disable required-modules */ | ||
| 2 | + 'use strict'; | ||
| 3 | + | ||
| 4 | + // Utilities for internet-related tests | ||
| 5 | + | ||
| 6 | + const 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 | + | ||
| 45 | + for (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 | + | ||
| 52 | + module.exports = { | ||
| 53 | + addresses | ||
| 54 | + }; | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments