Commit Graph

13 Commits

Author SHA1 Message Date
Brian Cunnie
a37bbc150c CI: check sslip.io's A & AAAA records, and website
- The impetus? I deployed a custom webserver but forgot to add the
  A & AAAA records for sslip.io, so the website disappeared.
- I now check for the A & AAAA records (to be present, but not of any
  particular value because that gives me the latitude to migrate to
  other machines).
- I also check that the website is responsive.
- drive by: removed hard-coding of `sslip.io` in many tests; instead we
  now query the domain that the env var `DOMAIN` is set to.
2020-12-01 10:01:08 -08:00
Brian Cunnie
09249be0a0 CI: don't double-count the nameservers
On macOS, `whois` returns _two_ results for the domain `sslip.io` from
two different whois servers:

- whois.nic.io
- whois.namecheap.com

This means that every nameservers is double-counted. To fix, we remove
the duplicates.

fixes:
```
     Failure/Error: expect(dig_nameservers.sort).to eq(whois_nameservers.sort)

       expected: ["ns-aws.nono.io.", "ns-aws.nono.io.", "ns-azure.nono.io.", "ns-azure.nono.io.", "ns-gce.nono.io.", "ns-gce.nono.io."]
            got: ["ns-aws.nono.io.", "ns-azure.nono.io.", "ns-gce.nono.io."]

       (compared using ==)
     # ./spec/check-dns_spec.rb:44:in `block (3 levels) in <top (required)>'
```
2020-12-01 09:22:24 -08:00
Brian Cunnie
06f1556699 Revert "dig shouldn't bomb-out if forbidden hyphen is used"
DiG 9.10.6 no longer has the `+noidn` option, and `dig` will error if we
try to use it.

fixes:
```
dig +short +noidnin ns sslip.io @ns-azure.nono.io.
Invalid option: +noidnin
```

And this previously-invalid dig query now works, so we don't need the
option anyway:
```
dig +short AAAA api.--.sslip.io
::
```

This reverts commit a2564c12d3.
2020-12-01 09:17:08 -08:00
Brian Cunnie
a2564c12d3 dig shouldn't bomb-out if forbidden hyphen is used
Yes, according to the RFC it shouldn't begin with a hyphen. And, since
we're on the topic, underscores were supposed to be off the table, too,
but Microsoft used them anyway, and you know what? We're gonna use the
"forbidden hyphen". And we're gonna instruct `dig` to not be so
persnickety.

fixes:
```
dig +short  AAAA api.--.sslip.io
dig: idn2_lookup_ul failed: string start/ends with forbidden hyphen
```

I had to make it work for old-style (e.g. macOS dig) which is version
"DiG 9.8.3-P1" as well as for the new version ("DiG
9.11.3-RedHat-9.11.3-6.fc28") which has this new
[library](https://www.gnu.org/software/libidn/libidn2/reference/libidn2-idn2.html)
which does the following:

> Perform IDNA2008 lookup string conversion on domain name src , as described in section 5 of RFC 5891
2018-05-23 20:03:34 -07:00
Brian Cunnie
859107de14 🐞 Don't test resolution of Google's IPv6 DNS server twice
Instead, test one of my IPs.
2017-12-10 07:18:16 -08:00
Brian Cunnie
2642344d44 Test FQDNS -> IPv6 addresses 2017-12-10 06:27:58 -08:00
Brian Cunnie
3844f98c28 Unit tests show which command is being run
- helps me troubleshoot; I get lost at times.
- README shows more verbose variant of rspec
2017-09-21 06:01:10 -07:00
Brian Cunnie
a549b5b74d Nameservers should be lowercased
fixes:
```
nameserver NS-AZURE.NONO.IO.'s NS records match whois's ["NS-AZURE.NONO.IO.", "NS-AWS.NONO.IO.", "NS-HE.NONO.IO.", "NS-GCE.NONO.IO."] (FAILED - 1)
```
2017-07-05 13:57:42 -07:00
Brian Cunnie
e779757527 Adjust to new whois format:
- previously Name Server line began with "NS"
- now they begin with "Name Server"
- fixed typo

fixes:
```
1) sslip.io should have at least 2 nameservers
   Failure/Error: expect(whois_nameservers.size).to be > 1

     expected: > 1
          got:   0
   # ./sslip.io/spec/check-dns_spec.rb:37:in `block (2 levels) in <top (required)>'
```
2017-07-01 06:38:16 -07:00
Brian Cunnie
f4c93f3ed9 check for non-sslip.io domains
- fixed bug where SOA wasn't checked properly
- put comment on top so I can run tests locally more easily
2016-10-23 11:35:15 -07:00
Brian Cunnie
8597afdc06 Tests a more complex and random hostname 2016-09-09 13:29:29 -07:00
Brian Cunnie
d80ce16748 Test core fucntion of sslip.io
- w-x-y-z.sslip.io resolves to w.x.y.z
2016-09-09 06:27:41 -07:00
Brian Cunnie
5c5d7ae5ec use RSpec, not a custom bash script
Admittedly it's overkill to use RSpec to run a set of assertions against
a DNS server -- a simple shell script would have been shorter and more
understandable. We are using RSpec merely to practice using RSpec.

Also, RSpec is not quite appropriate because we're not testing a Ruby
class. In fact, we're not test Ruby code at all. So we should not be
using RSpec. Just sayin'.
2016-09-05 05:16:51 -07:00