[kudu-tool-test] fix ClusterNameResolverFileCorrupt with glibc 2.31

This patch updates the expected error message in the
ToolTest.ClusterNameResolverFileCorrupt scenario to make the test
pass on Ubuntu 20.04 LTS (it should fix it on other platforms which
use newer glibc versions).

Without this patch, the scenario failed on Ubuntu 20.04 LTS:

  src/kudu/tools/kudu-tool-test.cc:637: Failure
  Value of: stderr
  Expected: has substring "Network error: Could not connect to the cluster: unable to resolve address for bad: Name or service not known"
    Actual: "W0919 23:39:50.032436 1041101 flags.cc:405] Enabled unsafe flag: --openssl_security_level_override=0\nW0919 23:39:50.032559 1041101 flags.cc:405] Enabled unsafe flag: --never_fsync=true\nNetwork error: Could not connect to the cluster: unable to resolve address for bad: Temporary failure in name resolution"

Instead of tailoring the errno-converted message for every platform,
it's easier to rely in the essential part of it that corresponds
to the DNS resolver failure.

In addition, I did a minor cleanup on the code around, removing
calls of the Substitute() function where a fixed string is enough.

Change-Id: I3eb0991cb2d4311051e55e231cb4fe6d065aa632
Reviewed-on: http://gerrit.cloudera.org:8080/16478
Tested-by: Kudu Jenkins
Reviewed-by: Grant Henke <granthenke@apache.org>
1 file changed