inspec/test/unit
Adam Leff c280e9a816 Fix host resolution on Darwin, use dig wherever possible (#1986)
* Fix host resolution on Darwin, use dig wherever possible

The `host` and `dig` commands do not return non-zero if a query returns NXDOMAIN
or NOERROR, but the DarwinHostProvider was expecting it when deciding whether to
fall back to IPv4 if a IPv6 query failed. Therefore, the `host` resource would
not function properly when resolving hostnames on Darwin. The logic has been
changed to use `dig` short output and query for both v6 and v4 addresses.

Additionally, the LinuxHostProvider has been modified to prefer `dig` if it's
available to keep behavior similar between Darwin and Linux whenever possible.
This has the added benefit of providing v6 and v4 resolution if possible where
`getent hosts` only returns v6 if v6 records exist.

Signed-off-by: Adam Leff <adam@leff.co>
2017-07-05 10:45:30 -04:00
..
bundles Extract Compliance::API version parsing to separate method (#1931) 2017-06-23 08:29:50 -07:00
dependencies Bump lockfile version to 1.0 2016-09-26 09:51:04 +01:00
dsl Reduce warnings (#1917) 2017-06-15 12:10:47 -04:00
fetchers Don't send HTTP headers that have nil values (#1948) 2017-06-21 19:09:13 -05:00
mock Fix host resolution on Darwin, use dig wherever possible (#1986) 2017-07-05 10:45:30 -04:00
plugins Remove some warnings during the test run 2016-09-09 14:14:36 +01:00
profiles Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
resources Fix host resolution on Darwin, use dig wherever possible (#1986) 2017-07-05 10:45:30 -04:00
source_readers add inspec.profile.file(...) for profile files 2017-05-03 20:39:27 +02:00
utils add the Nginx parser 2017-06-03 17:25:00 +02:00
file_provider_test.rb add inspec.profile.file(...) for profile files 2017-05-03 20:39:27 +02:00
runner_test.rb Handle parse errors for attrs/secrets 2017-05-09 13:44:33 +02:00
shell_detector_test.rb Add inspec env command to configure shell tab-completion 2016-08-10 02:07:53 +01:00