🐞 Test both IPv4 & IPv6 TXT records

The test originally assumed the query would come from the IPv4 loopback,
not the IPv6 loopback. Now I specify the protocol in the dig query to
force either IPv4 or IPv6.

fixes:
```
  Expected
      <string>: "::1"

  to match regular expression
      <string>: 127.0.0.1
```
This commit is contained in:
Brian Cunnie
2021-07-22 22:44:32 -04:00
parent 2e730b8ad6
commit c1ae1462c3

View File

@@ -116,9 +116,13 @@ var _ = Describe("sslip.io-dns-server", func() {
`\A\z`,
`TypeSRV example.com. \? nil, SOA example.com. briancunnie.gmail.com. 2021061900 900 900 1800 300\n$`),
Entry("TXT is the querier's IP address when there are no custom/acme records",
"@localhost example.com txt +short",
"@localhost example.com txt +short -4",
`127.0.0.1`,
`TypeTXT example.com. \? \["127.0.0.1"\]`),
Entry("TXT is the querier's IP address when there are no custom/acme records",
"@localhost example.com txt +short -6",
`::1`,
`TypeTXT example.com. \? \["::1"\]`),
)
})
Describe("for more complex assertions", func() {