def test_5002_preflight_non_default_vhost(self):
"""Check that the non default vhost works and can be identified
"""
# FIXME: on preflight: detect bad proxy configuration with
# empty echo query. Means the 2nd vhost proxy is not working
# TODO: do this test also on first proxy and test_regular
self.real_test = "{0}_{1}".format(inspect.stack()[0][3],
self.tested_char_name)
if not self.config.getboolean('MULTIPLE_HOSTS_TESTS'):
self.skipTest("Tests with multiple virtualhosts are not activated"
" in configuration.")
if Register.hasFlag('non_default_vhost', default=False):
self.skipTest("Preflight test already done.")
self.setGravity(self.GRAVITY_MINOR)
self.req.set_method('GET')
self.req.host = self.config.get('SERVER_NON_DEFAULT_HOST')
self.req.location = self.get_non_default_location(
with_prefix=self.use_backend_location)
self._end_almost_regular_query(regular_expected=True)
Register.flag('non_default_vhost',
self.status == self.STATUS_ACCEPTED)
self.assertIn(self.status,
[self.STATUS_ACCEPTED],
'Bad response status {0}'.format(self.status))
评论列表
文章目录