Merge "HTTPS HMs need the same validation path as HTTP"
This commit is contained in:
@@ -114,7 +114,8 @@ class HealthMonitorController(base.BaseController):
|
|||||||
raise exceptions.InvalidOption(value='None',
|
raise exceptions.InvalidOption(value='None',
|
||||||
option=consts.MAX_RETRIES)
|
option=consts.MAX_RETRIES)
|
||||||
|
|
||||||
if hm_dict[consts.TYPE] != consts.HEALTH_MONITOR_HTTP:
|
if hm_dict[consts.TYPE] not in (consts.HEALTH_MONITOR_HTTP,
|
||||||
|
consts.HEALTH_MONITOR_HTTPS):
|
||||||
if hm_dict.get(consts.HTTP_METHOD, None):
|
if hm_dict.get(consts.HTTP_METHOD, None):
|
||||||
raise exceptions.InvalidOption(
|
raise exceptions.InvalidOption(
|
||||||
value=consts.HTTP_METHOD, option='health monitors of '
|
value=consts.HTTP_METHOD, option='health monitors of '
|
||||||
|
@@ -680,6 +680,22 @@ class TestHealthMonitor(base.BaseAPITest):
|
|||||||
self.assertEqual('/', api_hm.get('url_path'))
|
self.assertEqual('/', api_hm.get('url_path'))
|
||||||
self.assertEqual('200', api_hm.get('expected_codes'))
|
self.assertEqual('200', api_hm.get('expected_codes'))
|
||||||
|
|
||||||
|
def test_create_https_full(self):
|
||||||
|
api_hm = self.create_health_monitor(
|
||||||
|
self.pool_id, constants.HEALTH_MONITOR_HTTPS,
|
||||||
|
1, 1, 1, 1, admin_state_up=False, expected_codes='200',
|
||||||
|
http_method='GET', name='Test HM', url_path='/').get(self.root_tag)
|
||||||
|
self.assertEqual(constants.HEALTH_MONITOR_HTTPS, api_hm.get('type'))
|
||||||
|
self.assertEqual(1, api_hm.get('delay'))
|
||||||
|
self.assertEqual(1, api_hm.get('timeout'))
|
||||||
|
self.assertEqual(1, api_hm.get('max_retries_down'))
|
||||||
|
self.assertEqual(1, api_hm.get('max_retries'))
|
||||||
|
self.assertFalse(api_hm.get('admin_state_up'))
|
||||||
|
self.assertEqual('Test HM', api_hm.get('name'))
|
||||||
|
self.assertEqual('GET', api_hm.get('http_method'))
|
||||||
|
self.assertEqual('/', api_hm.get('url_path'))
|
||||||
|
self.assertEqual('200', api_hm.get('expected_codes'))
|
||||||
|
|
||||||
def test_create_udp_case(self):
|
def test_create_udp_case(self):
|
||||||
api_hm = self.create_health_monitor(
|
api_hm = self.create_health_monitor(
|
||||||
self.udp_pool_with_listener_id,
|
self.udp_pool_with_listener_id,
|
||||||
|
Reference in New Issue
Block a user