Repository: trafficserver Updated Branches: refs/heads/master 70409d223 -> bbc4188ff
Test for empty resolv_conf Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/bbc4188f Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/bbc4188f Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/bbc4188f Branch: refs/heads/master Commit: bbc4188ff21c83f91fb81b62501a5089e4b4f05f Parents: 70409d2 Author: Thomas Jackson <[email protected]> Authored: Wed Jul 22 17:35:32 2015 -0700 Committer: Thomas Jackson <[email protected]> Committed: Fri Aug 28 12:53:23 2015 -0700 ---------------------------------------------------------------------- ci/tsqa/tests/test_hostdb.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bbc4188f/ci/tsqa/tests/test_hostdb.py ---------------------------------------------------------------------- diff --git a/ci/tsqa/tests/test_hostdb.py b/ci/tsqa/tests/test_hostdb.py index 36ec8c8..ded286c 100644 --- a/ci/tsqa/tests/test_hostdb.py +++ b/ci/tsqa/tests/test_hostdb.py @@ -57,6 +57,28 @@ class EchoServerIpHandler(SocketServer.BaseRequestHandler): self.request.sendall(resp) +class TestHostDBBadResolvConf(helpers.EnvironmentCase): + ''' + Test that ATS can handle an empty resolv_conf + ''' + @classmethod + def setUpEnv(cls, env): + cls.configs['records.config']['CONFIG'].update({ + 'proxy.config.http.response_server_enabled': 2, # only add server headers when there weren't any + 'proxy.config.hostdb.lookup_timeout': 2, + 'proxy.config.dns.resolv_conf': '/tmp/non_existant_file', + 'proxy.config.url_remap.remap_required': 0, + + }) + + def test_working(self): + start = time.time() + ret = requests.get('http://trafficserver.readthedocs.org', + proxies=self.proxies, + ) + self.assertEqual(ret.status_code, 502) + + class TestHostDBPartiallyFailedDNS(helpers.EnvironmentCase): ''' Tests for how hostdb handles when there is one failed and one working resolver
