Skip to content

Tests: Add host to ENV{no_proxy} when DNS lookup failure is expected

William R. Dieter requested to merge williamr/cmake:bad-dns-no_proxy into master

DNS lookup of an invalid host name fails with a different error in a proxy environment than it does in an environment without proxy. Many tools, including curl, use the no_proxy environment variable to provid a list of hosts for which proxy should not be used.

To make lookup failure consistent, add invalid host names to the no_proxy environment variable in tests that attempt to look up invalid host names. This way the lookup will fail consistently regardless of whether proxy is generally used or not.

It is also possible to make the tests work by the person (or automated process) running ctest setting the no_proxy environment variable. However, setting the environment variable is an extra step that make the tests less self-contained.

Merge request reports