Adjust API tests for NotImplemented skip
This is a patch to restructure the API tests to use the
new skip_if_not_implemented capability.
Depends-On: https://review.opendev.org/745239
Change-Id: I291488e1c9418e51d6fe7ea142eaca13e3c181a0
diff --git a/octavia_tempest_plugin/common/constants.py b/octavia_tempest_plugin/common/constants.py
index ee4c16a..3bf8f3c 100644
--- a/octavia_tempest_plugin/common/constants.py
+++ b/octavia_tempest_plugin/common/constants.py
@@ -57,6 +57,7 @@
INSERT_HEADERS = 'insert_headers'
X_FORWARDED_FOR = 'X-Forwarded-For'
X_FORWARDED_PORT = 'X-Forwarded-Port'
+X_FORWARDED_PROTO = 'X-Forwarded-Proto'
TAGS = 'tags'
TIMEOUT_CLIENT_DATA = 'timeout_client_data'
TIMEOUT_MEMBER_CONNECT = 'timeout_member_connect'
diff --git a/octavia_tempest_plugin/config.py b/octavia_tempest_plugin/config.py
index 601c6c8..77d2f6e 100644
--- a/octavia_tempest_plugin/config.py
+++ b/octavia_tempest_plugin/config.py
@@ -50,10 +50,10 @@
choices=['public', 'admin', 'internal',
'publicURL', 'adminURL', 'internalURL'],
help="The endpoint type to use for the load-balancer service"),
- cfg.IntOpt('build_interval',
- default=5,
- help='Time in seconds between build status checks for '
- 'non-load-balancer resources to build'),
+ cfg.FloatOpt('build_interval',
+ default=5,
+ help='Time in seconds between build status checks for '
+ 'non-load-balancer resources to build'),
cfg.IntOpt('build_timeout',
default=300,
help='Timeout in seconds to wait for non-load-balancer '
@@ -62,9 +62,9 @@
help='The service_auth username the Octavia services are using'
'to access other OpenStack services.'),
# load-balancer specific options
- cfg.IntOpt('check_interval',
- default=5,
- help='Interval to check for status changes.'),
+ cfg.FloatOpt('check_interval',
+ default=5,
+ help='Interval to check for status changes.'),
cfg.IntOpt('check_timeout',
default=120,
help='Timeout, in seconds, to wait for a status change.'),
@@ -72,10 +72,10 @@
default=False,
help='Runs the tests assuming no-op drivers are being used. '
'Tests will assume no actual amphora are created.'),
- cfg.IntOpt('lb_build_interval',
- default=10,
- help='Time in seconds between build status checks for a '
- 'load balancer.'),
+ cfg.FloatOpt('lb_build_interval',
+ default=10,
+ help='Time in seconds between build status checks for a '
+ 'load balancer.'),
cfg.IntOpt('lb_build_timeout',
default=900,
help='Timeout in seconds to wait for a '
diff --git a/octavia_tempest_plugin/tests/api/v2/test_healthmonitor.py b/octavia_tempest_plugin/tests/api/v2/test_healthmonitor.py
index 5f4be23..d3f12ba 100644
--- a/octavia_tempest_plugin/tests/api/v2/test_healthmonitor.py
+++ b/octavia_tempest_plugin/tests/api/v2/test_healthmonitor.py
@@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
+import testtools
import time
from uuid import UUID
@@ -32,13 +33,6 @@
class HealthMonitorAPITest(test_base.LoadBalancerBaseTest):
"""Test the healthmonitor object API."""
-
- @classmethod
- def skip_checks(cls):
- super(HealthMonitorAPITest, cls).skip_checks()
- if not CONF.loadbalancer_feature_enabled.health_monitor_enabled:
- raise cls.skipException('Health Monitors not supported')
-
@classmethod
def resource_setup(cls):
"""Setup resources needed by the tests."""
@@ -62,8 +56,152 @@
CONF.load_balancer.lb_build_interval,
CONF.load_balancer.lb_build_timeout)
- @decorators.idempotent_id('30288670-5772-40c2-92e6-6d4a6d62d029')
- def test_healthmonitor_create(self):
+ @decorators.idempotent_id('bc3fc817-3368-4e1e-bb6d-52c4de3fb10c')
+ def test_LC_HTTP_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.HTTP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('18fcd6b8-9fc3-4858-83f6-d8800052b655')
+ def test_LC_HTTPS_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.HTTPS, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('5b0446f2-374e-4e74-9865-72e16a19c587')
+ def test_LC_PING_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.TCP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('46c4e159-84d2-4876-9298-ac85561d3bd0')
+ def test_LC_TCP_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.TCP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('a15f7319-2d3b-4ec8-9d70-e77a55045145')
+ def test_LC_TLS_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.TCP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('f609b2c2-391d-4bc9-9793-9a4bc30ab00b')
+ def test_LC_UDP_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.UDP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
+ @decorators.idempotent_id('4f20473f-ab02-4426-8d15-cf34b3c72558')
+ def test_RR_HTTP_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('abfff805-5491-4aef-9952-45b553cbebbb')
+ def test_RR_HTTPS_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.HTTPS, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('ac64228e-dc4c-4116-b610-5783a85a87f1')
+ def test_RR_PING_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.TCP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('e3ac7193-1dc9-41df-a4e2-7d40ca70a678')
+ def test_RR_TCP_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.TCP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('54952a9a-b3ef-4b36-a586-9adcd63dfc49')
+ def test_RR_TLS_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.TCP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('9af20b3c-fc42-4365-a4e9-cecbdddf90c0')
+ def test_RR_UDP_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.UDP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
+ @decorators.idempotent_id('35b076a4-dfb1-4557-9eac-a33982f73856')
+ def test_SI_HTTP_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.HTTP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('965804cb-d6a1-4fdd-99dc-948829e0c046')
+ def test_SI_HTTPS_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.HTTPS, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('eb86eab1-4cdf-40fc-b633-679d7fb64806')
+ def test_SI_PING_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('6bdab976-b6ad-4c83-87ab-0d184e80eb2c')
+ def test_SI_TCP_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('4f8111dd-4f03-4740-ae4b-b13b731f45a0')
+ def test_SI_TLS_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('d98365ca-56ba-450d-955f-d1c06c329960')
+ def test_SI_UDP_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.UDP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
+ @decorators.idempotent_id('acab47f5-3006-4e84-a55f-e9dfe33113d2')
+ def test_SIP_HTTP_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.HTTP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('ca42a541-3280-4496-8604-9ce64e1992d6')
+ def test_SIP_HTTPS_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.HTTPS, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('78c8e5fc-3ba0-44d0-ac4a-93a90fb59c3f')
+ def test_SIP_PING_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('d5b50306-a3bd-4293-96ed-17a2897d57cc')
+ def test_SIP_TCP_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('204556df-185e-4305-b1b7-e8d345d645e4')
+ def test_SIP_TLS_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('2de53a00-c631-4985-abc1-89070ac2515f')
+ def test_SIP_UDP_healthmonitor_create(self):
+ self._test_healthmonitor_create(
+ const.UDP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
+ def _test_healthmonitor_create(self, pool_protocol, pool_algorithm,
+ hm_type):
"""Tests healthmonitor create and basic show APIs.
* Create a clean pool to use for the healthmonitor.
@@ -73,15 +211,36 @@
* Show healthmonitor details.
* Validate the show reflects the requested values.
"""
+ if (pool_algorithm == const.LB_ALGORITHM_SOURCE_IP_PORT and not
+ self.mem_listener_client.is_version_supported(
+ self.api_version, '2.13')):
+ raise testtools.TestCase.skipException(
+ 'Skipping this test as load balancing algorithm '
+ 'SOURCE_IP_PORT requires API version 2.13 or newer.')
+
pool_name = data_utils.rand_name("lb_member_pool1_hm-create")
pool_kwargs = {
const.NAME: pool_name,
- const.PROTOCOL: const.HTTP,
- const.LB_ALGORITHM: self.lb_algorithm,
+ const.PROTOCOL: pool_protocol,
+ const.LB_ALGORITHM: pool_algorithm,
const.LOADBALANCER_ID: self.lb_id,
}
- pool = self.mem_pool_client.create_pool(**pool_kwargs)
+ # This is a special case as the reference driver does not support
+ # SOURCE-IP-PORT. Since it runs with not_implemented_is_error, we must
+ # handle this test case special.
+ try:
+ pool = self.mem_pool_client.create_pool(**pool_kwargs)
+ except exceptions.NotImplemented as e:
+ if pool_algorithm != const.LB_ALGORITHM_SOURCE_IP_PORT:
+ raise
+ message = ("The configured provider driver '{driver}' "
+ "does not support a feature required for this "
+ "test.".format(driver=CONF.load_balancer.provider))
+ if hasattr(e, 'resp_body'):
+ message = e.resp_body.get('faultstring', message)
+ raise testtools.TestCase.skipException(message)
+
self.addCleanup(
self.mem_pool_client.cleanup_pool, pool[const.ID],
lb_client=self.mem_lb_client, lb_id=self.lb_id)
@@ -93,19 +252,21 @@
CONF.load_balancer.build_timeout)
hm_name = data_utils.rand_name("lb_member_hm1-create")
+ delay = 3 if hm_type == const.HEALTH_MONITOR_UDP_CONNECT else 2
hm_kwargs = {
const.POOL_ID: pool[const.ID],
const.NAME: hm_name,
- const.TYPE: const.HEALTH_MONITOR_HTTP,
- const.DELAY: 2,
+ const.TYPE: hm_type,
+ const.DELAY: delay,
const.TIMEOUT: 3,
const.MAX_RETRIES: 4,
const.MAX_RETRIES_DOWN: 5,
- const.HTTP_METHOD: const.GET,
- const.URL_PATH: '/',
- const.EXPECTED_CODES: '200-204',
const.ADMIN_STATE_UP: True,
}
+ if hm_type == const.HEALTH_MONITOR_HTTP:
+ hm_kwargs.update({const.HTTP_METHOD: const.GET,
+ const.URL_PATH: '/',
+ const.EXPECTED_CODES: '200-204'})
if self.mem_listener_client.is_version_supported(
self.api_version, '2.5'):
@@ -149,8 +310,10 @@
equal_items = [const.NAME, const.TYPE, const.DELAY, const.TIMEOUT,
const.MAX_RETRIES, const.MAX_RETRIES_DOWN,
- const.HTTP_METHOD, const.URL_PATH, const.EXPECTED_CODES,
const.ADMIN_STATE_UP]
+ if hm_type == const.HEALTH_MONITOR_HTTP:
+ equal_items = equal_items + [const.HTTP_METHOD, const.URL_PATH,
+ const.EXPECTED_CODES]
for item in equal_items:
self.assertEqual(hm_kwargs[item], hm[item])
@@ -167,8 +330,151 @@
def _filter_hms_by_index(self, hms, indexes):
return [hm for i, hm in enumerate(hms) if i not in indexes]
+ @decorators.idempotent_id('9e4b1298-b6a0-46c7-b8e4-afcd31f904d3')
+ def test_LC_HTTP_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.HTTP,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('7488b1e1-12b5-4a42-9d78-9e08060ec7b1')
+ def test_LC_HTTPS_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.HTTPS,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('1f93483c-29ae-4ac1-a588-9ce9bd837232')
+ def test_LC_PING_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.TCP,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('49ccd27c-3a4c-41e5-bcb0-d4f03ecc3e79')
+ def test_LC_TCP_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.TCP,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('60a254dc-4764-45f2-a183-8102063462e0')
+ def test_LC_TLS_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.TCP,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('6637d37d-76aa-455a-ba73-8f1a12edcedd')
+ def test_LC_UDP_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.UDP,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
@decorators.idempotent_id('c9a9f20c-3680-4ae8-b657-33c687258fea')
- def test_healthmonitor_list(self):
+ def test_RR_HTTP_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.HTTP,
+ const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('93c0d03a-eb32-457b-a5af-96c03a891c06')
+ def test_RR_HTTPS_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.HTTPS,
+ const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('2ef2944f-dd56-40a5-9100-4e1b86c623af')
+ def test_RR_PING_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.TCP,
+ const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('5912534f-20b3-45b7-9907-9247bf05cd13')
+ def test_RR_TCP_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.TCP,
+ const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('5d169fe7-16f3-4f70-8b1e-72aeeec4fd61')
+ def test_RR_TLS_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.TCP,
+ const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('3f81050e-4218-46fa-8d85-09807b8cdded')
+ def test_RR_UDP_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.UDP,
+ const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
+ @decorators.idempotent_id('2df98839-7b2a-46c4-9da7-34e3d1c33851')
+ def test_SI_HTTP_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.HTTP,
+ const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('1ce28897-917c-4e7a-89bb-cc2aabd67037')
+ def test_SI_HTTPS_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.HTTPS,
+ const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('e8418eaa-73a5-4d56-8ca5-314dd2141dc9')
+ def test_SI_PING_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.TCP,
+ const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('25203919-a039-43a4-84db-15279cbd2ec7')
+ def test_SI_TCP_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.TCP,
+ const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('4f84c05e-d4a7-4998-98cd-bc74024309f4')
+ def test_SI_TLS_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.TCP,
+ const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('4cb10c86-a875-4a9e-be8f-c0afc8aa5633')
+ def test_SI_UDP_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.UDP,
+ const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
+ @decorators.idempotent_id('45bdd757-3132-4ede-8584-c46bc2f8f19e')
+ def test_SIP_HTTP_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.HTTP,
+ const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('300db789-b231-45be-863d-f4d6116660d3')
+ def test_SIP_HTTPS_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.HTTPS,
+ const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('a1d534ba-ada9-4d7c-8e17-6e520a27c110')
+ def test_SIP_PING_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.TCP,
+ const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('12c29b89-bbbc-46b0-89c5-beb42fc52181')
+ def test_SIP_TCP_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.TCP,
+ const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('a3b01b12-f4cb-4b2a-9f62-af24834ce19b')
+ def test_SIP_TLS_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.TCP,
+ const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('571e139b-08ae-4e8c-b25c-0e0bb9d198af')
+ def test_SIP_UDP_healthmonitor_list(self):
+ self._test_healthmonitor_list(const.UDP,
+ const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
+ def _test_healthmonitor_list(self, pool_protocol, pool_algorithm, hm_type):
"""Tests healthmonitor list API and field filtering.
* Create three clean pools to use for the healthmonitors.
@@ -182,6 +488,13 @@
* List the healthmonitors filtering to one of the three.
* List the healthmonitors filtered, one field, and sorted.
"""
+ if (pool_algorithm == const.LB_ALGORITHM_SOURCE_IP_PORT and not
+ self.mem_listener_client.is_version_supported(
+ self.api_version, '2.13')):
+ raise testtools.TestCase.skipException(
+ 'Skipping this test as load balancing algorithm '
+ 'SOURCE_IP_PORT requires API version 2.13 or newer.')
+
# Get a list of pre-existing HMs to filter from test data
pretest_hms = self.mem_healthmonitor_client.list_healthmonitors()
# Store their IDs for easy access
@@ -190,12 +503,26 @@
pool1_name = data_utils.rand_name("lb_member_pool1_hm-list")
pool1_kwargs = {
const.NAME: pool1_name,
- const.PROTOCOL: const.HTTP,
- const.LB_ALGORITHM: self.lb_algorithm,
+ const.PROTOCOL: pool_protocol,
+ const.LB_ALGORITHM: pool_algorithm,
const.LOADBALANCER_ID: self.lb_id,
}
- pool1 = self.mem_pool_client.create_pool(**pool1_kwargs)
+ # This is a special case as the reference driver does not support
+ # SOURCE-IP-PORT. Since it runs with not_implemented_is_error, we must
+ # handle this test case special.
+ try:
+ pool1 = self.mem_pool_client.create_pool(**pool1_kwargs)
+ except exceptions.NotImplemented as e:
+ if pool_algorithm != const.LB_ALGORITHM_SOURCE_IP_PORT:
+ raise
+ message = ("The configured provider driver '{driver}' "
+ "does not support a feature required for this "
+ "test.".format(driver=CONF.load_balancer.provider))
+ if hasattr(e, 'resp_body'):
+ message = e.resp_body.get('faultstring', message)
+ raise testtools.TestCase.skipException(message)
+
pool1_id = pool1[const.ID]
self.addCleanup(
self.mem_pool_client.cleanup_pool, pool1_id,
@@ -210,8 +537,8 @@
pool2_name = data_utils.rand_name("lb_member_pool2_hm-list")
pool2_kwargs = {
const.NAME: pool2_name,
- const.PROTOCOL: const.HTTP,
- const.LB_ALGORITHM: self.lb_algorithm,
+ const.PROTOCOL: pool_protocol,
+ const.LB_ALGORITHM: pool_algorithm,
const.LOADBALANCER_ID: self.lb_id,
}
@@ -230,8 +557,8 @@
pool3_name = data_utils.rand_name("lb_member_pool3_hm-list")
pool3_kwargs = {
const.NAME: pool3_name,
- const.PROTOCOL: const.HTTP,
- const.LB_ALGORITHM: self.lb_algorithm,
+ const.PROTOCOL: pool_protocol,
+ const.LB_ALGORITHM: pool_algorithm,
const.LOADBALANCER_ID: self.lb_id,
}
@@ -248,19 +575,21 @@
CONF.load_balancer.build_timeout)
hm1_name = data_utils.rand_name("lb_member_hm2-list")
+ delay = 3 if hm_type == const.HEALTH_MONITOR_UDP_CONNECT else 2
hm1_kwargs = {
const.POOL_ID: pool1_id,
const.NAME: hm1_name,
- const.TYPE: const.HEALTH_MONITOR_HTTP,
- const.DELAY: 2,
+ const.TYPE: hm_type,
+ const.DELAY: delay,
const.TIMEOUT: 3,
- const.MAX_RETRIES: 4,
+ const.MAX_RETRIES: 2,
const.MAX_RETRIES_DOWN: 5,
- const.HTTP_METHOD: const.GET,
- const.URL_PATH: '/B',
- const.EXPECTED_CODES: '200-204',
const.ADMIN_STATE_UP: True,
}
+ if hm_type == const.HEALTH_MONITOR_HTTP:
+ hm1_kwargs.update({const.HTTP_METHOD: const.GET,
+ const.URL_PATH: '/B',
+ const.EXPECTED_CODES: '200-204'})
if self.mem_healthmonitor_client.is_version_supported(
self.api_version, '2.5'):
@@ -294,16 +623,17 @@
hm2_kwargs = {
const.POOL_ID: pool2_id,
const.NAME: hm2_name,
- const.TYPE: const.HEALTH_MONITOR_HTTP,
- const.DELAY: 2,
+ const.TYPE: hm_type,
+ const.DELAY: delay,
const.TIMEOUT: 3,
- const.MAX_RETRIES: 4,
+ const.MAX_RETRIES: 1,
const.MAX_RETRIES_DOWN: 5,
- const.HTTP_METHOD: const.GET,
- const.URL_PATH: '/A',
- const.EXPECTED_CODES: '200-204',
const.ADMIN_STATE_UP: True,
}
+ if hm_type == const.HEALTH_MONITOR_HTTP:
+ hm2_kwargs.update({const.HTTP_METHOD: const.GET,
+ const.URL_PATH: '/A',
+ const.EXPECTED_CODES: '200-204'})
if self.mem_listener_client.is_version_supported(
self.api_version, '2.5'):
@@ -337,16 +667,17 @@
hm3_kwargs = {
const.POOL_ID: pool3_id,
const.NAME: hm3_name,
- const.TYPE: const.HEALTH_MONITOR_HTTP,
- const.DELAY: 2,
+ const.TYPE: hm_type,
+ const.DELAY: delay,
const.TIMEOUT: 3,
- const.MAX_RETRIES: 4,
+ const.MAX_RETRIES: 3,
const.MAX_RETRIES_DOWN: 5,
- const.HTTP_METHOD: const.GET,
- const.URL_PATH: '/C',
- const.EXPECTED_CODES: '200-204',
const.ADMIN_STATE_UP: False,
}
+ if hm_type == const.HEALTH_MONITOR_HTTP:
+ hm3_kwargs.update({const.HTTP_METHOD: const.GET,
+ const.URL_PATH: '/C',
+ const.EXPECTED_CODES: '200-204'})
if self.mem_listener_client.is_version_supported(
self.api_version, '2.5'):
@@ -388,38 +719,78 @@
# Check the default sort order, created_at
hms = self.mem_healthmonitor_client.list_healthmonitors()
hms = self._filter_hms_by_pool_id(hms, (pool1_id, pool2_id, pool3_id))
- self.assertEqual(hm1[const.URL_PATH],
- hms[0][const.URL_PATH])
- self.assertEqual(hm2[const.URL_PATH],
- hms[1][const.URL_PATH])
- self.assertEqual(hm3[const.URL_PATH],
- hms[2][const.URL_PATH])
+ if hm_type == const.HEALTH_MONITOR_HTTP:
+ self.assertEqual(hm1[const.URL_PATH],
+ hms[0][const.URL_PATH])
+ self.assertEqual(hm2[const.URL_PATH],
+ hms[1][const.URL_PATH])
+ self.assertEqual(hm3[const.URL_PATH],
+ hms[2][const.URL_PATH])
+ else:
+ self.assertEqual(hm1[const.MAX_RETRIES],
+ hms[0][const.MAX_RETRIES])
+ self.assertEqual(hm2[const.MAX_RETRIES],
+ hms[1][const.MAX_RETRIES])
+ self.assertEqual(hm3[const.MAX_RETRIES],
+ hms[2][const.MAX_RETRIES])
# Test sort descending by description
- hms = self.mem_healthmonitor_client.list_healthmonitors(
- query_params='{sort}={url_path}:{desc}'
- .format(sort=const.SORT,
- url_path=const.URL_PATH, desc=const.DESC))
- hms = self._filter_hms_by_pool_id(hms, (pool1_id, pool2_id, pool3_id))
- self.assertEqual(hm1[const.URL_PATH],
- hms[1][const.URL_PATH])
- self.assertEqual(hm2[const.URL_PATH],
- hms[2][const.URL_PATH])
- self.assertEqual(hm3[const.URL_PATH],
- hms[0][const.URL_PATH])
+ if hm_type == const.HEALTH_MONITOR_HTTP:
+ hms = self.mem_healthmonitor_client.list_healthmonitors(
+ query_params='{sort}={url_path}:{desc}'
+ .format(sort=const.SORT,
+ url_path=const.URL_PATH, desc=const.DESC))
+ hms = self._filter_hms_by_pool_id(hms,
+ (pool1_id, pool2_id, pool3_id))
+ self.assertEqual(hm1[const.URL_PATH],
+ hms[1][const.URL_PATH])
+ self.assertEqual(hm2[const.URL_PATH],
+ hms[2][const.URL_PATH])
+ self.assertEqual(hm3[const.URL_PATH],
+ hms[0][const.URL_PATH])
+ else:
+ hms = self.mem_healthmonitor_client.list_healthmonitors(
+ query_params='{sort}={url_path}:{desc}'
+ .format(sort=const.SORT,
+ url_path=const.MAX_RETRIES,
+ desc=const.DESC))
+ hms = self._filter_hms_by_pool_id(hms,
+ (pool1_id, pool2_id, pool3_id))
+ self.assertEqual(hm1[const.MAX_RETRIES],
+ hms[1][const.MAX_RETRIES])
+ self.assertEqual(hm2[const.MAX_RETRIES],
+ hms[2][const.MAX_RETRIES])
+ self.assertEqual(hm3[const.MAX_RETRIES],
+ hms[0][const.MAX_RETRIES])
# Test sort ascending by description
- hms = self.mem_healthmonitor_client.list_healthmonitors(
- query_params='{sort}={url_path}:{asc}'
- .format(sort=const.SORT,
- url_path=const.URL_PATH, asc=const.ASC))
- hms = self._filter_hms_by_pool_id(hms, (pool1_id, pool2_id, pool3_id))
- self.assertEqual(hm1[const.URL_PATH],
- hms[1][const.URL_PATH])
- self.assertEqual(hm2[const.URL_PATH],
- hms[0][const.URL_PATH])
- self.assertEqual(hm3[const.URL_PATH],
- hms[2][const.URL_PATH])
+ if hm_type == const.HEALTH_MONITOR_HTTP:
+ hms = self.mem_healthmonitor_client.list_healthmonitors(
+ query_params='{sort}={url_path}:{asc}'
+ .format(sort=const.SORT,
+ url_path=const.URL_PATH, asc=const.ASC))
+ hms = self._filter_hms_by_pool_id(hms,
+ (pool1_id, pool2_id, pool3_id))
+ self.assertEqual(hm1[const.URL_PATH],
+ hms[1][const.URL_PATH])
+ self.assertEqual(hm2[const.URL_PATH],
+ hms[0][const.URL_PATH])
+ self.assertEqual(hm3[const.URL_PATH],
+ hms[2][const.URL_PATH])
+ else:
+ hms = self.mem_healthmonitor_client.list_healthmonitors(
+ query_params='{sort}={url_path}:{asc}'
+ .format(sort=const.SORT,
+ url_path=const.MAX_RETRIES,
+ asc=const.ASC))
+ hms = self._filter_hms_by_pool_id(hms,
+ (pool1_id, pool2_id, pool3_id))
+ self.assertEqual(hm1[const.MAX_RETRIES],
+ hms[1][const.MAX_RETRIES])
+ self.assertEqual(hm2[const.MAX_RETRIES],
+ hms[0][const.MAX_RETRIES])
+ self.assertEqual(hm3[const.MAX_RETRIES],
+ hms[2][const.MAX_RETRIES])
# Determine indexes of pretest HMs in default sort
pretest_hm_indexes = []
@@ -509,8 +880,151 @@
self.assertTrue(not any(["" in hm[const.TAGS]
for hm in list_of_hms]))
+ @decorators.idempotent_id('358afb0b-6259-46be-a0b3-b11e5e202624')
+ def test_LC_HTTP_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.HTTP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('c2476eea-8ae1-40ed-be55-0125f9399bd4')
+ def test_LC_HTTPS_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.HTTPS, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('1489251c-0704-4735-bf62-801b5277c5c9')
+ def test_LC_PING_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.TCP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('c761f90e-7b9c-400b-b540-e7c14f65d0a8')
+ def test_LC_TCP_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.TCP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('8ed512d7-9fd7-4932-bf5f-090498b384bb')
+ def test_LC_TLS_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.TCP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('a3a9be7e-83d6-42cb-b603-f14a464b8268')
+ def test_LC_UDP_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.UDP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
@decorators.idempotent_id('284e8d3b-7b2d-4697-9e41-580b3423c0b4')
- def test_healthmonitor_show(self):
+ def test_RR_HTTP_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('eeb4967b-ce46-4717-a750-3e740223a804')
+ def test_RR_HTTPS_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.HTTPS, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('799ada1b-c082-42c5-b6ea-477f10fc88ce')
+ def test_RR_PING_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.TCP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('d2eae7f4-43b4-4696-93ed-a30f95c978fe')
+ def test_RR_TCP_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.TCP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('5ce6eecc-d425-47cd-809f-aab5c56e1a9d')
+ def test_RR_TLS_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.TCP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('a6a46e6a-a063-46bf-972c-86d0305fb766')
+ def test_RR_UDP_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.UDP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
+ @decorators.idempotent_id('54d693ba-1ba4-4388-b020-c29dc3184522')
+ def test_SI_HTTP_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.HTTP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('2638718e-b345-4868-b527-9bed575e27d6')
+ def test_SI_HTTPS_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.HTTPS, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('124a5ca1-5eae-4ed0-8528-7a499e9ad7a2')
+ def test_SI_PING_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('098ae671-1791-455a-a5a8-ada8c592a2dd')
+ def test_SI_TCP_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('eef8f780-b557-447f-9f61-b1f3e6daec77')
+ def test_SI_TLS_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('9b6d9c45-4696-4f6a-8816-594b03e3ee5b')
+ def test_SI_UDP_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.UDP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
+ @decorators.idempotent_id('5653ea25-c7e0-4c72-8b2a-19dd97dd5a69')
+ def test_SIP_HTTP_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.HTTP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('fff4472d-b4de-4b8b-9748-476ffc7c8e13')
+ def test_SIP_HTTPS_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.HTTPS, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('1af98ebe-3f3c-4e5f-8f72-ecbd9b25c69f')
+ def test_SIP_PING_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('40169a7d-84ac-4362-b8d7-64b9b807ce7e')
+ def test_SIP_TCP_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('15146c2e-e1c1-48ac-a7d8-3a1b4de590b2')
+ def test_SIP_TLS_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('008042da-3734-4bbb-b8b2-f4ad9e2dab21')
+ def test_SIP_UDP_healthmonitor_show(self):
+ self._test_healthmonitor_show(
+ const.UDP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
+ def _test_healthmonitor_show(self, pool_protocol, pool_algorithm, hm_type):
"""Tests healthmonitor show API.
* Create a clean pool to use for the healthmonitor.
@@ -519,15 +1033,36 @@
* Validate the show reflects the requested values.
* Validates that other accounts cannot see the healthmonitor.
"""
+ if (pool_algorithm == const.LB_ALGORITHM_SOURCE_IP_PORT and not
+ self.mem_listener_client.is_version_supported(
+ self.api_version, '2.13')):
+ raise testtools.TestCase.skipException(
+ 'Skipping this test as load balancing algorithm '
+ 'SOURCE_IP_PORT requires API version 2.13 or newer.')
+
pool_name = data_utils.rand_name("lb_member_pool1_hm-show")
pool_kwargs = {
const.NAME: pool_name,
- const.PROTOCOL: const.HTTP,
- const.LB_ALGORITHM: self.lb_algorithm,
+ const.PROTOCOL: pool_protocol,
+ const.LB_ALGORITHM: pool_algorithm,
const.LOADBALANCER_ID: self.lb_id,
}
- pool = self.mem_pool_client.create_pool(**pool_kwargs)
+ # This is a special case as the reference driver does not support
+ # SOURCE-IP-PORT. Since it runs with not_implemented_is_error, we must
+ # handle this test case special.
+ try:
+ pool = self.mem_pool_client.create_pool(**pool_kwargs)
+ except exceptions.NotImplemented as e:
+ if pool_algorithm != const.LB_ALGORITHM_SOURCE_IP_PORT:
+ raise
+ message = ("The configured provider driver '{driver}' "
+ "does not support a feature required for this "
+ "test.".format(driver=CONF.load_balancer.provider))
+ if hasattr(e, 'resp_body'):
+ message = e.resp_body.get('faultstring', message)
+ raise testtools.TestCase.skipException(message)
+
self.addCleanup(
self.mem_pool_client.cleanup_pool, pool[const.ID],
lb_client=self.mem_lb_client, lb_id=self.lb_id)
@@ -539,19 +1074,21 @@
CONF.load_balancer.build_timeout)
hm_name = data_utils.rand_name("lb_member_hm1-show")
+ delay = 3 if hm_type == const.HEALTH_MONITOR_UDP_CONNECT else 2
hm_kwargs = {
const.POOL_ID: pool[const.ID],
const.NAME: hm_name,
- const.TYPE: const.HEALTH_MONITOR_HTTP,
- const.DELAY: 2,
+ const.TYPE: hm_type,
+ const.DELAY: delay,
const.TIMEOUT: 3,
const.MAX_RETRIES: 4,
const.MAX_RETRIES_DOWN: 5,
- const.HTTP_METHOD: const.GET,
- const.URL_PATH: '/',
- const.EXPECTED_CODES: '200-204',
const.ADMIN_STATE_UP: True,
}
+ if hm_type == const.HEALTH_MONITOR_HTTP:
+ hm_kwargs.update({const.HTTP_METHOD: const.GET,
+ const.URL_PATH: '/',
+ const.EXPECTED_CODES: '200-204'})
hm = self.mem_healthmonitor_client.create_healthmonitor(**hm_kwargs)
self.addCleanup(
@@ -580,8 +1117,10 @@
equal_items = [const.NAME, const.TYPE, const.DELAY, const.TIMEOUT,
const.MAX_RETRIES, const.MAX_RETRIES_DOWN,
- const.HTTP_METHOD, const.URL_PATH, const.EXPECTED_CODES,
const.ADMIN_STATE_UP]
+ if hm_type == const.HEALTH_MONITOR_HTTP:
+ equal_items = equal_items + [const.HTTP_METHOD, const.URL_PATH,
+ const.EXPECTED_CODES]
for item in equal_items:
self.assertEqual(hm_kwargs[item], hm[item])
@@ -614,8 +1153,152 @@
self.os_primary.healthmonitor_client.show_healthmonitor,
hm[const.ID])
+ @decorators.idempotent_id('2417164b-ec03-4488-afd2-60b096dc0077')
+ def test_LC_HTTP_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.HTTP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('5d88aa1e-2db9-43f8-bb9b-4673c2060835')
+ def test_LC_HTTPS_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.HTTPS, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('61908142-9768-44aa-9a4b-b3904560a0dc')
+ def test_LC_PING_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.TCP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('649bdfa3-1009-4f88-bc92-c3e3141c493e')
+ def test_LC_TCP_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.TCP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('365fffd3-0817-4907-aab1-7da60736ba60')
+ def test_LC_TLS_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.TCP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('df29f696-a321-4626-acb2-6f66105e1661')
+ def test_LC_UDP_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.UDP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
@decorators.idempotent_id('fa584b2c-f179-4c4e-ad2e-ff51fd1c5973')
- def test_healthmonitor_update(self):
+ def test_RR_HTTP_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('b927836a-2770-46ff-92de-3031c5240da6')
+ def test_RR_HTTPS_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.HTTPS, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('cdd559b1-5c7b-492f-9c8d-c1da6e8d7b3b')
+ def test_RR_PING_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.TCP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('1b9c310e-cffe-4f6a-b1af-021f751fc2a9')
+ def test_RR_TCP_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.TCP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('4b3c9a67-f884-43a3-8f42-bac68be7060b')
+ def test_RR_TLS_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.TCP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('805e2976-962a-4bb0-a9cc-97270a42c376')
+ def test_RR_UDP_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.UDP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
+ @decorators.idempotent_id('654e4ce3-b579-4595-b1a1-6762f64b2408')
+ def test_SI_HTTP_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.HTTP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('879ef60a-4621-45aa-a520-b57da3b1fddc')
+ def test_SI_HTTPS_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.HTTPS, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('66e83157-53c3-4eac-a7f0-e3dc4f51de06')
+ def test_SI_PING_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('ce475c4c-d01a-4cde-be71-555c84f2b8da')
+ def test_SI_TCP_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('b292478f-5c26-462e-b222-103be3b115d3')
+ def test_SI_TLS_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('49ccc552-752b-4f84-9900-65908cb13add')
+ def test_SI_UDP_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.UDP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
+ @decorators.idempotent_id('d141d8d1-fa12-49cb-9d6d-413998aa2dc5')
+ def test_SIP_HTTP_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.HTTP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('9a1bbbbb-c640-48cb-bd1a-e3d3fd2602af')
+ def test_SIP_HTTPS_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.HTTPS, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('3f573e31-49b9-45d0-bb00-8483f48ae422')
+ def test_SIP_PING_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('1a6922fd-9e8c-4836-9a6a-087f09249a49')
+ def test_SIP_TCP_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('e9468e81-dbff-4e88-8d4b-e2a54835c2d8')
+ def test_SIP_TLS_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('64379cb2-b789-4fe6-ae3a-e62b907c6365')
+ def test_SIP_UDP_healthmonitor_update(self):
+ self._test_healthmonitor_update(
+ const.UDP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
+ def _test_healthmonitor_update(self, pool_protocol, pool_algorithm,
+ hm_type):
"""Tests healthmonitor update and show APIs.
* Create a clean pool to use for the healthmonitor.
@@ -627,15 +1310,36 @@
* Show healthmonitor details.
* Validate the show reflects the updated values.
"""
+ if (pool_algorithm == const.LB_ALGORITHM_SOURCE_IP_PORT and not
+ self.mem_listener_client.is_version_supported(
+ self.api_version, '2.13')):
+ raise testtools.TestCase.skipException(
+ 'Skipping this test as load balancing algorithm '
+ 'SOURCE_IP_PORT requires API version 2.13 or newer.')
+
pool_name = data_utils.rand_name("lb_member_pool1_hm-update")
pool_kwargs = {
const.NAME: pool_name,
- const.PROTOCOL: const.HTTP,
- const.LB_ALGORITHM: self.lb_algorithm,
+ const.PROTOCOL: pool_protocol,
+ const.LB_ALGORITHM: pool_algorithm,
const.LOADBALANCER_ID: self.lb_id,
}
- pool = self.mem_pool_client.create_pool(**pool_kwargs)
+ # This is a special case as the reference driver does not support
+ # SOURCE-IP-PORT. Since it runs with not_implemented_is_error, we must
+ # handle this test case special.
+ try:
+ pool = self.mem_pool_client.create_pool(**pool_kwargs)
+ except exceptions.NotImplemented as e:
+ if pool_algorithm != const.LB_ALGORITHM_SOURCE_IP_PORT:
+ raise
+ message = ("The configured provider driver '{driver}' "
+ "does not support a feature required for this "
+ "test.".format(driver=CONF.load_balancer.provider))
+ if hasattr(e, 'resp_body'):
+ message = e.resp_body.get('faultstring', message)
+ raise testtools.TestCase.skipException(message)
+
self.addCleanup(
self.mem_pool_client.cleanup_pool, pool[const.ID],
lb_client=self.mem_lb_client, lb_id=self.lb_id)
@@ -647,19 +1351,21 @@
CONF.load_balancer.build_timeout)
hm_name = data_utils.rand_name("lb_member_hm1-update")
+ delay = 3 if hm_type == const.HEALTH_MONITOR_UDP_CONNECT else 2
hm_kwargs = {
const.POOL_ID: pool[const.ID],
const.NAME: hm_name,
- const.TYPE: const.HEALTH_MONITOR_HTTP,
- const.DELAY: 2,
+ const.TYPE: hm_type,
+ const.DELAY: delay,
const.TIMEOUT: 3,
const.MAX_RETRIES: 4,
const.MAX_RETRIES_DOWN: 5,
- const.HTTP_METHOD: const.GET,
- const.URL_PATH: '/',
- const.EXPECTED_CODES: '200-204',
const.ADMIN_STATE_UP: False,
}
+ if hm_type == const.HEALTH_MONITOR_HTTP:
+ hm_kwargs.update({const.HTTP_METHOD: const.GET,
+ const.URL_PATH: '/',
+ const.EXPECTED_CODES: '200-204'})
if self.mem_listener_client.is_version_supported(
self.api_version, '2.5'):
@@ -698,8 +1404,10 @@
equal_items = [const.NAME, const.TYPE, const.DELAY, const.TIMEOUT,
const.MAX_RETRIES, const.MAX_RETRIES_DOWN,
- const.HTTP_METHOD, const.URL_PATH, const.EXPECTED_CODES,
const.ADMIN_STATE_UP]
+ if hm_type == const.HEALTH_MONITOR_HTTP:
+ equal_items = equal_items + [const.HTTP_METHOD, const.URL_PATH,
+ const.EXPECTED_CODES]
for item in equal_items:
self.assertEqual(hm_kwargs[item], hm[item])
@@ -745,11 +1453,12 @@
const.TIMEOUT: hm_kwargs[const.TIMEOUT] + 1,
const.MAX_RETRIES: hm_kwargs[const.MAX_RETRIES] + 1,
const.MAX_RETRIES_DOWN: hm_kwargs[const.MAX_RETRIES_DOWN] + 1,
- const.HTTP_METHOD: const.POST,
- const.URL_PATH: '/test',
- const.EXPECTED_CODES: '201,202',
const.ADMIN_STATE_UP: not hm_kwargs[const.ADMIN_STATE_UP],
}
+ if hm_type == const.HEALTH_MONITOR_HTTP:
+ hm_update_kwargs.update({const.HTTP_METHOD: const.POST,
+ const.URL_PATH: '/test',
+ const.EXPECTED_CODES: '201,202'})
if self.mem_listener_client.is_version_supported(
self.api_version, '2.5'):
@@ -782,8 +1491,10 @@
# Test changed items
equal_items = [const.NAME, const.DELAY, const.TIMEOUT,
const.MAX_RETRIES, const.MAX_RETRIES_DOWN,
- const.HTTP_METHOD, const.URL_PATH, const.EXPECTED_CODES,
const.ADMIN_STATE_UP]
+ if hm_type == const.HEALTH_MONITOR_HTTP:
+ equal_items = equal_items + [const.HTTP_METHOD, const.URL_PATH,
+ const.EXPECTED_CODES]
if self.mem_listener_client.is_version_supported(
self.api_version, '2.5'):
@@ -797,8 +1508,152 @@
for item in equal_items:
self.assertEqual(hm_kwargs[item], hm[item])
+ @decorators.idempotent_id('76b3d116-0190-4de8-a58e-8e450a46a621')
+ def test_LC_HTTP_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.HTTP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('8e277e7f-49ea-4fcf-98e6-12566cc33846')
+ def test_LC_HTTPS_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.HTTPS, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('c6646a25-b46d-4541-82de-75ee2beef052')
+ def test_LC_PING_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.TCP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('5cfacffe-63f2-4aa3-856a-9fa3dafa2d33')
+ def test_LC_TCP_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.TCP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('a4055e48-7740-4ff5-b6e2-9e69b1d40dce')
+ def test_LC_TLS_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.TCP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('369bd443-54ec-4071-a279-5ac1ed38c52d')
+ def test_LC_UDP_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.UDP, const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
@decorators.idempotent_id('a7bab4ac-340c-4776-ab9d-9fcb66869432')
- def test_healthmonitor_delete(self):
+ def test_RR_HTTP_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('2991664a-9138-4c10-8e30-2cb6a82bb5b4')
+ def test_RR_HTTPS_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.HTTPS, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('31f7c2c2-9174-4538-8dce-35128bc47ce7')
+ def test_RR_PING_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.TCP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('56e0cd28-3e74-498c-b55b-21078a758d1f')
+ def test_RR_TCP_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.TCP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('e22a02e2-411a-46d5-9a3a-20ff37cbc835')
+ def test_RR_TLS_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.TCP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('9221a59f-3f0f-41e8-b65c-cdbcca1a2eca')
+ def test_RR_UDP_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.UDP, const.LB_ALGORITHM_ROUND_ROBIN,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
+ @decorators.idempotent_id('717e447f-d5c8-485a-923b-da83e560273b')
+ def test_SI_HTTP_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.HTTP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('2e177a95-4ec8-4847-bd35-706b6452406a')
+ def test_SI_HTTPS_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.HTTPS, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('17127700-dc5f-4546-a6e6-c0b851704836')
+ def test_SI_PING_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('0b1699c2-ff3e-47b6-a1ad-7128465d1233')
+ def test_SI_TCP_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('4ad99064-9015-40b3-8d5b-6cc99e2cc8b9')
+ def test_SI_TLS_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('a17825ff-e774-4230-9c53-b53bfc355d61')
+ def test_SI_UDP_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.UDP, const.LB_ALGORITHM_SOURCE_IP,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
+ @decorators.idempotent_id('142022cc-9be3-4695-9acf-a7576e4b3268')
+ def test_SIP_HTTP_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.HTTP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_HTTP)
+
+ @decorators.idempotent_id('dfd994b2-511b-433f-95f7-0786f1857090')
+ def test_SIP_HTTPS_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.HTTPS, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_HTTPS)
+
+ @decorators.idempotent_id('0d08ffc0-6e6a-470d-abed-5c101a828401')
+ def test_SIP_PING_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_PING)
+
+ @decorators.idempotent_id('ccf4a10c-2e72-4dbf-bc2f-134156eac3e2')
+ def test_SIP_TCP_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_TCP)
+
+ @decorators.idempotent_id('aaacc11e-98cd-4322-a7db-7c720eafd2b2')
+ def test_SIP_TLS_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.TCP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_TLS_HELLO)
+
+ @decorators.idempotent_id('559eccf4-eb7c-4d23-9dc8-741cc1601fc7')
+ def test_SIP_UDP_healthmonitor_delete(self):
+ self._test_healthmonitor_delete(
+ const.UDP, const.LB_ALGORITHM_SOURCE_IP_PORT,
+ const.HEALTH_MONITOR_UDP_CONNECT)
+
+ def _test_healthmonitor_delete(self, pool_protocol, pool_algorithm,
+ hm_type):
"""Tests healthmonitor create and delete APIs.
* Create a clean pool to use for the healthmonitor.
@@ -807,15 +1662,36 @@
* Deletes the healthmonitor.
* Validates the healthmonitor is in the DELETED state.
"""
+ if (pool_algorithm == const.LB_ALGORITHM_SOURCE_IP_PORT and not
+ self.mem_listener_client.is_version_supported(
+ self.api_version, '2.13')):
+ raise testtools.TestCase.skipException(
+ 'Skipping this test as load balancing algorithm '
+ 'SOURCE_IP_PORT requires API version 2.13 or newer.')
+
pool_name = data_utils.rand_name("lb_member_pool1_hm-delete")
pool_kwargs = {
const.NAME: pool_name,
- const.PROTOCOL: const.HTTP,
- const.LB_ALGORITHM: self.lb_algorithm,
+ const.PROTOCOL: pool_protocol,
+ const.LB_ALGORITHM: pool_algorithm,
const.LOADBALANCER_ID: self.lb_id,
}
- pool = self.mem_pool_client.create_pool(**pool_kwargs)
+ # This is a special case as the reference driver does not support
+ # SOURCE-IP-PORT. Since it runs with not_implemented_is_error, we must
+ # handle this test case special.
+ try:
+ pool = self.mem_pool_client.create_pool(**pool_kwargs)
+ except exceptions.NotImplemented as e:
+ if pool_algorithm != const.LB_ALGORITHM_SOURCE_IP_PORT:
+ raise
+ message = ("The configured provider driver '{driver}' "
+ "does not support a feature required for this "
+ "test.".format(driver=CONF.load_balancer.provider))
+ if hasattr(e, 'resp_body'):
+ message = e.resp_body.get('faultstring', message)
+ raise testtools.TestCase.skipException(message)
+
self.addCleanup(
self.mem_pool_client.cleanup_pool, pool[const.ID],
lb_client=self.mem_lb_client, lb_id=self.lb_id)
@@ -827,11 +1703,12 @@
CONF.load_balancer.build_timeout)
hm_name = data_utils.rand_name("lb_member_hm1-delete")
+ delay = 3 if hm_type == const.HEALTH_MONITOR_UDP_CONNECT else 2
hm_kwargs = {
const.POOL_ID: pool[const.ID],
const.NAME: hm_name,
- const.TYPE: const.HEALTH_MONITOR_TCP,
- const.DELAY: 2,
+ const.TYPE: hm_type,
+ const.DELAY: delay,
const.TIMEOUT: 3,
const.MAX_RETRIES: 4,
}
diff --git a/octavia_tempest_plugin/tests/api/v2/test_l7policy.py b/octavia_tempest_plugin/tests/api/v2/test_l7policy.py
index 419a20f..a02f52e 100644
--- a/octavia_tempest_plugin/tests/api/v2/test_l7policy.py
+++ b/octavia_tempest_plugin/tests/api/v2/test_l7policy.py
@@ -30,16 +30,6 @@
class L7PolicyAPITest(test_base.LoadBalancerBaseTest):
"""Test the l7policy object API."""
-
- @classmethod
- def skip_checks(cls):
- super(L7PolicyAPITest, cls).skip_checks()
- if not CONF.loadbalancer_feature_enabled.l7_protocol_enabled:
- raise cls.skipException(
- '[loadbalancer-feature-enabled] '
- '"l7_protocol_enabled" is set to False in the Tempest '
- 'configuration. L7 API tests will be skipped.')
-
@classmethod
def resource_setup(cls):
"""Setup resources needed by the tests."""
@@ -87,7 +77,7 @@
pool_kwargs = {
const.NAME: pool_name,
const.PROTOCOL: const.HTTP,
- const.LB_ALGORITHM: cls.lb_algorithm,
+ const.LB_ALGORITHM: const.LB_ALGORITHM_ROUND_ROBIN,
const.LOADBALANCER_ID: cls.lb_id,
}
diff --git a/octavia_tempest_plugin/tests/api/v2/test_l7rule.py b/octavia_tempest_plugin/tests/api/v2/test_l7rule.py
index c2526bf..e44c9f8 100644
--- a/octavia_tempest_plugin/tests/api/v2/test_l7rule.py
+++ b/octavia_tempest_plugin/tests/api/v2/test_l7rule.py
@@ -31,15 +31,6 @@
class L7RuleAPITest(test_base.LoadBalancerBaseTest):
"""Test the l7rule object API."""
@classmethod
- def skip_checks(cls):
- super(L7RuleAPITest, cls).skip_checks()
- if not CONF.loadbalancer_feature_enabled.l7_protocol_enabled:
- raise cls.skipException(
- '[loadbalancer-feature-enabled] '
- '"l7_protocol_enabled" is set to False in the Tempest '
- 'configuration. L7 API tests will be skipped.')
-
- @classmethod
def resource_setup(cls):
"""Setup resources needed by the tests."""
super(L7RuleAPITest, cls).resource_setup()
@@ -86,7 +77,7 @@
pool_kwargs = {
const.NAME: pool_name,
const.PROTOCOL: const.HTTP,
- const.LB_ALGORITHM: cls.lb_algorithm,
+ const.LB_ALGORITHM: const.LB_ALGORITHM_ROUND_ROBIN,
const.LISTENER_ID: cls.listener_id,
}
diff --git a/octavia_tempest_plugin/tests/api/v2/test_listener.py b/octavia_tempest_plugin/tests/api/v2/test_listener.py
index db98958..394e4d4 100644
--- a/octavia_tempest_plugin/tests/api/v2/test_listener.py
+++ b/octavia_tempest_plugin/tests/api/v2/test_listener.py
@@ -42,10 +42,6 @@
const.NAME: lb_name}
cls._setup_lb_network_kwargs(lb_kwargs)
- cls.protocol = const.HTTP
- lb_feature_enabled = CONF.loadbalancer_feature_enabled
- if not lb_feature_enabled.l7_protocol_enabled:
- cls.protocol = lb_feature_enabled.l4_protocol
lb = cls.mem_lb_client.create_loadbalancer(**lb_kwargs)
cls.lb_id = lb[const.ID]
@@ -64,7 +60,27 @@
cls.allowed_cidrs = ['2001:db8:a0b:12f0::/64']
@decorators.idempotent_id('88d0ec83-7b08-48d9-96e2-0df1d2f8cd98')
- def test_listener_create(self):
+ def test_http_listener_create(self):
+ self._test_listener_create(const.HTTP, 8000)
+
+ @decorators.idempotent_id('2cc89237-fc6b-434d-b38e-b3309823e71f')
+ def test_https_listener_create(self):
+ self._test_listener_create(const.HTTPS, 8001)
+
+ @decorators.idempotent_id('45580065-5653-436b-aaff-dc465fa0a542')
+ def test_tcp_listener_create(self):
+ self._test_listener_create(const.TCP, 8002)
+
+ @decorators.idempotent_id('7b53f336-47bc-45ae-bbd7-4342ef0673fc')
+ # Skipping due to a status update bug in the amphora driver.
+ @decorators.skip_because(
+ bug='2007979',
+ bug_type='storyboard',
+ condition=CONF.load_balancer.provider in const.AMPHORA_PROVIDERS)
+ def test_udp_listener_create(self):
+ self._test_listener_create(const.UDP, 8003)
+
+ def _test_listener_create(self, protocol, protocol_port):
"""Tests listener create and basic show APIs.
* Tests that users without the loadbalancer member role cannot
@@ -80,14 +96,10 @@
const.NAME: listener_name,
const.DESCRIPTION: listener_description,
const.ADMIN_STATE_UP: True,
- const.PROTOCOL: self.protocol,
- const.PROTOCOL_PORT: 80,
+ const.PROTOCOL: protocol,
+ const.PROTOCOL_PORT: protocol_port,
const.LOADBALANCER_ID: self.lb_id,
const.CONNECTION_LIMIT: 200,
- const.INSERT_HEADERS: {
- const.X_FORWARDED_FOR: "true",
- const.X_FORWARDED_PORT: "true"
- },
# Don't test with a default pool -- we'll do that in the scenario,
# but this will allow us to test that the field isn't mandatory,
# as well as not conflate pool failures with listener test failures
@@ -97,6 +109,12 @@
# const.DEFAULT_TLS_CONTAINER_REF: '',
# const.SNI_CONTAINER_REFS: [],
}
+ if protocol == const.HTTP:
+ listener_kwargs[const.INSERT_HEADERS] = {
+ const.X_FORWARDED_FOR: "true",
+ const.X_FORWARDED_PORT: "true",
+ const.X_FORWARDED_PROTO: "true",
+ }
if self.mem_listener_client.is_version_supported(
self.api_version, '2.1'):
listener_kwargs.update({
@@ -182,11 +200,14 @@
else:
self.assertEqual(const.ONLINE, listener[const.OPERATING_STATUS])
- insert_headers = listener[const.INSERT_HEADERS]
- self.assertTrue(
- strutils.bool_from_string(insert_headers[const.X_FORWARDED_FOR]))
- self.assertTrue(
- strutils.bool_from_string(insert_headers[const.X_FORWARDED_PORT]))
+ if protocol == const.HTTP:
+ insert_headers = listener[const.INSERT_HEADERS]
+ self.assertTrue(strutils.bool_from_string(
+ insert_headers[const.X_FORWARDED_FOR]))
+ self.assertTrue(strutils.bool_from_string(
+ insert_headers[const.X_FORWARDED_PORT]))
+ self.assertTrue(strutils.bool_from_string(
+ insert_headers[const.X_FORWARDED_PROTO]))
if self.mem_listener_client.is_version_supported(
self.api_version, '2.5'):
@@ -198,7 +219,27 @@
self.assertEqual(self.allowed_cidrs, listener[const.ALLOWED_CIDRS])
@decorators.idempotent_id('cceac303-4db5-4d5a-9f6e-ff33780a5f29')
- def test_listener_create_on_same_port(self):
+ def test_http_udp_tcp_listener_create_on_same_port(self):
+ self._test_listener_create_on_same_port(const.HTTP, const.UDP,
+ const.TCP, 8010)
+
+ @decorators.idempotent_id('930338b8-3029-48a6-89b2-8b062060fe61')
+ def test_http_udp_https_listener_create_on_same_port(self):
+ self._test_listener_create_on_same_port(const.HTTP, const.UDP,
+ const.HTTPS, 8011)
+
+ @decorators.idempotent_id('01a21892-008a-4327-b4fd-fbf194ecb1a5')
+ def test_tcp_udp_http_listener_create_on_same_port(self):
+ self._test_listener_create_on_same_port(const.TCP, const.UDP,
+ const.HTTP, 8012)
+
+ @decorators.idempotent_id('5da764a4-c03a-46ed-848b-98b9d9fa9089')
+ def test_tcp_udp_https_listener_create_on_same_port(self):
+ self._test_listener_create_on_same_port(const.TCP, const.UDP,
+ const.HTTPS, 8013)
+
+ def _test_listener_create_on_same_port(self, protocol1, protocol2,
+ protocol3, protocol_port):
"""Tests listener creation on same port number.
* Create a first listener.
@@ -224,8 +265,8 @@
listener_kwargs = {
const.NAME: listener_name,
const.ADMIN_STATE_UP: True,
- const.PROTOCOL: self.protocol,
- const.PROTOCOL_PORT: 8080,
+ const.PROTOCOL: protocol1,
+ const.PROTOCOL_PORT: protocol_port,
const.LOADBALANCER_ID: self.lb_id,
const.CONNECTION_LIMIT: 200
}
@@ -251,19 +292,14 @@
CONF.load_balancer.build_interval,
CONF.load_balancer.build_timeout)
- if self.protocol == const.UDP:
- protocol = const.TCP
- else:
- protocol = const.UDP
-
# Create a listener on the same port, but with a different protocol
listener2_name = data_utils.rand_name("lb_member_listener2-create")
listener2_kwargs = {
const.NAME: listener2_name,
const.ADMIN_STATE_UP: True,
- const.PROTOCOL: protocol,
- const.PROTOCOL_PORT: 8080,
+ const.PROTOCOL: protocol2,
+ const.PROTOCOL_PORT: protocol_port,
const.LOADBALANCER_ID: self.lb_id,
const.CONNECTION_LIMIT: 200,
}
@@ -295,8 +331,8 @@
listener3_kwargs = {
const.NAME: listener3_name,
const.ADMIN_STATE_UP: True,
- const.PROTOCOL: protocol,
- const.PROTOCOL_PORT: 8080,
+ const.PROTOCOL: protocol1,
+ const.PROTOCOL_PORT: protocol_port,
const.LOADBALANCER_ID: self.lb_id,
const.CONNECTION_LIMIT: 200,
}
@@ -306,33 +342,45 @@
self.mem_listener_client.create_listener,
**listener3_kwargs)
- # Create a listener on the same port, with another protocol over TCP,
- # only if layer-7 protocols are enabled
- lb_feature_enabled = CONF.loadbalancer_feature_enabled
- if lb_feature_enabled.l7_protocol_enabled:
- if self.protocol == const.HTTP:
- protocol = const.HTTPS
- else:
- protocol = const.HTTP
+ # Create a listener on the same port, with another protocol over TCP
+ listener4_name = data_utils.rand_name("lb_member_listener4-create")
- listener4_name = data_utils.rand_name("lb_member_listener4-create")
+ listener4_kwargs = {
+ const.NAME: listener4_name,
+ const.ADMIN_STATE_UP: True,
+ const.PROTOCOL: protocol3,
+ const.PROTOCOL_PORT: protocol_port,
+ const.LOADBALANCER_ID: self.lb_id,
+ const.CONNECTION_LIMIT: 200,
+ }
- listener4_kwargs = {
- const.NAME: listener4_name,
- const.ADMIN_STATE_UP: True,
- const.PROTOCOL: protocol,
- const.PROTOCOL_PORT: 8080,
- const.LOADBALANCER_ID: self.lb_id,
- const.CONNECTION_LIMIT: 200,
- }
-
- self.assertRaises(
- exceptions.Conflict,
- self.mem_listener_client.create_listener,
- **listener4_kwargs)
+ self.assertRaises(
+ exceptions.Conflict,
+ self.mem_listener_client.create_listener,
+ **listener4_kwargs)
@decorators.idempotent_id('78ba6eb0-178c-477e-9156-b6775ca7b271')
- def test_listener_list(self):
+ def test_http_listener_list(self):
+ self._test_listener_list(const.HTTP, 8020)
+
+ @decorators.idempotent_id('61b7c643-f5fa-4471-8f9e-2e0ccdaf5ac7')
+ def test_https_listener_list(self):
+ self._test_listener_list(const.HTTPS, 8030)
+
+ @decorators.idempotent_id('1cd476e2-7788-415e-bcaf-c377acfc9794')
+ def test_tcp_listener_list(self):
+ self._test_listener_list(const.TCP, 8030)
+
+ @decorators.idempotent_id('c08fb77e-b317-4d6f-b430-91f5b27ebac6')
+ # Skipping due to a status update bug in the amphora driver.
+ @decorators.skip_because(
+ bug='2007979',
+ bug_type='storyboard',
+ condition=CONF.load_balancer.provider in const.AMPHORA_PROVIDERS)
+ def test_udp_listener_list(self):
+ self._test_listener_list(const.UDP, 8040)
+
+ def _test_listener_list(self, protocol, protocol_port_base):
"""Tests listener list API and field filtering.
* Create a clean loadbalancer.
@@ -368,8 +416,8 @@
const.NAME: listener1_name,
const.DESCRIPTION: listener1_desc,
const.ADMIN_STATE_UP: True,
- const.PROTOCOL: self.protocol,
- const.PROTOCOL_PORT: 80,
+ const.PROTOCOL: protocol,
+ const.PROTOCOL_PORT: protocol_port_base,
const.LOADBALANCER_ID: lb_id,
}
if self.mem_listener_client.is_version_supported(
@@ -406,8 +454,8 @@
const.NAME: listener2_name,
const.DESCRIPTION: listener2_desc,
const.ADMIN_STATE_UP: True,
- const.PROTOCOL: self.protocol,
- const.PROTOCOL_PORT: 81,
+ const.PROTOCOL: protocol,
+ const.PROTOCOL_PORT: protocol_port_base + 1,
const.LOADBALANCER_ID: lb_id,
}
if self.mem_listener_client.is_version_supported(
@@ -444,8 +492,8 @@
const.NAME: listener3_name,
const.DESCRIPTION: listener3_desc,
const.ADMIN_STATE_UP: False,
- const.PROTOCOL: self.protocol,
- const.PROTOCOL_PORT: 82,
+ const.PROTOCOL: protocol,
+ const.PROTOCOL_PORT: protocol_port_base + 2,
const.LOADBALANCER_ID: lb_id,
}
if self.mem_listener_client.is_version_supported(
@@ -492,8 +540,7 @@
query_params='loadbalancer_id={lb_id}'.format(lb_id=lb_id))
self.assertEqual(0, len(primary))
- # Test that a user without the lb member role cannot list load
- # balancers
+ # Test that a user without the lb member role cannot list listeners
if CONF.load_balancer.RBAC_test_type == const.ADVANCED:
self.assertRaises(
exceptions.Forbidden,
@@ -622,7 +669,27 @@
for listener in list_of_listeners]))
@decorators.idempotent_id('6e299eae-6907-4dfc-89c2-e57709d25d3d')
- def test_listener_show(self):
+ def test_http_listener_show(self):
+ self._test_listener_show(const.HTTP, 8050)
+
+ @decorators.idempotent_id('aa838646-435f-4a20-8442-519a7a138e7e')
+ def test_https_listener_show(self):
+ self._test_listener_show(const.HTTPS, 8051)
+
+ @decorators.idempotent_id('1fcbbee2-b697-4890-b6bf-d308ac1c94cd')
+ def test_tcp_listener_show(self):
+ self._test_listener_show(const.TCP, 8052)
+
+ @decorators.idempotent_id('1dea3a6b-c95b-4e91-b591-1aa9cbcd0d1d')
+ # Skipping due to a status update bug in the amphora driver.
+ @decorators.skip_because(
+ bug='2007979',
+ bug_type='storyboard',
+ condition=CONF.load_balancer.provider in const.AMPHORA_PROVIDERS)
+ def test_udp_listener_show(self):
+ self._test_listener_show(const.UDP, 8053)
+
+ def _test_listener_show(self, protocol, protocol_port):
"""Tests listener show API.
* Create a fully populated listener.
@@ -637,19 +704,21 @@
const.NAME: listener_name,
const.DESCRIPTION: listener_description,
const.ADMIN_STATE_UP: True,
- const.PROTOCOL: self.protocol,
- const.PROTOCOL_PORT: 81,
+ const.PROTOCOL: protocol,
+ const.PROTOCOL_PORT: protocol_port,
const.LOADBALANCER_ID: self.lb_id,
const.CONNECTION_LIMIT: 200,
- const.INSERT_HEADERS: {
- const.X_FORWARDED_FOR: "true",
- const.X_FORWARDED_PORT: "true"
- },
# TODO(rm_work): need to finish the rest of this stuff
# const.DEFAULT_POOL_ID: '',
# const.DEFAULT_TLS_CONTAINER_REF: '',
# const.SNI_CONTAINER_REFS: [],
}
+ if protocol == const.HTTP:
+ listener_kwargs[const.INSERT_HEADERS] = {
+ const.X_FORWARDED_FOR: "true",
+ const.X_FORWARDED_PORT: "true",
+ const.X_FORWARDED_PROTO: "true",
+ }
if self.mem_listener_client.is_version_supported(
self.api_version, '2.1'):
@@ -715,11 +784,14 @@
for item in equal_items:
self.assertEqual(listener_kwargs[item], listener[item])
- insert_headers = listener[const.INSERT_HEADERS]
- self.assertTrue(
- strutils.bool_from_string(insert_headers[const.X_FORWARDED_FOR]))
- self.assertTrue(
- strutils.bool_from_string(insert_headers[const.X_FORWARDED_PORT]))
+ if protocol == const.HTTP:
+ insert_headers = listener[const.INSERT_HEADERS]
+ self.assertTrue(strutils.bool_from_string(
+ insert_headers[const.X_FORWARDED_FOR]))
+ self.assertTrue(strutils.bool_from_string(
+ insert_headers[const.X_FORWARDED_PORT]))
+ self.assertTrue(strutils.bool_from_string(
+ insert_headers[const.X_FORWARDED_PROTO]))
parser.parse(listener[const.CREATED_AT])
parser.parse(listener[const.UPDATED_AT])
@@ -763,7 +835,27 @@
listener[const.ID])
@decorators.idempotent_id('aaae0298-5778-4c7e-a27a-01549a71b319')
- def test_listener_update(self):
+ def test_http_listener_update(self):
+ self._test_listener_update(const.HTTP, 8060)
+
+ @decorators.idempotent_id('9679b061-2b2c-469f-abd9-26ed140ef001')
+ def test_https_listener_update(self):
+ self._test_listener_update(const.HTTPS, 8061)
+
+ @decorators.idempotent_id('8d933121-db03-4ccc-8b77-4e879064a9ba')
+ def test_tcp_listener_update(self):
+ self._test_listener_update(const.TCP, 8062)
+
+ @decorators.idempotent_id('fd02dbfd-39ce-41c2-b181-54fc7ad91707')
+ # Skipping due to a status update bug in the amphora driver.
+ @decorators.skip_because(
+ bug='2007979',
+ bug_type='storyboard',
+ condition=CONF.load_balancer.provider in const.AMPHORA_PROVIDERS)
+ def test_udp_listener_update(self):
+ self._test_listener_update(const.UDP, 8063)
+
+ def _test_listener_update(self, protocol, protocol_port):
"""Tests listener update and show APIs.
* Create a fully populated listener.
@@ -781,19 +873,22 @@
const.NAME: listener_name,
const.DESCRIPTION: listener_description,
const.ADMIN_STATE_UP: False,
- const.PROTOCOL: self.protocol,
- const.PROTOCOL_PORT: 82,
+ const.PROTOCOL: protocol,
+ const.PROTOCOL_PORT: protocol_port,
const.LOADBALANCER_ID: self.lb_id,
const.CONNECTION_LIMIT: 200,
- const.INSERT_HEADERS: {
- const.X_FORWARDED_FOR: "true",
- const.X_FORWARDED_PORT: "true"
- },
# TODO(rm_work): need to finish the rest of this stuff
# const.DEFAULT_POOL_ID: '',
# const.DEFAULT_TLS_CONTAINER_REF: '',
# const.SNI_CONTAINER_REFS: [],
}
+ if protocol == const.HTTP:
+ listener_kwargs[const.INSERT_HEADERS] = {
+ const.X_FORWARDED_FOR: "true",
+ const.X_FORWARDED_PORT: "true",
+ const.X_FORWARDED_PROTO: "true"
+ }
+
if self.mem_listener_client.is_version_supported(
self.api_version, '2.1'):
listener_kwargs.update({
@@ -840,14 +935,17 @@
UUID(listener[const.ID])
# Operating status will be OFFLINE while admin_state_up = False
self.assertEqual(const.OFFLINE, listener[const.OPERATING_STATUS])
- self.assertEqual(self.protocol, listener[const.PROTOCOL])
- self.assertEqual(82, listener[const.PROTOCOL_PORT])
+ self.assertEqual(protocol, listener[const.PROTOCOL])
+ self.assertEqual(protocol_port, listener[const.PROTOCOL_PORT])
self.assertEqual(200, listener[const.CONNECTION_LIMIT])
- insert_headers = listener[const.INSERT_HEADERS]
- self.assertTrue(
- strutils.bool_from_string(insert_headers[const.X_FORWARDED_FOR]))
- self.assertTrue(
- strutils.bool_from_string(insert_headers[const.X_FORWARDED_PORT]))
+ if protocol == const.HTTP:
+ insert_headers = listener[const.INSERT_HEADERS]
+ self.assertTrue(strutils.bool_from_string(
+ insert_headers[const.X_FORWARDED_FOR]))
+ self.assertTrue(strutils.bool_from_string(
+ insert_headers[const.X_FORWARDED_PORT]))
+ self.assertTrue(strutils.bool_from_string(
+ insert_headers[const.X_FORWARDED_PROTO]))
if self.mem_listener_client.is_version_supported(
self.api_version, '2.1'):
self.assertEqual(1000, listener[const.TIMEOUT_CLIENT_DATA])
@@ -902,15 +1000,17 @@
const.DESCRIPTION: new_description,
const.ADMIN_STATE_UP: True,
const.CONNECTION_LIMIT: 400,
- const.INSERT_HEADERS: {
- const.X_FORWARDED_FOR: "false",
- const.X_FORWARDED_PORT: "false"
- },
# TODO(rm_work): need to finish the rest of this stuff
# const.DEFAULT_POOL_ID: '',
# const.DEFAULT_TLS_CONTAINER_REF: '',
# const.SNI_CONTAINER_REFS: [],
}
+ if protocol == const.HTTP:
+ listener_update_kwargs[const.INSERT_HEADERS] = {
+ const.X_FORWARDED_FOR: "false",
+ const.X_FORWARDED_PORT: "false",
+ const.X_FORWARDED_PROTO: "false"
+ }
if self.mem_listener_client.is_version_supported(
self.api_version, '2.1'):
listener_update_kwargs.update({
@@ -973,11 +1073,14 @@
else:
self.assertEqual(const.ONLINE, listener[const.OPERATING_STATUS])
self.assertEqual(400, listener[const.CONNECTION_LIMIT])
- insert_headers = listener[const.INSERT_HEADERS]
- self.assertFalse(
- strutils.bool_from_string(insert_headers[const.X_FORWARDED_FOR]))
- self.assertFalse(
- strutils.bool_from_string(insert_headers[const.X_FORWARDED_PORT]))
+ if protocol == const.HTTP:
+ insert_headers = listener[const.INSERT_HEADERS]
+ self.assertFalse(strutils.bool_from_string(
+ insert_headers[const.X_FORWARDED_FOR]))
+ self.assertFalse(strutils.bool_from_string(
+ insert_headers[const.X_FORWARDED_PORT]))
+ self.assertFalse(strutils.bool_from_string(
+ insert_headers[const.X_FORWARDED_PROTO]))
if self.mem_listener_client.is_version_supported(
self.api_version, '2.1'):
self.assertEqual(2000, listener[const.TIMEOUT_CLIENT_DATA])
@@ -998,7 +1101,27 @@
self.assertEqual(expected_cidrs, listener[const.ALLOWED_CIDRS])
@decorators.idempotent_id('16f11c82-f069-4592-8954-81b35a98e3b7')
- def test_listener_delete(self):
+ def test_http_listener_delete(self):
+ self._test_listener_delete(const.HTTP, 8070)
+
+ @decorators.idempotent_id('769526a0-df71-47cd-996e-46484de32223')
+ def test_https_listener_delete(self):
+ self._test_listener_delete(const.HTTPS, 8071)
+
+ @decorators.idempotent_id('f5ca019d-2b33-48f9-9c2d-2ec169b423ca')
+ def test_tcp_listener_delete(self):
+ self._test_listener_delete(const.TCP, 8072)
+
+ @decorators.idempotent_id('86bd9717-e3e9-41e3-86c4-888c64455926')
+ # Skipping due to a status update bug in the amphora driver.
+ @decorators.skip_because(
+ bug='2007979',
+ bug_type='storyboard',
+ condition=CONF.load_balancer.provider in const.AMPHORA_PROVIDERS)
+ def test_udp_listener_delete(self):
+ self._test_listener_delete(const.UDP, 8073)
+
+ def _test_listener_delete(self, protocol, protocol_port):
"""Tests listener create and delete APIs.
* Creates a listener.
@@ -1010,8 +1133,8 @@
listener_kwargs = {
const.NAME: listener_name,
- const.PROTOCOL: self.protocol,
- const.PROTOCOL_PORT: 83,
+ const.PROTOCOL: protocol,
+ const.PROTOCOL_PORT: protocol_port,
const.LOADBALANCER_ID: self.lb_id,
}
listener = self.mem_listener_client.create_listener(**listener_kwargs)
@@ -1059,7 +1182,27 @@
CONF.load_balancer.check_timeout)
@decorators.idempotent_id('6f14a6c1-945e-43bc-8215-410c8a5edb25')
- def test_listener_show_stats(self):
+ def test_http_listener_show_stats(self):
+ self._test_listener_show_stats(const.HTTP, 8080)
+
+ @decorators.idempotent_id('f8a43c27-f0a0-496d-a287-1958f337ac04')
+ def test_https_listener_show_stats(self):
+ self._test_listener_show_stats(const.HTTPS, 8081)
+
+ @decorators.idempotent_id('8a999856-f448-498c-b891-21af449b5208')
+ def test_tcp_listener_show_stats(self):
+ self._test_listener_show_stats(const.TCP, 8082)
+
+ @decorators.idempotent_id('a4c1f199-923b-41e4-a134-c91e590e20c4')
+ # Skipping due to a status update bug in the amphora driver.
+ @decorators.skip_because(
+ bug='2007979',
+ bug_type='storyboard',
+ condition=CONF.load_balancer.provider in const.AMPHORA_PROVIDERS)
+ def test_udp_listener_show_stats(self):
+ self._test_listener_show_stats(const.UDP, 8083)
+
+ def _test_listener_show_stats(self, protocol, protocol_port):
"""Tests listener show statistics API.
* Create a listener.
@@ -1075,8 +1218,8 @@
const.NAME: listener_name,
const.DESCRIPTION: listener_description,
const.ADMIN_STATE_UP: True,
- const.PROTOCOL: const.HTTP,
- const.PROTOCOL_PORT: 84,
+ const.PROTOCOL: protocol,
+ const.PROTOCOL_PORT: protocol_port,
const.LOADBALANCER_ID: self.lb_id,
const.CONNECTION_LIMIT: 200,
}
diff --git a/octavia_tempest_plugin/tests/api/v2/test_member.py b/octavia_tempest_plugin/tests/api/v2/test_member.py
index 583f93e..8bf7810 100644
--- a/octavia_tempest_plugin/tests/api/v2/test_member.py
+++ b/octavia_tempest_plugin/tests/api/v2/test_member.py
@@ -19,6 +19,7 @@
from dateutil import parser
from tempest import config
from tempest.lib.common.utils import data_utils
+from tempest.lib.common.utils import misc
from tempest.lib import decorators
from tempest.lib import exceptions
@@ -28,6 +29,16 @@
CONF = config.CONF
+# Member port numbers need to be unique on the shared pools so generate them
+@misc.singleton
+class MemberPort(object):
+
+ current_port = 8000
+
+ def increment(self):
+ self.current_port += 1
+ return self.current_port
+
class MemberAPITest(test_base.LoadBalancerBaseTest):
"""Test the member object API."""
@@ -41,10 +52,10 @@
lb_kwargs = {const.PROVIDER: CONF.load_balancer.provider,
const.NAME: lb_name}
cls._setup_lb_network_kwargs(lb_kwargs)
- cls.protocol = const.HTTP
- lb_feature_enabled = CONF.loadbalancer_feature_enabled
- if not lb_feature_enabled.l7_protocol_enabled:
- cls.protocol = lb_feature_enabled.l4_protocol
+
+ cls.current_listener_port = 8000
+ cls.listener_pool_cache = {}
+ cls.member_port = MemberPort()
lb = cls.mem_lb_client.create_loadbalancer(**lb_kwargs)
cls.lb_id = lb[const.ID]
@@ -58,18 +69,42 @@
CONF.load_balancer.lb_build_interval,
CONF.load_balancer.lb_build_timeout)
+ @classmethod
+ def _listener_pool_create(cls, listener_protocol, pool_protocol,
+ algorithm):
+ """Setup resources needed by the tests."""
+ if (algorithm == const.LB_ALGORITHM_SOURCE_IP_PORT and not
+ cls.mem_listener_client.is_version_supported(
+ cls.api_version, '2.13')):
+ raise testtools.TestCase.skipException(
+ 'Skipping this test as load balancing algorithm '
+ 'SOURCE_IP_PORT requires API version 2.13 or newer.')
+
+ if (listener_protocol == const.UDP and
+ not cls.mem_listener_client.is_version_supported(
+ cls.api_version, '2.1')):
+ raise cls.skipException('UDP listener support is only available '
+ 'in Octavia API version 2.1 or newer')
+
+ # Cache listener/pool combinations we have already created as
+ # they can be reused for member test permutations
+ listener_pool_key = listener_protocol + pool_protocol + algorithm
+ pool_id = cls.listener_pool_cache.get(listener_pool_key, None)
+ if pool_id is not None:
+ return pool_id
+
listener_name = data_utils.rand_name("lb_member_listener1_member")
listener_kwargs = {
const.NAME: listener_name,
- const.PROTOCOL: cls.protocol,
- const.PROTOCOL_PORT: '80',
+ const.PROTOCOL: listener_protocol,
+ const.PROTOCOL_PORT: cls.current_listener_port,
const.LOADBALANCER_ID: cls.lb_id,
+ const.CONNECTION_LIMIT: 200
}
+ cls.current_listener_port += 1
listener = cls.mem_listener_client.create_listener(**listener_kwargs)
- cls.listener_id = listener[const.ID]
cls.addClassResourceCleanup(
- cls.mem_listener_client.cleanup_listener,
- cls.listener_id,
+ cls.mem_listener_client.cleanup_listener, listener[const.ID],
lb_client=cls.mem_lb_client, lb_id=cls.lb_id)
waiters.wait_for_status(cls.mem_lb_client.show_loadbalancer,
@@ -81,16 +116,28 @@
pool_name = data_utils.rand_name("lb_member_pool1_member")
pool_kwargs = {
const.NAME: pool_name,
- const.PROTOCOL: cls.protocol,
- const.LB_ALGORITHM: cls.lb_algorithm,
- const.LISTENER_ID: cls.listener_id,
+ const.PROTOCOL: pool_protocol,
+ const.LB_ALGORITHM: algorithm,
+ const.LISTENER_ID: listener[const.ID]
}
- pool = cls.mem_pool_client.create_pool(**pool_kwargs)
- cls.pool_id = pool[const.ID]
+ # This is a special case as the reference driver does not support
+ # SOURCE-IP-PORT. Since it runs with not_implemented_is_error, we must
+ # handle this test case special.
+ try:
+ pool = cls.mem_pool_client.create_pool(**pool_kwargs)
+ except exceptions.NotImplemented as e:
+ if algorithm != const.LB_ALGORITHM_SOURCE_IP_PORT:
+ raise
+ message = ("The configured provider driver '{driver}' "
+ "does not support a feature required for this "
+ "test.".format(driver=CONF.load_balancer.provider))
+ if hasattr(e, 'resp_body'):
+ message = e.resp_body.get('faultstring', message)
+ raise testtools.TestCase.skipException(message)
+
cls.addClassResourceCleanup(
- cls.mem_pool_client.cleanup_pool,
- cls.pool_id,
+ cls.mem_pool_client.cleanup_pool, pool[const.ID],
lb_client=cls.mem_lb_client, lb_id=cls.lb_id)
waiters.wait_for_status(cls.mem_lb_client.show_loadbalancer,
@@ -98,28 +145,699 @@
const.ACTIVE,
CONF.load_balancer.build_interval,
CONF.load_balancer.build_timeout)
+ cls.listener_pool_cache[listener_pool_key] = pool[const.ID]
+ return pool[const.ID]
- def _create_member_and_get_monitor_status(self, **member_kwargs):
- monitor = CONF.loadbalancer_feature_enabled.health_monitor_enabled
- if not monitor:
- del member_kwargs[const.MONITOR_ADDRESS]
- del member_kwargs[const.MONITOR_PORT]
- member = self.mem_member_client.create_member(**member_kwargs)
- return member, monitor
+ @decorators.idempotent_id('0684575a-0970-4fa8-8006-10c2b39c5f2b')
+ def test_ipv4_HTTP_LC_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
- # Note: This test also covers basic member show API
+ @decorators.idempotent_id('10641ec2-981e-4092-a0d0-89a434506eef')
+ def test_ipv4_HTTP_LC_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('dce70b40-502b-4b1c-8592-180817324ea0')
+ def test_ipv4_HTTPS_LC_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('46555ea6-12a8-4961-b105-bffdead7abcd')
+ def test_ipv4_HTTPS_LC_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('c1a5e297-f38e-4fc8-92a4-4177a37c4794')
+ def test_ipv4_PROXY_LC_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('dfe24159-96a4-4496-888e-e74acd9d390d')
+ def test_ipv4_PROXY_LC_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('2716d05d-6b04-405e-bda9-e79c778eb6dd')
+ def test_ipv4_TCP_LC_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('14ee6e7d-c434-4e2e-947b-1a37d5ffa3bd')
+ def test_ipv4_TCP_LC_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('fb9d0708-e320-45d7-be30-f6e7ea45c644')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_ipv4_UDP_LC_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('5d36d4a4-3b9c-4d54-af61-5f80080bb040')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_ipv4_UDP_LC_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(4, pool_id)
+
@decorators.idempotent_id('0623aa1f-753d-44e7-afa1-017d274eace7')
- def test_member_ipv4_create(self):
- self._test_member_create(4)
+ def test_ipv4_HTTP_RR_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
- # Note: This test also covers basic member show API
+ @decorators.idempotent_id('96b709fa-dca3-4780-8de7-fb168d455d76')
+ def test_ipv4_HTTP_RR_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('5354ac6c-653d-43ce-8096-1f9de961de73')
+ def test_ipv4_HTTPS_RR_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('e5c8503a-4bc5-43ad-b0da-3e5c1ef719f7')
+ def test_ipv4_HTTPS_RR_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('b2c8632b-f833-4844-9af3-ffee655be6bf')
+ def test_ipv4_PROXY_RR_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('e565de98-88e2-4529-9730-a66073e31480')
+ def test_ipv4_PROXY_RR_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('9306b599-c8e2-4ce9-b789-9e32d42406c4')
+ def test_ipv4_TCP_RR_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('9bbfec96-a7e5-414d-96d1-710e468b8700')
+ def test_ipv4_TCP_RR_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('ccced84a-994d-4d30-a07a-30fa83e4dde2')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_ipv4_UDP_RR_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('bc0802dd-633f-42d4-8c6a-b4c70af29870')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_ipv4_UDP_RR_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('0d9a8b32-0c13-49ea-8dd3-a124ec4ac6f9')
+ def test_ipv4_HTTP_SI_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('57c52d0c-0a62-4988-a02e-2f9f8b440d08')
+ def test_ipv4_HTTP_SI_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('df427d31-9843-4840-9137-6b88c633d329')
+ def test_ipv4_HTTPS_SI_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('e64c28f6-09f5-4fd8-a59e-bcf90975581a')
+ def test_ipv4_HTTPS_SI_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('5c32e2fd-9148-466c-b788-e11d7a48483b')
+ def test_ipv4_PROXY_SI_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('76435fb2-dcb3-4be2-ada9-2dbc375c100b')
+ def test_ipv4_PROXY_SI_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('62db0223-1e44-4d6c-8499-9f72c86d30e3')
+ def test_ipv4_TCP_SI_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('2da54523-cefc-4a44-ab07-c33ffe891bf0')
+ def test_ipv4_TCP_SI_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('9a298318-89a5-416f-b027-af5eda94f813')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_ipv4_UDP_SI_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('b0455c5e-3702-41d7-8069-6ce55563767c')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_ipv4_UDP_SI_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('a2dbf216-a974-45e1-822d-859f76c89ed6')
+ def test_ipv4_HTTP_SIP_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('926eeed9-ecf4-4d22-9417-ef7a7e0a7788')
+ def test_ipv4_HTTP_SIP_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('55da07bc-bf2c-4924-aba3-a03456843e14')
+ def test_ipv4_HTTPS_SIP_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('6773a8bd-1c51-4040-84ba-1aa2b6c4280d')
+ def test_ipv4_HTTPS_SIP_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('ab462d7c-069d-4b55-b6a7-dd199bde65b3')
+ def test_ipv4_PROXY_SIP_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('b1f6f779-2535-4e47-add2-24561545ba59')
+ def test_ipv4_PROXY_SIP_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('73673efc-5b70-4394-b831-1d59fe283e7d')
+ def test_ipv4_TCP_SIP_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('0a08da1e-84f5-4068-84ec-1312b6b8bee3')
+ def test_ipv4_TCP_SIP_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('caf68a97-1911-466c-b392-50b946e2395c')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_ipv4_UDP_SIP_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(4, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('bb750dc5-73a8-4722-bf3b-cdafaefe7914')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_ipv4_UDP_SIP_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(4, pool_id)
+
+ @decorators.idempotent_id('cd894c4f-2256-405f-aa6e-2f77973c749a')
+ def test_ipv6_HTTP_LC_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('3bbb8554-f757-4673-92e3-8593eef83f19')
+ def test_ipv6_HTTP_LC_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('6056724b-d046-497a-ae31-c02af67d4fbb')
+ def test_ipv6_HTTPS_LC_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('354e44d3-db08-4ba9-8e3e-8c3210542a86')
+ def test_ipv6_HTTPS_LC_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('0f8b924e-dd0b-44f9-92b6-8f3dfb0a720c')
+ def test_ipv6_PROXY_LC_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('d1efbfab-b674-4b78-8014-7ecf7ab464ac')
+ def test_ipv6_PROXY_LC_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('699f1c0d-65ae-40d7-9abd-2cef0a1560b9')
+ def test_ipv6_TCP_LC_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('595255f9-f595-43e7-a398-80dd76719aa8')
+ def test_ipv6_TCP_LC_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('0c2c2d5f-9602-4602-82e7-94a1393c295d')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ not CONF.load_balancer.test_with_ipv6))
+ def test_ipv6_UDP_LC_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('d41f5b46-ba06-42bf-a320-0fda106a7543')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ not CONF.load_balancer.test_with_ipv6))
+ def test_ipv6_UDP_LC_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_create(6, pool_id)
+
@decorators.idempotent_id('141944cc-5e2c-4e83-88f8-f61a6797c9b7')
- @testtools.skipUnless(CONF.load_balancer.test_with_ipv6,
- 'IPv6 testing is disabled')
- def test_member_ipv6_create(self):
- self._test_member_create(6)
+ def test_ipv6_HTTP_RR_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
- def _test_member_create(self, ip_version):
+ @decorators.idempotent_id('883db951-adb1-4e05-8369-99f38fde6b3c')
+ def test_ipv6_HTTP_RR_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('364ba4b9-825a-4f92-9bf2-8d76bcba0288')
+ def test_ipv6_HTTPS_RR_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('70ba1deb-d644-437f-af80-4299461b20af')
+ def test_ipv6_HTTPS_RR_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('06facdb2-5b7e-4e8b-810d-8f829c619a6d')
+ def test_ipv6_PROXY_RR_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('4ec5a74b-06bd-4005-8fcc-25d1bced4807')
+ def test_ipv6_PROXY_RR_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('22600457-ffe5-44a0-90b0-da4f48051023')
+ def test_ipv6_TCP_RR_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('57e6f861-5a55-43a5-9cae-a966bd2a48eb')
+ def test_ipv6_TCP_RR_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('4cddcf8a-566e-4a5a-bf81-99026b17f676')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ not CONF.load_balancer.test_with_ipv6))
+ def test_ipv6_UDP_RR_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('26547c9a-6bbc-429a-9436-e94f2930b9e1')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ not CONF.load_balancer.test_with_ipv6))
+ def test_ipv6_UDP_RR_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('6759674b-dca0-4a48-b166-3f87dc1cc727')
+ def test_ipv6_HTTP_SI_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('683d9ef4-6af3-48e2-aba4-9f404d493467')
+ def test_ipv6_HTTP_SI_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('3d308996-3522-4c91-9bfd-48fedc2ed2f2')
+ def test_ipv6_HTTPS_SI_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('dc26ce07-d580-4a55-b7cd-1b4f09c13572')
+ def test_ipv6_HTTPS_SI_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('56944f91-bf4b-4e9a-9b05-6207e8184c75')
+ def test_ipv6_PROXY_SI_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('e8f4eb38-8e8b-485a-b70a-b1679ad58b66')
+ def test_ipv6_PROXY_SI_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('fc0e77b1-e115-4ec7-80e3-c00d79932549')
+ def test_ipv6_TCP_SI_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('66ddafd2-ace3-43ea-b78b-78b6b0a4d9eb')
+ def test_ipv6_TCP_SI_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('ccfc1283-9e8e-4aa5-a5d3-1d18d57bec65')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ not CONF.load_balancer.test_with_ipv6))
+ def test_ipv6_UDP_SI_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('b62c8562-fdbb-4989-a5ae-d9e1c1b76cd5')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ not CONF.load_balancer.test_with_ipv6))
+ def test_ipv6_UDP_SI_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('d816d324-2434-4812-9b3e-a3f0d4949008')
+ def test_ipv6_HTTP_SIP_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('d4cfe315-b6d6-4940-8ff6-5f5252028eec')
+ def test_ipv6_HTTP_SIP_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('05684ab0-dff3-41aa-8b42-7f95fd6aa4ab')
+ def test_ipv6_HTTPS_SIP_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('ed42872c-1ffc-4210-9f69-5f7eb8ec732f')
+ def test_ipv6_HTTPS_SIP_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('ab87132f-5a0e-40a1-9498-9883780d31a9')
+ def test_ipv6_PROXY_SIP_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('227d7f40-a224-4e67-8844-2d28abc5171e')
+ def test_ipv6_PROXY_SIP_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('b8394de8-a898-4cab-aa0c-f3168d702ee0')
+ def test_ipv6_TCP_SIP_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('7a86e00b-90bf-4fd3-8636-ae7264929106')
+ def test_ipv6_TCP_SIP_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(6, pool_id)
+
+ @decorators.idempotent_id('5abdfbcd-d1cd-4e6a-b98f-79afea442ad8')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ not CONF.load_balancer.test_with_ipv6))
+ def test_ipv6_UDP_SIP_alt_monitor_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(6, pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('63f558b4-d2f8-4e4c-828b-3651e50844b7')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ not CONF.load_balancer.test_with_ipv6))
+ def test_ipv6_UDP_SIP_member_create(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_create(6, pool_id)
+
+ def _test_member_create(self, ip_version, pool_id,
+ alternate_monitor=False):
"""Tests member create and basic show APIs.
* Tests that users without the loadbalancer member role cannot
@@ -129,6 +847,12 @@
* Show member details.
* Validate the show reflects the requested values.
"""
+ if ip_version == 6 and not CONF.load_balancer.test_with_ipv6:
+ raise testtools.TestCase.skipException(
+ 'Skipping this test as test_with_ipv6 is not "True" in '
+ 'the tempest.conf [load_balancer] section. Testing with '
+ 'IPv6 is disabled. :-(')
+
if ip_version == 4:
member_address = '192.0.2.1'
member_monitor_address = '192.0.2.2'
@@ -140,13 +864,16 @@
member_kwargs = {
const.NAME: member_name,
const.ADMIN_STATE_UP: True,
- const.POOL_ID: self.pool_id,
+ const.POOL_ID: pool_id,
const.ADDRESS: member_address,
- const.PROTOCOL_PORT: 80,
+ const.PROTOCOL_PORT: self.member_port.increment(),
const.WEIGHT: 50,
- const.MONITOR_ADDRESS: member_monitor_address,
- const.MONITOR_PORT: 8080,
}
+
+ if alternate_monitor:
+ member_kwargs[const.MONITOR_ADDRESS] = member_monitor_address
+ member_kwargs[const.MONITOR_PORT] = 8080
+
if self.mem_member_client.is_version_supported(
self.api_version, '2.1'):
member_kwargs.update({
@@ -172,12 +899,11 @@
self.os_primary.member_client.create_member,
**member_kwargs)
- member, monitor = self._create_member_and_get_monitor_status(
- **member_kwargs)
+ member = self.mem_member_client.create_member(**member_kwargs)
self.addClassResourceCleanup(
self.mem_member_client.cleanup_member,
- member[const.ID], pool_id=self.pool_id,
+ member[const.ID], pool_id=pool_id,
lb_client=self.mem_lb_client, lb_id=self.lb_id)
waiters.wait_for_status(
@@ -191,7 +917,7 @@
const.ACTIVE,
CONF.load_balancer.build_interval,
CONF.load_balancer.build_timeout,
- pool_id=self.pool_id)
+ pool_id=pool_id)
parser.parse(member[const.CREATED_AT])
parser.parse(member[const.UPDATED_AT])
@@ -209,8 +935,9 @@
self.assertCountEqual(member_kwargs[const.TAGS],
member[const.TAGS])
- if monitor:
+ if alternate_monitor:
equal_items += [const.MONITOR_ADDRESS, const.MONITOR_PORT]
+
if const.SUBNET_ID in member_kwargs:
equal_items.append(const.SUBNET_ID)
else:
@@ -219,8 +946,107 @@
for item in equal_items:
self.assertEqual(member_kwargs[item], member[item])
+ @decorators.idempotent_id('fcc5c6cd-d1c2-4a49-8d26-2268608e59a6')
+ def test_HTTP_LC_member_list(self):
+ self._test_member_list(const.HTTP,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('33450ca2-db09-451a-bd46-6f260bf520f5')
+ def test_HTTPS_LC_member_list(self):
+ self._test_member_list(const.HTTPS,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('c17241d4-5cff-41e2-9742-047647d61546')
+ def test_PROXY_LC_member_list(self):
+ self._test_member_list(const.PROXY,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('d1300e9a-64ba-4d02-baf6-2523439b80d7')
+ def test_TCP_LC_member_list(self):
+ self._test_member_list(const.TCP,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('dffc1dfb-7506-4f81-b1e5-5835b9690079')
+ def test_UDP_LC_member_list(self):
+ self._test_member_list(const.UDP,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
@decorators.idempotent_id('9ce7ad78-915b-42ce-b0d8-44d88a929f3d')
- def test_member_list(self):
+ def test_HTTP_RR_member_list(self):
+ self._test_member_list(const.HTTP,
+ const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('8f6362a1-d98b-4696-b88d-41e1eb4a9f70')
+ def test_HTTPS_RR_member_list(self):
+ self._test_member_list(const.HTTPS,
+ const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('ce4109f8-3bad-4965-95ec-7170519e4a3f')
+ def test_PROXY_RR_member_list(self):
+ self._test_member_list(const.PROXY,
+ const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('5c35df5d-8951-4506-905b-502f623cc9e4')
+ def test_TCP_RR_member_list(self):
+ self._test_member_list(const.TCP,
+ const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('c7de7d31-2910-4864-84df-61a883e916fb')
+ def test_UDP_RR_member_list(self):
+ self._test_member_list(const.UDP,
+ const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('0d142f26-c9e4-45bf-8cd7-1f5659301047')
+ def test_HTTP_SI_member_list(self):
+ self._test_member_list(const.HTTP,
+ const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('a2be8c21-c7b1-4c1d-ab39-43042bf75a19')
+ def test_HTTPS_SI_member_list(self):
+ self._test_member_list(const.HTTPS,
+ const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('1ab3978b-8a37-45d3-8e2c-aab4c2187d43')
+ def test_PROXY_SI_member_list(self):
+ self._test_member_list(const.PROXY,
+ const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('2da08931-bc4c-4339-b16a-43d40ca7734d')
+ def test_TCP_SI_member_list(self):
+ self._test_member_list(const.TCP,
+ const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('ea12a6bc-6267-4790-b2b3-cbd6a146533b')
+ def test_UDP_SI_member_list(self):
+ self._test_member_list(const.UDP,
+ const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('2f9d0974-2e55-49c1-b83a-8bdd6dfdb46c')
+ def test_HTTP_SIP_member_list(self):
+ self._test_member_list(const.HTTP,
+ const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('d31c5b8b-7ec1-4e78-a821-30e9a1e05139')
+ def test_HTTPS_SIP_member_list(self):
+ self._test_member_list(const.HTTPS,
+ const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('15f8690b-f345-413c-9b4e-af39d546fbec')
+ def test_PROXY_SIP_member_list(self):
+ self._test_member_list(const.PROXY,
+ const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('db5769ce-f4b0-4a0f-92a7-4eeed66b6730')
+ def test_TCP_SIP_member_list(self):
+ self._test_member_list(const.TCP,
+ const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('638811fa-26ce-44f3-8ac7-29cf1ef41838')
+ def test_UDP_SIP_member_list(self):
+ self._test_member_list(const.UDP,
+ const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ def _test_member_list(self, pool_protocol, algorithm):
"""Tests member list API and field filtering.
* Create a clean pool.
@@ -234,11 +1060,37 @@
* List the members filtering to one of the three.
* List the members filtered, one field, and sorted.
"""
+ if (algorithm == const.LB_ALGORITHM_SOURCE_IP_PORT and not
+ self.mem_listener_client.is_version_supported(
+ self.api_version, '2.13')):
+ raise testtools.TestCase.skipException(
+ 'Skipping this test as load balancing algorithm '
+ 'SOURCE_IP_PORT requires API version 2.13 or newer.')
+ if (pool_protocol == const.UDP and
+ not self.mem_listener_client.is_version_supported(
+ self.api_version, '2.1')):
+ raise self.skipException('UDP support is only available '
+ 'in Octavia API version 2.1 or newer')
+
pool_name = data_utils.rand_name("lb_member_pool2_member-list")
- pool = self.mem_pool_client.create_pool(
- name=pool_name, loadbalancer_id=self.lb_id,
- protocol=self.protocol,
- lb_algorithm=self.lb_algorithm)
+ # This is a special case as the reference driver does not support
+ # SOURCE-IP-PORT. Since it runs with not_implemented_is_error, we must
+ # handle this test case special.
+ try:
+ pool = self.mem_pool_client.create_pool(
+ name=pool_name, loadbalancer_id=self.lb_id,
+ protocol=pool_protocol,
+ lb_algorithm=algorithm)
+ except exceptions.NotImplemented as e:
+ if algorithm != const.LB_ALGORITHM_SOURCE_IP_PORT:
+ raise
+ message = ("The configured provider driver '{driver}' "
+ "does not support a feature required for this "
+ "test.".format(driver=CONF.load_balancer.provider))
+ if hasattr(e, 'resp_body'):
+ message = e.resp_body.get('faultstring', message)
+ raise testtools.TestCase.skipException(message)
+
pool_id = pool[const.ID]
self.addCleanup(
self.mem_pool_client.cleanup_pool, pool_id,
@@ -488,8 +1340,351 @@
self.assertTrue(not any(["" in member[const.TAGS]
for member in list_of_members]))
+ @decorators.idempotent_id('2674b363-7922-494a-b121-cf415dbbb716')
+ def test_HTTP_LC_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('a99da0e8-0595-49a5-a788-efc37fad2dc2')
+ def test_HTTP_LC_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('c3db94b3-a38c-4a0a-8c53-85888c2e1876')
+ def test_HTTPS_LC_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('5844580e-6d01-42dc-b951-d995c9612167')
+ def test_HTTPS_LC_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('ebc52abf-9133-4922-902c-505f890bb44e')
+ def test_PROXY_LC_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('43f90043-65d4-483a-99ab-564f25acc0d7')
+ def test_PROXY_LC_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('ecec1c11-2c2c-408c-9b4e-01620266dab6')
+ def test_TCP_LC_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('baa9b4ec-1ac5-431f-bae0-f2ef68d1c81a')
+ def test_TCP_LC_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('3a291344-0a88-46fc-9eca-c2c6b9048076')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_LC_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('e53b2d6a-ad3f-46be-b899-56324874ad24')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_LC_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_show(pool_id)
+
@decorators.idempotent_id('7674ae04-7e92-44ef-9adf-40718d7ec705')
- def test_member_show(self):
+ def test_HTTP_RR_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('2c4a29f4-be25-416c-9546-9585298cfe4c')
+ def test_HTTP_RR_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('a06a137d-f6d1-44a6-978b-22fe8e23752c')
+ def test_HTTPS_RR_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('bfe7dfea-878e-4e7c-afd8-9860d7282930')
+ def test_HTTPS_RR_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('007c4f0c-8192-4806-9c25-c2f27ea4ba57')
+ def test_PROXY_RR_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('0d6d2875-d1b3-4508-8e17-1c656a5f31ec')
+ def test_PROXY_RR_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('9c968920-1fcc-4a71-8dc9-fdf2ff59af7c')
+ def test_TCP_RR_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('1acd8a34-dd13-411e-bdf3-414b3fcc569d')
+ def test_TCP_RR_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('2d154e0c-4955-4b00-92d5-e9df7b2fbf63')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_RR_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('06de8b15-caf3-4a75-b278-cdfe6208c8db')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_RR_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('6c88a35e-b7c1-4b14-bdae-1a710890555a')
+ def test_HTTP_SI_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('266b60e2-7c3a-4edb-950b-66d57aa64b80')
+ def test_HTTP_SI_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('c2c8ba90-6ade-4fd3-bf12-e15627983917')
+ def test_HTTPS_SI_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('4af933ae-5c6d-4849-af85-e06f7d5a661c')
+ def test_HTTPS_SI_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('383148a5-a9ec-413a-a44c-85c1bbb39729')
+ def test_PROXY_SI_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('518c4d3f-2b5a-4f8a-9c5e-fad15127502e')
+ def test_PROXY_SI_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('9b95b5f2-8823-4019-be86-311a1bde5b20')
+ def test_TCP_SI_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('d8576e58-e8ff-491d-beee-b7c439d2c41c')
+ def test_TCP_SI_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('896acc77-3b73-4565-ad87-9467218b143b')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_SI_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('ffc64ff1-ec8c-4201-a295-a179adc0c7e0')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_SI_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('7c4fcb3e-a994-4d39-97cc-929c022c001e')
+ def test_HTTP_SIP_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('704d04c3-e639-4dee-b55d-09ebf55f8a0d')
+ def test_HTTP_SIP_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('69de0c60-3e4f-40cf-9bf7-d2b1e6c83715')
+ def test_HTTPS_SIP_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('2d970b1c-c157-4974-b605-b8e08d97e874')
+ def test_HTTPS_SIP_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('28e1e3e7-454b-409d-84c3-1826f82ca9dd')
+ def test_PROXY_SIP_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('189ec327-b1c5-47a8-a843-10963cba0a9c')
+ def test_PROXY_SIP_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('6953a9a4-5fac-4470-bfda-4fafbd67288b')
+ def test_TCP_SIP_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('6d8d546f-8c41-49b9-bd9d-8f8ea3975816')
+ def test_TCP_SIP_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_show(pool_id)
+
+ @decorators.idempotent_id('9c0d4668-5a0e-41b3-b3b4-3d0372fe28af')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_SIP_alt_monitor_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_show(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('a03d02d0-830c-4aad-a10b-96c47974483c')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_SIP_member_show(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_show(pool_id)
+
+ def _test_member_show(self, pool_id, alternate_monitor=False):
"""Tests member show API.
* Create a fully populated member.
@@ -501,13 +1696,15 @@
member_kwargs = {
const.NAME: member_name,
const.ADMIN_STATE_UP: True,
- const.POOL_ID: self.pool_id,
+ const.POOL_ID: pool_id,
const.ADDRESS: '192.0.2.1',
- const.PROTOCOL_PORT: 81,
+ const.PROTOCOL_PORT: self.member_port.increment(),
const.WEIGHT: 50,
- const.MONITOR_ADDRESS: '192.0.2.2',
- const.MONITOR_PORT: 8080,
}
+ if alternate_monitor:
+ member_kwargs[const.MONITOR_ADDRESS] = '192.0.2.2'
+ member_kwargs[const.MONITOR_PORT] = 8080
+
if self.mem_member_client.is_version_supported(
self.api_version, '2.1'):
member_kwargs.update({
@@ -517,12 +1714,11 @@
member_kwargs[const.SUBNET_ID] = self.lb_member_vip_subnet[
const.ID]
- member, monitor = self._create_member_and_get_monitor_status(
- **member_kwargs)
+ member = self.mem_member_client.create_member(**member_kwargs)
self.addClassResourceCleanup(
self.mem_member_client.cleanup_member,
- member[const.ID], pool_id=self.pool_id,
+ member[const.ID], pool_id=pool_id,
lb_client=self.mem_lb_client, lb_id=self.lb_id)
waiters.wait_for_status(
@@ -536,7 +1732,7 @@
const.ACTIVE,
CONF.load_balancer.build_interval,
CONF.load_balancer.build_timeout,
- pool_id=self.pool_id)
+ pool_id=pool_id)
parser.parse(member[const.CREATED_AT])
parser.parse(member[const.UPDATED_AT])
@@ -550,8 +1746,9 @@
self.api_version, '2.1'):
equal_items.append(const.BACKUP)
- if monitor:
+ if alternate_monitor:
equal_items += [const.MONITOR_ADDRESS, const.MONITOR_PORT]
+
if const.SUBNET_ID in member_kwargs:
equal_items.append(const.SUBNET_ID)
else:
@@ -564,13 +1761,13 @@
if CONF.load_balancer.RBAC_test_type == const.ADVANCED:
member_client = self.os_roles_lb_admin.member_client
member_adm = member_client.show_member(
- member[const.ID], pool_id=self.pool_id)
+ member[const.ID], pool_id=pool_id)
self.assertEqual(member_name, member_adm[const.NAME])
# Test that a user with cloud admin role can see the member
if not CONF.load_balancer.RBAC_test_type == const.NONE:
adm = self.os_admin.member_client.show_member(
- member[const.ID], pool_id=self.pool_id)
+ member[const.ID], pool_id=pool_id)
self.assertEqual(member_name, adm[const.NAME])
# Test that a different user, with load balancer member role, cannot
@@ -579,7 +1776,7 @@
member2_client = self.os_roles_lb_member2.member_client
self.assertRaises(exceptions.Forbidden,
member2_client.show_member,
- member[const.ID], pool_id=self.pool_id)
+ member[const.ID], pool_id=pool_id)
# Test that a user, without the load balancer member role, cannot
# show members
@@ -587,10 +1784,353 @@
self.assertRaises(
exceptions.Forbidden,
self.os_primary.member_client.show_member,
- member[const.ID], pool_id=self.pool_id)
+ member[const.ID], pool_id=pool_id)
+
+ @decorators.idempotent_id('65680d48-1d49-4959-a7d1-677797e54f6b')
+ def test_HTTP_LC_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('52124440-c95c-48fb-af26-70377bcba7d6')
+ def test_HTTP_LC_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('caf95728-5e9c-4295-bd4a-a15263ba5714')
+ def test_HTTPS_LC_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('d1d98798-20cb-4290-818c-e814911d25e5')
+ def test_HTTPS_LC_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('b22288fa-4e25-4779-bd78-6b4802926457')
+ def test_PROXY_LC_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('5ee3df40-381a-4497-9e31-df82d8c2e514')
+ def test_PROXY_LC_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('b693b5ba-d8e7-4b89-ad6c-41b56cf258f7')
+ def test_TCP_LC_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('0df9463f-de6b-43c1-934f-6523873f3530')
+ def test_TCP_LC_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('60baa2d7-927a-4b58-80b9-a2e5196985ee')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_LC_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('b036a40f-d220-4be6-abc9-8ca8e01b96c3')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_LC_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_update(pool_id)
@decorators.idempotent_id('c07572b8-e853-48f3-a8ea-37fc293a4724')
- def test_member_update(self):
+ def test_HTTP_RR_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('f83993ce-b053-42ff-9022-612ed67e8db6')
+ def test_HTTP_RR_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('e419d49f-22e4-4331-985e-3a1cc8d0b6b0')
+ def test_HTTPS_RR_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('42ac5187-799a-4714-972c-fea6e1c6a7b2')
+ def test_HTTPS_RR_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('43d30b1d-0f99-4b46-ad37-542e899ceae7')
+ def test_PROXY_RR_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('d5cf47a6-a3bb-4238-a5cf-a74b122edce4')
+ def test_PROXY_RR_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('5a05f8b0-52ca-4ed7-a1a7-c62aee16c960')
+ def test_TCP_RR_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('46e5d4e8-0ecc-40a7-87bd-f9ccdfc9a2d3')
+ def test_TCP_RR_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('7609cd2f-32ac-4488-869a-7e14827df6ef')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_RR_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('171ae461-af7d-4fe1-961d-78376fcc2b3f')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_RR_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('af40e333-caed-4808-a46c-05c977f3cebc')
+ def test_HTTP_SI_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('f63a9deb-4a45-42c4-9aeb-f7c304ecbc16')
+ def test_HTTP_SI_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('27c17512-51b4-49ae-ac92-3e141599cdda')
+ def test_HTTPS_SI_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('cc67064f-becc-4e31-b9e5-b3ea7e78a187')
+ def test_HTTPS_SI_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('2061a0cf-49e0-49b8-af4d-f197cf84ef11')
+ def test_PROXY_SI_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('5946b163-8684-402a-b228-c0648a3e0734')
+ def test_PROXY_SI_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('7a6314dd-83c5-41ee-92f6-e18409ac213d')
+ def test_TCP_SI_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('93818084-a9fb-480d-a7e1-04066ee0e393')
+ def test_TCP_SI_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('523cf4e8-c071-4778-bc89-367a0b8469e6')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_SI_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('9f655415-13d6-4ceb-9ea6-9a32baf0e093')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_SI_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('5215ecc4-fd47-451a-b073-399bad8b522c')
+ def test_HTTP_SIP_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('7c89fb05-d949-4c0f-8c61-7e55e494c76f')
+ def test_HTTP_SIP_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('edff98be-6208-4f1c-9cd3-376b7ac47f80')
+ def test_HTTPS_SIP_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('a1f214fe-6c09-4298-b03e-7069b615dec2')
+ def test_HTTPS_SIP_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('56a21d8e-825a-4780-a073-41061a0d55ca')
+ def test_PROXY_SIP_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('25a24e27-218b-4dcd-99aa-e9ca9f8163e5')
+ def test_PROXY_SIP_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('d6625773-2665-423d-8500-cf9b1b38b53e')
+ def test_TCP_SIP_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('87a3e3aa-580a-41ca-bc15-8cb2995c9125')
+ def test_TCP_SIP_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_update(pool_id)
+
+ @decorators.idempotent_id('796a2972-38e6-41fc-a885-6316195acd70')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_SIP_alt_monitor_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_update(pool_id, alternate_monitor=True)
+
+ @decorators.idempotent_id('2f4efa91-e61d-4dd6-8006-ebfdb00c1246')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_SIP_member_update(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_update(pool_id)
+
+ def _test_member_update(self, pool_id, alternate_monitor=False):
"""Tests member show API and field filtering.
* Create a fully populated member.
@@ -605,13 +2145,15 @@
member_kwargs = {
const.NAME: member_name,
const.ADMIN_STATE_UP: False,
- const.POOL_ID: self.pool_id,
+ const.POOL_ID: pool_id,
const.ADDRESS: '192.0.2.1',
- const.PROTOCOL_PORT: 82,
+ const.PROTOCOL_PORT: self.member_port.increment(),
const.WEIGHT: 50,
- const.MONITOR_ADDRESS: '192.0.2.2',
- const.MONITOR_PORT: 8080,
}
+ if alternate_monitor:
+ member_kwargs[const.MONITOR_ADDRESS] = '192.0.2.2'
+ member_kwargs[const.MONITOR_PORT] = 8080
+
if self.mem_member_client.is_version_supported(
self.api_version, '2.1'):
member_kwargs.update({
@@ -629,12 +2171,11 @@
member_kwargs[const.SUBNET_ID] = self.lb_member_vip_subnet[
const.ID]
- member, monitor = self._create_member_and_get_monitor_status(
- **member_kwargs)
+ member = self.mem_member_client.create_member(**member_kwargs)
self.addClassResourceCleanup(
self.mem_member_client.cleanup_member,
- member[const.ID], pool_id=self.pool_id,
+ member[const.ID], pool_id=pool_id,
lb_client=self.mem_lb_client, lb_id=self.lb_id)
waiters.wait_for_status(
@@ -648,9 +2189,9 @@
const.ACTIVE,
CONF.load_balancer.build_interval,
CONF.load_balancer.build_timeout,
- pool_id=self.pool_id)
+ pool_id=pool_id)
status = const.OFFLINE
- if not monitor or CONF.load_balancer.test_with_noop:
+ if CONF.load_balancer.test_with_noop:
status = const.NO_MONITOR
member = waiters.wait_for_status(
self.mem_member_client.show_member,
@@ -658,7 +2199,7 @@
status,
CONF.load_balancer.build_interval,
CONF.load_balancer.build_timeout,
- pool_id=self.pool_id)
+ pool_id=pool_id)
parser.parse(member[const.CREATED_AT])
parser.parse(member[const.UPDATED_AT])
@@ -676,8 +2217,9 @@
self.assertCountEqual(member_kwargs[const.TAGS],
member[const.TAGS])
- if monitor:
+ if alternate_monitor:
equal_items += [const.MONITOR_ADDRESS, const.MONITOR_PORT]
+
if const.SUBNET_ID in member_kwargs:
equal_items.append(const.SUBNET_ID)
else:
@@ -686,25 +2228,17 @@
for item in equal_items:
self.assertEqual(member_kwargs[item], member[item])
- if CONF.load_balancer.test_with_noop or not monitor:
- # Operating status with noop or Driver not supporting Monitors
- # will stay in NO_MONITOR
- self.assertEqual(const.NO_MONITOR, member[const.OPERATING_STATUS])
- else:
- # Operating status will be OFFLINE while admin_state_up = False
- self.assertEqual(const.OFFLINE, member[const.OPERATING_STATUS])
-
# Test that a user, without the load balancer member role, cannot
# use this command
if CONF.load_balancer.RBAC_test_type == const.ADVANCED:
self.assertRaises(
exceptions.Forbidden,
self.os_primary.member_client.update_member,
- member[const.ID], pool_id=self.pool_id, admin_state_up=True)
+ member[const.ID], pool_id=pool_id, admin_state_up=True)
# Assert we didn't go into PENDING_*
member_check = self.mem_member_client.show_member(
- member[const.ID], pool_id=self.pool_id)
+ member[const.ID], pool_id=pool_id)
self.assertEqual(const.ACTIVE,
member_check[const.PROVISIONING_STATUS])
self.assertEqual(member_kwargs[const.ADMIN_STATE_UP],
@@ -716,12 +2250,12 @@
member2_client = self.os_roles_lb_member2.member_client
self.assertRaises(exceptions.Forbidden,
member2_client.update_member,
- member[const.ID], pool_id=self.pool_id,
+ member[const.ID], pool_id=pool_id,
admin_state_up=True)
# Assert we didn't go into PENDING_*
member_check = self.mem_member_client.show_member(
- member[const.ID], pool_id=self.pool_id)
+ member[const.ID], pool_id=pool_id)
self.assertEqual(const.ACTIVE,
member_check[const.PROVISIONING_STATUS])
self.assertEqual(member_kwargs[const.ADMIN_STATE_UP],
@@ -747,7 +2281,7 @@
const.TAGS: new_tags
})
- if monitor:
+ if alternate_monitor:
member_update_kwargs[const.MONITOR_ADDRESS] = '192.0.2.3'
member_update_kwargs[const.MONITOR_PORT] = member[
const.MONITOR_PORT] + 1
@@ -764,18 +2298,15 @@
const.ACTIVE,
CONF.load_balancer.build_interval,
CONF.load_balancer.build_timeout,
- pool_id=self.pool_id)
- if not CONF.load_balancer.test_with_noop:
- member = waiters.wait_for_status(
- self.mem_member_client.show_member,
- member[const.ID], const.OPERATING_STATUS,
- const.NO_MONITOR,
- CONF.load_balancer.build_interval,
- CONF.load_balancer.build_timeout,
- pool_id=self.pool_id)
-
+ pool_id=pool_id)
# Operating status will be NO_MONITOR regardless of noop
- self.assertEqual(const.NO_MONITOR, member[const.OPERATING_STATUS])
+ member = waiters.wait_for_status(
+ self.mem_member_client.show_member,
+ member[const.ID], const.OPERATING_STATUS,
+ const.NO_MONITOR,
+ CONF.load_balancer.build_interval,
+ CONF.load_balancer.build_timeout,
+ pool_id=pool_id)
# Test changed items
equal_items = [const.NAME, const.ADMIN_STATE_UP, const.WEIGHT]
@@ -789,8 +2320,9 @@
self.assertCountEqual(member_update_kwargs[const.TAGS],
member[const.TAGS])
- if monitor:
+ if alternate_monitor:
equal_items += [const.MONITOR_ADDRESS, const.MONITOR_PORT]
+
for item in equal_items:
self.assertEqual(member_update_kwargs[item], member[item])
@@ -804,19 +2336,265 @@
for item in equal_items:
self.assertEqual(member_kwargs[item], member[item])
+ @decorators.idempotent_id('8104628d-6f30-4037-ae65-c6f6c1b3af42')
+ def test_HTTP_LC_member_batch_update(self):
+ self._test_member_batch_update(const.HTTP,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('c4331afe-c129-44e8-8388-fcbbd28cf783')
+ def test_HTTP_LC_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.HTTP,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('5ed41de6-8994-4ba4-8107-29eab89fab1e')
+ def test_HTTPS_LC_member_batch_update(self):
+ self._test_member_batch_update(const.HTTPS,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('dd4d0a10-0473-47a2-8ec5-815fbdf0c5ee')
+ def test_HTTPS_LC_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.HTTPS,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('7ae0bd6f-d04c-4d53-bb7e-fef0680726db')
+ def test_PROXY_LC_member_batch_update(self):
+ self._test_member_batch_update(const.PROXY,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('de033003-1dcb-4896-ad5d-9e68e31addf0')
+ def test_PROXY_LC_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.PROXY,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('1d79ab5a-1110-43f1-bfc3-1cb4e2ab5011')
+ def test_TCP_LC_member_batch_update(self):
+ self._test_member_batch_update(const.TCP,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('69bd512a-d561-43b1-9a4a-ea7134ee8f9e')
+ def test_TCP_LC_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.TCP,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('b9fadfe2-c3f2-48a4-97a4-04c58c40df87')
+ def test_UDP_LC_member_batch_update(self):
+ self._test_member_batch_update(const.UDP,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('f9a125e0-84c4-4f7e-8a82-fe84ca3175e5')
+ def test_UDP_LC_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.UDP,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('5f412e52-8ee0-4ee5-8b0e-0e8fc68279a6')
+ def test_HTTP_RR_member_batch_update(self):
+ self._test_member_batch_update(const.HTTP,
+ const.LB_ALGORITHM_ROUND_ROBIN)
+
@decorators.idempotent_id('83e0a9f2-491f-46a8-b3ce-6969d70a4e9f')
- def test_member_batch_update(self):
+ def test_HTTP_RR_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.HTTP,
+ const.LB_ALGORITHM_ROUND_ROBIN,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('ee622c92-a4b4-41a6-96e3-b3b2429276a2')
+ def test_HTTPS_RR_member_batch_update(self):
+ self._test_member_batch_update(const.HTTPS,
+ const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('7bed4b1c-f862-45bf-ae30-3b4ad0b48870')
+ def test_HTTPS_RR_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.HTTPS,
+ const.LB_ALGORITHM_ROUND_ROBIN,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('82325d1a-ad01-471e-bfb3-b75ca86ae8eb')
+ def test_PROXY_RR_member_batch_update(self):
+ self._test_member_batch_update(const.PROXY,
+ const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('098f73c5-e3c1-4dfa-bd7f-c87df90743e6')
+ def test_PROXY_RR_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.PROXY,
+ const.LB_ALGORITHM_ROUND_ROBIN,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('176cd46e-f5b1-47d1-9403-a0246272eea4')
+ def test_TCP_RR_member_batch_update(self):
+ self._test_member_batch_update(const.TCP,
+ const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('e952a399-c817-461e-9e37-fdf7e7b34983')
+ def test_TCP_RR_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.TCP,
+ const.LB_ALGORITHM_ROUND_ROBIN,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('dec6b06d-6a69-48d9-b7a9-67eb287fe95a')
+ def test_UDP_RR_member_batch_update(self):
+ self._test_member_batch_update(const.UDP,
+ const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('fdf2423c-c312-466a-b021-130a52b5be35')
+ def test_UDP_RR_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.UDP,
+ const.LB_ALGORITHM_ROUND_ROBIN,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('546ac0c3-4025-4c88-8276-1c05e7198e82')
+ def test_HTTP_SI_member_batch_update(self):
+ self._test_member_batch_update(const.HTTP,
+ const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('6c1fe175-8e99-4adf-934d-bee79c89fa02')
+ def test_HTTP_SI_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.HTTP,
+ const.LB_ALGORITHM_SOURCE_IP,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('3e6c76e0-3630-45f0-a674-5d79b662812b')
+ def test_HTTPS_SI_member_batch_update(self):
+ self._test_member_batch_update(const.HTTPS,
+ const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('59303a97-cc97-441e-b1a6-395271ec2287')
+ def test_HTTPS_SI_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.HTTPS,
+ const.LB_ALGORITHM_SOURCE_IP,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('963d7e71-d8b7-4257-9b01-f1d7ab57cbc8')
+ def test_PROXY_SI_member_batch_update(self):
+ self._test_member_batch_update(const.PROXY,
+ const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('f55d8bff-ac68-4e3b-8f05-a9bb69bb0881')
+ def test_PROXY_SI_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.PROXY,
+ const.LB_ALGORITHM_SOURCE_IP,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('71d20f78-ffe3-49a3-b0c6-38cd5804f255')
+ def test_TCP_SI_member_batch_update(self):
+ self._test_member_batch_update(const.TCP,
+ const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('fee72f7a-928d-477f-b09b-5a866be717a3')
+ def test_TCP_SI_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.TCP,
+ const.LB_ALGORITHM_SOURCE_IP,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('086b407e-3ace-47a8-94e4-cf563674ceb6')
+ def test_UDP_SI_member_batch_update(self):
+ self._test_member_batch_update(const.UDP,
+ const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('04259015-b6d7-411b-8c19-f21e05994b7c')
+ def test_UDP_SI_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.UDP,
+ const.LB_ALGORITHM_SOURCE_IP,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('617028e2-89fb-4e7e-ba62-1a8a7af697ca')
+ def test_HTTP_SIP_member_batch_update(self):
+ self._test_member_batch_update(const.HTTP,
+ const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('44a2508d-ecea-4f92-ba66-a64d6d7f12da')
+ def test_HTTP_SIP_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.HTTP,
+ const.LB_ALGORITHM_SOURCE_IP_PORT,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('794137e5-28c1-4b0e-bc2f-fc030d03a689')
+ def test_HTTPS_SIP_member_batch_update(self):
+ self._test_member_batch_update(const.HTTPS,
+ const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('c1c8930d-0436-4075-b47a-f3bd263ab8a8')
+ def test_HTTPS_SIP_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.HTTPS,
+ const.LB_ALGORITHM_SOURCE_IP_PORT,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('1ab05cf2-265e-4291-b17c-19caa0a1b6ff')
+ def test_PROXY_SIP_member_batch_update(self):
+ self._test_member_batch_update(const.PROXY,
+ const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('4de187b6-4948-4394-af6b-8828e96d8f3e')
+ def test_PROXY_SIP_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.PROXY,
+ const.LB_ALGORITHM_SOURCE_IP_PORT,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('1d171080-c7e5-4ee0-83d4-51bb1655cb21')
+ def test_TCP_SIP_member_batch_update(self):
+ self._test_member_batch_update(const.TCP,
+ const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('52328f7a-bec4-4f23-9293-f5f1283c0af9')
+ def test_TCP_SIP_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.TCP,
+ const.LB_ALGORITHM_SOURCE_IP_PORT,
+ alternate_monitor=True)
+
+ @decorators.idempotent_id('00b3ebda-c28c-471b-bbf8-01de6567b4b5')
+ def test_UDP_SIP_member_batch_update(self):
+ self._test_member_batch_update(const.UDP,
+ const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('e4a357a3-1d07-46f4-a8ff-67a279783b24')
+ def test_UDP_SIP_alt_monitor_member_batch_update(self):
+ self._test_member_batch_update(const.UDP,
+ const.LB_ALGORITHM_SOURCE_IP_PORT,
+ alternate_monitor=True)
+
+ def _test_member_batch_update(self, pool_protocol, algorithm,
+ alternate_monitor=False):
"""Tests member batch update.
* Create two members.
* Batch update the members so one is deleted, created, and updated
* Validate the member list is correct.
"""
+ if (algorithm == const.LB_ALGORITHM_SOURCE_IP_PORT and not
+ self.mem_listener_client.is_version_supported(
+ self.api_version, '2.13')):
+ raise testtools.TestCase.skipException(
+ 'Skipping this test as load balancing algorithm '
+ 'SOURCE_IP_PORT requires API version 2.13 or newer.')
+ if (pool_protocol == const.UDP and
+ not self.mem_listener_client.is_version_supported(
+ self.api_version, '2.1')):
+ raise self.skipException('UDP support is only available '
+ 'in Octavia API version 2.1 or newer')
+
pool_name = data_utils.rand_name("lb_member_pool3_member-batch")
- pool = self.mem_pool_client.create_pool(
- name=pool_name, loadbalancer_id=self.lb_id,
- protocol=self.protocol,
- lb_algorithm=self.lb_algorithm)
+ # This is a special case as the reference driver does not support
+ # SOURCE-IP-PORT. Since it runs with not_implemented_is_error, we must
+ # handle this test case special.
+ try:
+ pool = self.mem_pool_client.create_pool(
+ name=pool_name, loadbalancer_id=self.lb_id,
+ protocol=pool_protocol,
+ lb_algorithm=algorithm)
+ except exceptions.NotImplemented as e:
+ if algorithm != const.LB_ALGORITHM_SOURCE_IP_PORT:
+ raise
+ message = ("The configured provider driver '{driver}' "
+ "does not support a feature required for this "
+ "test.".format(driver=CONF.load_balancer.provider))
+ if hasattr(e, 'resp_body'):
+ message = e.resp_body.get('faultstring', message)
+ raise testtools.TestCase.skipException(message)
+
pool_id = pool[const.ID]
self.addClassResourceCleanup(
self.mem_pool_client.cleanup_pool, pool_id,
@@ -837,9 +2615,11 @@
const.ADDRESS: '192.0.2.1',
const.PROTOCOL_PORT: 80,
const.WEIGHT: 50,
- const.MONITOR_ADDRESS: '192.0.2.2',
- const.MONITOR_PORT: 8080,
}
+ if alternate_monitor:
+ member1_kwargs[const.MONITOR_ADDRESS] = '192.0.2.2'
+ member1_kwargs[const.MONITOR_PORT] = 8080
+
if self.mem_member_client.is_version_supported(
self.api_version, '2.1'):
member1_kwargs.update({
@@ -849,8 +2629,7 @@
if self.lb_member_vip_subnet:
member1_kwargs[const.SUBNET_ID] = self.lb_member_vip_subnet[
const.ID]
- member1, monitor = self._create_member_and_get_monitor_status(
- **member1_kwargs)
+ member1 = self.mem_member_client.create_member(**member1_kwargs)
self.addClassResourceCleanup(
self.mem_member_client.cleanup_member,
@@ -879,9 +2658,10 @@
const.BACKUP: True,
})
- if monitor:
+ if alternate_monitor:
member2_kwargs[const.MONITOR_ADDRESS] = '192.0.2.4'
member2_kwargs[const.MONITOR_PORT] = 8081
+
if self.lb_member_vip_subnet:
member2_kwargs[const.SUBNET_ID] = self.lb_member_vip_subnet[
const.ID]
@@ -913,9 +2693,10 @@
const.BACKUP: True,
})
- if monitor:
+ if alternate_monitor:
member2_kwargs[const.MONITOR_ADDRESS] = '192.0.2.6'
member2_kwargs[const.MONITOR_PORT] = 8082
+
if self.lb_member_vip_subnet:
member3_kwargs[const.SUBNET_ID] = self.lb_member_vip_subnet[
const.ID]
@@ -931,7 +2712,7 @@
self.assertRaises(
exceptions.Forbidden,
self.os_primary.member_client.update_members,
- pool_id=self.pool_id, members_list=batch_update_list)
+ pool_id=pool_id, members_list=batch_update_list)
# Assert we didn't go into PENDING_*
member_check = self.mem_member_client.show_member(
@@ -970,8 +2751,179 @@
self.assertEqual(member2_name_update, members[0][const.NAME])
self.assertEqual(member3_name, members[1][const.NAME])
+ @decorators.idempotent_id('8b6574a3-17e8-4950-b24e-66d0c28960d3')
+ def test_HTTP_LC_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('a122557b-4824-4a4f-87f0-6ba5c9ca1e32')
+ def test_HTTPS_LC_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('069b8558-138f-4d6c-a3ec-9e803d5e2a14')
+ def test_PROXY_LC_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('9b2a08cf-c9ae-4f8a-a15c-2acab09a7613')
+ def test_TCP_LC_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('5824438d-cda2-4cea-a7d0-e7f5e5a11cac')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_LC_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ self._test_member_delete(pool_id)
+
@decorators.idempotent_id('f129ba5e-a16e-4178-924f-6a9c5b8b1589')
- def test_member_delete(self):
+ def test_HTTP_RR_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('f961105a-9874-4765-b457-3de9f342e226')
+ def test_HTTPS_RR_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('6bca4760-bfb4-4cee-b77f-a77abec3e38e')
+ def test_PROXY_RR_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('f0f5a651-f7f0-40d7-a051-32da07c28252')
+ def test_TCP_RR_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('03424069-302d-4020-996c-0a346a97c847')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_RR_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('87d0eac7-e391-4633-88cb-e691eeeab4fc')
+ def test_HTTP_SI_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('a919aa78-5221-4321-aa26-fcd3432d843c')
+ def test_HTTPS_SI_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('92368eef-d9ce-47d9-b3f2-7624601010a0')
+ def test_PROXY_SI_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('1631c730-f34a-4ae7-91eb-5f5b5052cb55')
+ def test_TCP_SI_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('8e05deee-f385-44d8-a112-2649aeea6006')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_SI_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('1c9f9dc5-4ba3-44cd-a840-fd0629abfddd')
+ def test_HTTP_SIP_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTP, pool_protocol=const.HTTP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('93ef7ac1-da00-420d-a367-22e86d968e1c')
+ def test_HTTPS_SIP_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.HTTPS, pool_protocol=const.HTTPS,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('e83b9389-768f-4bcf-a650-17af01243d2b')
+ def test_PROXY_SIP_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.PROXY,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('eca3d41d-21bd-4547-b8b8-8f87867eb4ad')
+ def test_TCP_SIP_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.TCP, pool_protocol=const.TCP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_delete(pool_id)
+
+ @decorators.idempotent_id('23788358-ac5f-46c4-922a-164e6a13fe0d')
+ # Skipping test for amphora driver until "UDP load balancers cannot mix
+ # protocol versions" (https://storyboard.openstack.org/#!/story/2003329) is
+ # fixed
+ @decorators.skip_because(
+ bug='2003329',
+ bug_type='storyboard',
+ condition=(CONF.load_balancer.provider in const.AMPHORA_PROVIDERS and
+ CONF.load_balancer.test_with_ipv6))
+ def test_UDP_SIP_member_delete(self):
+ pool_id = self._listener_pool_create(
+ listener_protocol=const.UDP, pool_protocol=const.UDP,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ self._test_member_delete(pool_id)
+
+ def _test_member_delete(self, pool_id):
"""Tests member create and delete APIs.
* Creates a member.
@@ -981,15 +2933,15 @@
"""
member_name = data_utils.rand_name("lb_member_member1-delete")
member_kwargs = {
- const.POOL_ID: self.pool_id,
+ const.POOL_ID: pool_id,
const.NAME: member_name,
const.ADDRESS: '192.0.2.1',
- const.PROTOCOL_PORT: 83,
+ const.PROTOCOL_PORT: self.member_port.increment(),
}
member = self.mem_member_client.create_member(**member_kwargs)
self.addClassResourceCleanup(
self.mem_member_client.cleanup_member,
- member[const.ID], pool_id=self.pool_id,
+ member[const.ID], pool_id=pool_id,
lb_client=self.mem_lb_client, lb_id=self.lb_id)
waiters.wait_for_status(
@@ -1005,7 +2957,7 @@
self.assertRaises(
exceptions.Forbidden,
self.os_primary.member_client.delete_member,
- member[const.ID], pool_id=self.pool_id)
+ member[const.ID], pool_id=pool_id)
# Test that a different user, with the load balancer member role
# cannot delete this member
@@ -1013,17 +2965,17 @@
member2_client = self.os_roles_lb_member2.member_client
self.assertRaises(exceptions.Forbidden,
member2_client.delete_member,
- member[const.ID], pool_id=self.pool_id)
+ member[const.ID], pool_id=pool_id)
self.mem_member_client.delete_member(member[const.ID],
- pool_id=self.pool_id)
+ pool_id=pool_id)
waiters.wait_for_deleted_status_or_not_found(
self.mem_member_client.show_member, member[const.ID],
const.PROVISIONING_STATUS,
CONF.load_balancer.check_interval,
CONF.load_balancer.check_timeout,
- pool_id=self.pool_id)
+ pool_id=pool_id)
waiters.wait_for_status(
self.mem_lb_client.show_loadbalancer,
diff --git a/octavia_tempest_plugin/tests/api/v2/test_pool.py b/octavia_tempest_plugin/tests/api/v2/test_pool.py
index 88e0119..5567fd7 100644
--- a/octavia_tempest_plugin/tests/api/v2/test_pool.py
+++ b/octavia_tempest_plugin/tests/api/v2/test_pool.py
@@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
+import testtools
import time
from uuid import UUID
@@ -40,10 +41,6 @@
lb_kwargs = {const.PROVIDER: CONF.load_balancer.provider,
const.NAME: lb_name}
cls._setup_lb_network_kwargs(lb_kwargs)
- cls.protocol = const.HTTP
- cls.lb_feature_enabled = CONF.loadbalancer_feature_enabled
- if not cls.lb_feature_enabled.l7_protocol_enabled:
- cls.protocol = cls.lb_feature_enabled.l4_protocol
lb = cls.mem_lb_client.create_loadbalancer(**lb_kwargs)
cls.lb_id = lb[const.ID]
@@ -57,35 +54,285 @@
CONF.load_balancer.lb_build_interval,
CONF.load_balancer.lb_build_timeout)
- listener_name = data_utils.rand_name("lb_member_listener1_pool")
- listener_kwargs = {
- const.NAME: listener_name,
- const.PROTOCOL: cls.protocol,
- const.PROTOCOL_PORT: '80',
- const.LOADBALANCER_ID: cls.lb_id,
- }
- listener = cls.mem_listener_client.create_listener(**listener_kwargs)
- cls.listener_id = listener[const.ID]
- cls.addClassResourceCleanup(
- cls.mem_listener_client.cleanup_listener,
- cls.listener_id,
- lb_client=cls.mem_lb_client, lb_id=cls.lb_id)
+ # Pool with Least Connections algorithm
+ @decorators.idempotent_id('29f1a69d-6a0d-4a85-b178-f50f5b4bdfbc')
+ def test_HTTP_LC_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.HTTP, protocol_port=10,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
- waiters.wait_for_status(cls.mem_lb_client.show_loadbalancer,
- cls.lb_id, const.PROVISIONING_STATUS,
- const.ACTIVE,
- CONF.load_balancer.build_interval,
- CONF.load_balancer.build_timeout)
+ @decorators.idempotent_id('5086402a-2339-4238-bddb-d30508e6cc53')
+ def test_HTTP_LC_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.HTTP,
+ pool_protocol=const.HTTP, protocol_port=11,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+ @decorators.idempotent_id('eb84fabc-68e6-44f7-955d-4919f045cd08')
+ def test_HTTPS_LC_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.HTTPS, protocol_port=12,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('664fc4d3-70d9-41c5-b3f8-c006726062ae')
+ def test_HTTPS_LC_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.HTTPS,
+ pool_protocol=const.HTTPS, protocol_port=13,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('08e35f78-a85d-48d2-8ac3-14c5e68b64f7')
+ def test_PROXY_LC_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.PROXY, protocol_port=14,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('044f460b-47ec-4e97-96be-c7ab812bfa16')
+ def test_PROXY_LC_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.TCP,
+ pool_protocol=const.PROXY, protocol_port=15,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('8f552da6-38f8-44b8-b69b-072cc1e232a6')
+ def test_TCP_LC_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.TCP, protocol_port=16,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('728b974f-ff59-479b-ada5-de280bbaaf02')
+ def test_TCP_LC_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.TCP,
+ pool_protocol=const.TCP, protocol_port=17,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('0cb032d9-e092-476e-9aaf-463eea58fc16')
+ def test_UDP_LC_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.UDP, protocol_port=18,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('9bf3bb05-ee36-47f3-b669-78f06a94035d')
+ def test_UDP_LC_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.UDP,
+ pool_protocol=const.UDP, protocol_port=19,
+ algorithm=const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ # Pool with Round Robin algorithm
@decorators.idempotent_id('7587fe48-87ba-4538-9f03-190911f100ff')
- def test_pool_create_standalone(self):
- self._test_pool_create(has_listener=False)
+ def test_HTTP_RR_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.HTTP, protocol_port=20,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
@decorators.idempotent_id('c9c0df79-f07e-428c-ae57-b9d4078eec79')
- def test_pool_create_with_listener(self):
- self._test_pool_create(has_listener=True)
+ def test_HTTP_RR_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.HTTP,
+ pool_protocol=const.HTTP, protocol_port=21,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
- def _test_pool_create(self, has_listener):
+ @decorators.idempotent_id('cc940a8b-b21c-46f5-9976-d2c8dd73b626')
+ def test_HTTPS_RR_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.HTTPS, protocol_port=22,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('10df2793-63b2-42a3-a5d0-9241a9d700a3')
+ def test_HTTPS_RR_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.HTTPS,
+ pool_protocol=const.HTTPS, protocol_port=23,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('4d6c124e-73ea-4b32-bd1c-3ff7be2c4e55')
+ def test_PROXY_RR_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.PROXY, protocol_port=24,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('60406086-b0a9-4f55-8f64-df161981443c')
+ def test_PROXY_RR_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.TCP,
+ pool_protocol=const.PROXY, protocol_port=25,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('41a5f22e-80e8-4d85-bfd6-2726846ed2ce')
+ def test_TCP_RR_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.TCP, protocol_port=26,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('b76432ae-1aa2-4048-b326-1cbda28415ac')
+ def test_TCP_RR_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.TCP,
+ pool_protocol=const.TCP, protocol_port=27,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('c09be35d-8a8b-4abd-8752-2cb4d7d7fab2')
+ def test_UDP_RR_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.UDP, protocol_port=28,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('4fb59ed9-5c44-437e-a5f9-bb01b9ba6a72')
+ def test_UDP_RR_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.UDP,
+ pool_protocol=const.UDP, protocol_port=29,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN)
+
+ # Pool with Source IP algorithm
+ @decorators.idempotent_id('a8b1b41c-5c3c-4c17-a2d4-b7c344520e3d')
+ def test_HTTP_SI_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.HTTP, protocol_port=30,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('0136341c-4622-4f65-a59d-b9983331d627')
+ def test_HTTP_SI_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.HTTP,
+ pool_protocol=const.HTTP, protocol_port=31,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('d69c5e0b-43b5-4afe-a94a-1a4f93e44a93')
+ def test_HTTPS_SI_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.HTTPS, protocol_port=32,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('04cc43f2-9eab-4552-b8c1-cea9e1325696')
+ def test_HTTPS_SI_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.HTTPS,
+ pool_protocol=const.HTTPS, protocol_port=33,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('cc42779d-71f8-4a7c-8217-02127be344ce')
+ def test_PROXY_SI_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.PROXY, protocol_port=34,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('c845d8d3-30d7-42c3-8943-9a4582c62e2d')
+ def test_PROXY_SI_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.TCP,
+ pool_protocol=const.PROXY, protocol_port=35,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('869b4208-5821-44f5-acf6-4f087c4dd79c')
+ def test_TCP_SI_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.TCP, protocol_port=36,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('4b0be593-b2e4-4704-a347-c36dae76aaad')
+ def test_TCP_SI_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.TCP,
+ pool_protocol=const.TCP, protocol_port=37,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('47af95cb-685a-48de-9d17-66108cdfd3fa')
+ def test_UDP_SI_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.UDP, protocol_port=38,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('0115ab0c-e8fd-434a-9448-7fba55a8f27d')
+ def test_UDP_SI_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.UDP,
+ pool_protocol=const.UDP, protocol_port=39,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP)
+
+ # Pool with Source IP Port algorithm
+ @decorators.idempotent_id('265ba978-a528-429c-9ef7-c36373ee2225')
+ def test_HTTP_SIP_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.HTTP, protocol_port=40,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('a07e2ff0-90f3-43d3-a7ec-5ca93b7f29bf')
+ def test_HTTP_SIP_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.HTTP,
+ pool_protocol=const.HTTP, protocol_port=41,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('7da08af5-e225-46df-b0b4-a5f1834a5377')
+ def test_HTTPS_SIP_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.HTTPS, protocol_port=42,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('3d52a82e-e488-445a-8599-87e9bb7153eb')
+ def test_HTTPS_SIP_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.HTTPS,
+ pool_protocol=const.HTTPS, protocol_port=43,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('ad4cb862-fa37-4874-99c1-511cdcd86f91')
+ def test_PROXY_SIP_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.PROXY, protocol_port=44,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('bcf76f26-e801-4ab4-b338-b210457d592e')
+ def test_PROXY_SIP_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.TCP,
+ pool_protocol=const.PROXY, protocol_port=45,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('42382080-7fd5-46d7-afd7-d47c880f0397')
+ def test_TCP_SIP_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.TCP, protocol_port=46,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('53687dd3-e076-4e93-b917-93c76a160444')
+ def test_TCP_SIP_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.TCP,
+ pool_protocol=const.TCP, protocol_port=47,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('02d40127-d46e-4aba-8428-96f6deff3554')
+ def test_UDP_SIP_pool_standalone_create(self):
+ self._test_pool_create(listener_protocol=None,
+ pool_protocol=const.UDP, protocol_port=48,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('5f1acd3e-305d-40d5-81e9-fe6250411d49')
+ def test_UDP_SIP_pool_with_listener_create(self):
+ self._test_pool_create(listener_protocol=const.UDP,
+ pool_protocol=const.UDP, protocol_port=49,
+ algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ # Test with session persistence
+ @decorators.idempotent_id('c8b84032-1c20-4d85-9db2-2fe5b9eff37a')
+ def test_HTTP_RR_app_cookie_pool_with_listener_create(self):
+ self._test_pool_create(
+ listener_protocol=const.HTTP,
+ pool_protocol=const.HTTP, protocol_port=50,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN,
+ session_persistence=const.SESSION_PERSISTENCE_APP_COOKIE)
+
+ @decorators.idempotent_id('0296cccb-83be-425c-ac6a-828774734d5a')
+ def test_HTTP_RR_http_cookie_pool_with_listener_create(self):
+ self._test_pool_create(
+ listener_protocol=const.HTTP,
+ pool_protocol=const.HTTP, protocol_port=51,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN,
+ session_persistence=const.SESSION_PERSISTENCE_HTTP_COOKIE)
+
+ @decorators.idempotent_id('882263e6-d50f-47b4-9083-f76c2b92eef0')
+ def test_HTTP_RR_source_IP_pool_with_listener_create(self):
+ self._test_pool_create(
+ listener_protocol=const.HTTP,
+ pool_protocol=const.HTTP, protocol_port=52,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN,
+ session_persistence=const.SESSION_PERSISTENCE_SOURCE_IP)
+
+ @decorators.idempotent_id('1d5eed30-86bf-4bf4-87d0-22adee3defa1')
+ def test_UDP_RR_source_ip_pool_with_listener_create(self):
+ self._test_pool_create(
+ listener_protocol=const.UDP,
+ pool_protocol=const.UDP, protocol_port=53,
+ algorithm=const.LB_ALGORITHM_ROUND_ROBIN,
+ session_persistence=const.SESSION_PERSISTENCE_SOURCE_IP)
+
+ def _test_pool_create(self, listener_protocol, pool_protocol,
+ protocol_port, algorithm, session_persistence=None):
"""Tests pool create and basic show APIs.
* Tests that users without the loadbalancer member role cannot
@@ -94,6 +341,34 @@
* Show pool details.
* Validate the show reflects the requested values.
"""
+ if (algorithm == const.LB_ALGORITHM_SOURCE_IP_PORT and not
+ self.mem_listener_client.is_version_supported(
+ self.api_version, '2.13')):
+ raise testtools.TestCase.skipException(
+ 'Skipping this test as load balancing algorithm '
+ 'SOURCE_IP_PORT requires API version 2.13 or newer.')
+
+ if listener_protocol is not None:
+ listener_name = data_utils.rand_name("lb_member_listener1_pool")
+ listener_kwargs = {
+ const.NAME: listener_name,
+ const.PROTOCOL: listener_protocol,
+ const.PROTOCOL_PORT: protocol_port,
+ const.LOADBALANCER_ID: self.lb_id,
+ }
+ listener = self.mem_listener_client.create_listener(
+ **listener_kwargs)
+ self.addClassResourceCleanup(
+ self.mem_listener_client.cleanup_listener,
+ listener[const.ID],
+ lb_client=self.mem_lb_client, lb_id=self.lb_id)
+
+ waiters.wait_for_status(self.mem_lb_client.show_loadbalancer,
+ self.lb_id, const.PROVISIONING_STATUS,
+ const.ACTIVE,
+ CONF.load_balancer.build_interval,
+ CONF.load_balancer.build_timeout)
+
pool_name = data_utils.rand_name("lb_member_pool1-create")
pool_description = data_utils.arbitrary_string(size=255)
pool_sp_cookie_name = 'my_cookie'
@@ -101,8 +376,8 @@
const.NAME: pool_name,
const.DESCRIPTION: pool_description,
const.ADMIN_STATE_UP: True,
- const.PROTOCOL: self.protocol,
- const.LB_ALGORITHM: self.lb_algorithm,
+ const.PROTOCOL: pool_protocol,
+ const.LB_ALGORITHM: algorithm,
}
if self.mem_lb_client.is_version_supported(self.api_version, '2.5'):
@@ -111,14 +386,22 @@
const.TAGS: pool_tags
})
- if self.lb_feature_enabled.session_persistence_enabled:
+ if session_persistence == const.SESSION_PERSISTENCE_APP_COOKIE:
pool_kwargs[const.SESSION_PERSISTENCE] = {
const.TYPE: const.SESSION_PERSISTENCE_APP_COOKIE,
- const.COOKIE_NAME: pool_sp_cookie_name,
+ const.COOKIE_NAME: pool_sp_cookie_name
+ }
+ elif session_persistence == const.SESSION_PERSISTENCE_HTTP_COOKIE:
+ pool_kwargs[const.SESSION_PERSISTENCE] = {
+ const.TYPE: const.SESSION_PERSISTENCE_HTTP_COOKIE
+ }
+ elif session_persistence == const.SESSION_PERSISTENCE_SOURCE_IP:
+ pool_kwargs[const.SESSION_PERSISTENCE] = {
+ const.TYPE: const.SESSION_PERSISTENCE_SOURCE_IP
}
- if has_listener:
- pool_kwargs[const.LISTENER_ID] = self.listener_id
+ if listener_protocol is not None:
+ pool_kwargs[const.LISTENER_ID] = listener[const.ID]
else:
pool_kwargs[const.LOADBALANCER_ID] = self.lb_id
@@ -130,7 +413,21 @@
self.os_primary.pool_client.create_pool,
**pool_kwargs)
- pool = self.mem_pool_client.create_pool(**pool_kwargs)
+ # This is a special case as the reference driver does not support
+ # SOURCE-IP-PORT. Since it runs with not_implemented_is_error, we must
+ # handle this test case special.
+ try:
+ pool = self.mem_pool_client.create_pool(**pool_kwargs)
+ except exceptions.NotImplemented as e:
+ if algorithm != const.LB_ALGORITHM_SOURCE_IP_PORT:
+ raise
+ message = ("The configured provider driver '{driver}' "
+ "does not support a feature required for this "
+ "test.".format(driver=CONF.load_balancer.provider))
+ if hasattr(e, 'resp_body'):
+ message = e.resp_body.get('faultstring', message)
+ raise testtools.TestCase.skipException(message)
+
self.addClassResourceCleanup(
self.mem_pool_client.cleanup_pool,
pool[const.ID],
@@ -147,7 +444,8 @@
const.ACTIVE,
CONF.load_balancer.build_interval,
CONF.load_balancer.build_timeout)
- if has_listener and not CONF.load_balancer.test_with_noop:
+ if (listener_protocol is not None and
+ not CONF.load_balancer.test_with_noop):
pool = waiters.wait_for_status(
self.mem_pool_client.show_pool,
pool[const.ID], const.OPERATING_STATUS,
@@ -162,36 +460,125 @@
parser.parse(pool[const.UPDATED_AT])
UUID(pool[const.ID])
# Operating status for a pool without members will be:
- if has_listener and not CONF.load_balancer.test_with_noop:
+ if (listener_protocol is not None and
+ not CONF.load_balancer.test_with_noop):
# ONLINE if it is attached to a listener and is a live test
self.assertEqual(const.ONLINE, pool[const.OPERATING_STATUS])
else:
# OFFLINE if it is just on the LB directly or is in noop mode
self.assertEqual(const.OFFLINE, pool[const.OPERATING_STATUS])
- self.assertEqual(self.protocol, pool[const.PROTOCOL])
+ self.assertEqual(pool_protocol, pool[const.PROTOCOL])
self.assertEqual(1, len(pool[const.LOADBALANCERS]))
self.assertEqual(self.lb_id, pool[const.LOADBALANCERS][0][const.ID])
- if has_listener:
+ if listener_protocol is not None:
self.assertEqual(1, len(pool[const.LISTENERS]))
- self.assertEqual(self.listener_id,
+ self.assertEqual(listener[const.ID],
pool[const.LISTENERS][0][const.ID])
else:
self.assertEmpty(pool[const.LISTENERS])
- self.assertEqual(self.lb_algorithm,
- pool[const.LB_ALGORITHM])
- if self.lb_feature_enabled.session_persistence_enabled:
+ self.assertEqual(algorithm, pool[const.LB_ALGORITHM])
+
+ if session_persistence == const.SESSION_PERSISTENCE_APP_COOKIE:
self.assertIsNotNone(pool.get(const.SESSION_PERSISTENCE))
self.assertEqual(const.SESSION_PERSISTENCE_APP_COOKIE,
pool[const.SESSION_PERSISTENCE][const.TYPE])
self.assertEqual(pool_sp_cookie_name,
pool[const.SESSION_PERSISTENCE][
const.COOKIE_NAME])
+ elif session_persistence == const.SESSION_PERSISTENCE_HTTP_COOKIE:
+ self.assertIsNotNone(pool.get(const.SESSION_PERSISTENCE))
+ self.assertEqual(const.SESSION_PERSISTENCE_HTTP_COOKIE,
+ pool[const.SESSION_PERSISTENCE][const.TYPE])
+ elif session_persistence == const.SESSION_PERSISTENCE_SOURCE_IP:
+ self.assertIsNotNone(pool.get(const.SESSION_PERSISTENCE))
+ self.assertEqual(const.SESSION_PERSISTENCE_SOURCE_IP,
+ pool[const.SESSION_PERSISTENCE][const.TYPE])
+
if self.mem_lb_client.is_version_supported(self.api_version, '2.5'):
self.assertCountEqual(pool_kwargs[const.TAGS],
pool[const.TAGS])
+ @decorators.idempotent_id('4b4c8021-f4dd-4826-b825-7e3dc0beaba4')
+ def test_HTTP_LC_pool_list(self):
+ self._test_pool_list(const.HTTP, const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
@decorators.idempotent_id('6959a32e-fb34-4f3e-be68-8880c6450016')
- def test_pool_list(self):
+ def test_HTTP_RR_pool_list(self):
+ self._test_pool_list(const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('b2cb9879-c1b3-491a-bd20-773bc57625b0')
+ def test_HTTP_SI_pool_list(self):
+ self._test_pool_list(const.HTTP, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('871b5a7f-c8f3-4d05-9533-f9498e2465fa')
+ def test_HTTP_SIP_pool_list(self):
+ self._test_pool_list(const.HTTP, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('8ace3b65-7183-4b55-837d-3e7f438ea079')
+ def test_HTTPS_LC_pool_list(self):
+ self._test_pool_list(const.HTTPS, const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('7e01fa71-34fd-42e6-9db8-4b2a57cda38d')
+ def test_HTTPS_RR_pool_list(self):
+ self._test_pool_list(const.HTTPS, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('25d4b0d2-ab46-40ad-afec-1b0afa88a559')
+ def test_HTTPS_SI_pool_list(self):
+ self._test_pool_list(const.HTTPS, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('250e6bf6-5017-47c9-ae12-1e64515d3bfd')
+ def test_HTTPS_SIP_pool_list(self):
+ self._test_pool_list(const.HTTPS, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('f3f3565e-a6b3-4541-9fb3-d9900231771b')
+ def test_PROXY_LC_pool_list(self):
+ self._test_pool_list(const.PROXY, const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('fb267dae-b4e3-4858-a85e-72ecb1d91eff')
+ def test_PROXY_RR_pool_list(self):
+ self._test_pool_list(const.PROXY, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('42a3e3e3-ad71-418e-a262-628a213a7b03')
+ def test_PROXY_SI_pool_list(self):
+ self._test_pool_list(const.PROXY, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('69d3f811-6ce8-403e-bae9-745d51cb268a')
+ def test_PROXY_SIP_pool_list(self):
+ self._test_pool_list(const.PROXY, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('f3a74c0c-3083-44a5-9938-a245176babcd')
+ def test_TCP_LC_pool_list(self):
+ self._test_pool_list(const.TCP, const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('1a0b616f-ee77-4ac1-bb5f-300c2a10a7f2')
+ def test_TCP_RR_pool_list(self):
+ self._test_pool_list(const.TCP, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('ec0fda75-f2d7-4fa6-ba91-c5eb9a7e9874')
+ def test_TCP_SI_pool_list(self):
+ self._test_pool_list(const.TCP, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('8ca217d0-705f-4a7a-87c2-752bb1ee88f1')
+ def test_TCP_SIP_pool_list(self):
+ self._test_pool_list(const.TCP, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('ed26899d-a590-46fc-bf70-27c5a9c59cbf')
+ def test_UDP_LC_pool_list(self):
+ self._test_pool_list(const.UDP, const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('6fb6a6e3-ff65-4f2c-8876-2997d3903cfe')
+ def test_UDP_RR_pool_list(self):
+ self._test_pool_list(const.UDP, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('0bb02800-d7c9-4916-a532-ac1ac7b945d0')
+ def test_UDP_SI_pool_list(self):
+ self._test_pool_list(const.UDP, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('bdc7df5f-ffdb-48c8-823e-a3b5d76868a0')
+ def test_UDP_SIP_pool_list(self):
+ self._test_pool_list(const.UDP, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ def _test_pool_list(self, pool_protocol, algorithm):
"""Tests pool list API and field filtering.
* Create a clean loadbalancer.
@@ -205,6 +592,13 @@
* List the pools filtering to one of the three.
* List the pools filtered, one field, and sorted.
"""
+ if (algorithm == const.LB_ALGORITHM_SOURCE_IP_PORT and not
+ self.mem_listener_client.is_version_supported(
+ self.api_version, '2.13')):
+ raise testtools.TestCase.skipException(
+ 'Skipping this test as load balancing algorithm '
+ 'SOURCE_IP_PORT requires API version 2.13 or newer.')
+
lb_name = data_utils.rand_name("lb_member_lb2_pool-list")
lb = self.mem_lb_client.create_loadbalancer(
name=lb_name, provider=CONF.load_balancer.provider,
@@ -223,13 +617,12 @@
pool1_name = data_utils.rand_name("lb_member_pool2-list")
pool1_desc = 'B'
- pool1_sp_cookie_name = 'my_cookie1'
pool1_kwargs = {
const.NAME: pool1_name,
const.DESCRIPTION: pool1_desc,
const.ADMIN_STATE_UP: True,
- const.PROTOCOL: self.protocol,
- const.LB_ALGORITHM: self.lb_algorithm,
+ const.PROTOCOL: pool_protocol,
+ const.LB_ALGORITHM: algorithm,
const.LOADBALANCER_ID: lb_id,
}
@@ -239,13 +632,21 @@
"Marketing", "Creativity"]
pool1_kwargs.update({const.TAGS: pool1_tags})
- if self.lb_feature_enabled.session_persistence_enabled:
- pool1_kwargs[const.SESSION_PERSISTENCE] = {
- const.TYPE: const.SESSION_PERSISTENCE_APP_COOKIE,
- const.COOKIE_NAME: pool1_sp_cookie_name,
- }
- pool1 = self.mem_pool_client.create_pool(
- **pool1_kwargs)
+ # This is a special case as the reference driver does not support
+ # SOURCE-IP-PORT. Since it runs with not_implemented_is_error, we must
+ # handle this test case special.
+ try:
+ pool1 = self.mem_pool_client.create_pool(**pool1_kwargs)
+ except exceptions.NotImplemented as e:
+ if algorithm != const.LB_ALGORITHM_SOURCE_IP_PORT:
+ raise
+ message = ("The configured provider driver '{driver}' "
+ "does not support a feature required for this "
+ "test.".format(driver=CONF.load_balancer.provider))
+ if hasattr(e, 'resp_body'):
+ message = e.resp_body.get('faultstring', message)
+ raise testtools.TestCase.skipException(message)
+
self.addCleanup(
self.mem_pool_client.cleanup_pool,
pool1[const.ID],
@@ -268,13 +669,12 @@
pool2_name = data_utils.rand_name("lb_member_pool1-list")
pool2_desc = 'A'
- pool2_sp_cookie_name = 'my_cookie2'
pool2_kwargs = {
const.NAME: pool2_name,
const.DESCRIPTION: pool2_desc,
const.ADMIN_STATE_UP: True,
- const.PROTOCOL: self.protocol,
- const.LB_ALGORITHM: self.lb_algorithm,
+ const.PROTOCOL: pool_protocol,
+ const.LB_ALGORITHM: algorithm,
const.LOADBALANCER_ID: lb_id,
}
@@ -284,11 +684,6 @@
"Soft_skills", "Creativity"]
pool2_kwargs.update({const.TAGS: pool2_tags})
- if self.lb_feature_enabled.session_persistence_enabled:
- pool2_kwargs[const.SESSION_PERSISTENCE] = {
- const.TYPE: const.SESSION_PERSISTENCE_APP_COOKIE,
- const.COOKIE_NAME: pool2_sp_cookie_name,
- }
pool2 = self.mem_pool_client.create_pool(
**pool2_kwargs)
self.addCleanup(
@@ -317,9 +712,8 @@
const.NAME: pool3_name,
const.DESCRIPTION: pool3_desc,
const.ADMIN_STATE_UP: False,
- const.PROTOCOL: self.protocol,
- const.LB_ALGORITHM: self.lb_algorithm,
- # No session persistence, just so there's one test for that
+ const.PROTOCOL: pool_protocol,
+ const.LB_ALGORITHM: algorithm,
const.LOADBALANCER_ID: lb_id,
}
@@ -471,8 +865,113 @@
self.assertTrue(not any(["" in pool[const.TAGS]
for pool in list_of_pools]))
+ @decorators.idempotent_id('416c72c6-ef63-4e70-b27e-3ed95b93c02d')
+ def test_HTTP_LC_pool_show(self):
+ self._test_pool_show(const.HTTP, const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('82568809-bdb9-444b-9790-128d0c328d72')
+ def test_HTTPS_LC_pool_show(self):
+ self._test_pool_show(const.HTTPS, const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('93e4bc67-ce12-43fb-a50d-97de47c3a63f')
+ def test_PROXY_LC_pool_show(self):
+ self._test_pool_show(const.PROXY, const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('ee910c1e-1704-4b41-99c1-0c1f904e577d')
+ def test_TCP_LC_pool_show(self):
+ self._test_pool_show(const.TCP, const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('5f4339f6-0387-44f4-a5f9-e385d44b5ee2')
+ def test_UDP_LC_pool_show(self):
+ self._test_pool_show(const.UDP, const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
@decorators.idempotent_id('b7932438-1aea-4175-a50c-984fee1c0cad')
- def test_pool_show(self):
+ def test_HTTP_RR_pool_show(self):
+ self._test_pool_show(const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('a1bffe2f-ce20-4d79-a168-bc930de5edcb')
+ def test_HTTPS_RR_pool_show(self):
+ self._test_pool_show(const.HTTPS, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('4cf9fa5c-d8e0-4253-8b79-2eb59e066772')
+ def test_PROXY_RR_pool_show(self):
+ self._test_pool_show(const.PROXY, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('e6e91bb3-76b3-4ff8-ad60-d20ac1e64381')
+ def test_TCP_RR_pool_show(self):
+ self._test_pool_show(const.TCP, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('7c4a1c90-7fc2-42ee-ad78-d7c75b5a56d2')
+ def test_UDP_RR_pool_show(self):
+ self._test_pool_show(const.UDP, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('af1c1b10-a6ac-4f28-82ba-2c0770903a5c')
+ def test_HTTP_SI_pool_show(self):
+ self._test_pool_show(const.HTTP, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('64434a6d-222e-4056-bcc0-335ebe4f03ee')
+ def test_HTTPS_SI_pool_show(self):
+ self._test_pool_show(const.HTTPS, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('adbb7f3b-7a37-4a8e-a2b4-c3f827dad0ba')
+ def test_PROXY_SI_pool_show(self):
+ self._test_pool_show(const.PROXY, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('55f62d1a-33b0-4263-84af-672a30ee52bd')
+ def test_TCP_SI_pool_show(self):
+ self._test_pool_show(const.TCP, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('5b961eee-183d-435c-bdf5-b83ca68c4944')
+ def test_UDP_SI_pool_show(self):
+ self._test_pool_show(const.UDP, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('59964666-3dfe-4bad-81e0-bc5a4809c10c')
+ def test_HTTP_SIP_pool_show(self):
+ self._test_pool_show(const.HTTP, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('9f8f855c-cd09-4a74-b5f2-c5c13b59422e')
+ def test_HTTPS_SIP_pool_show(self):
+ self._test_pool_show(const.HTTPS, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('1194bd18-20bc-43e7-b588-9f78a72e0021')
+ def test_PROXY_SIP_pool_show(self):
+ self._test_pool_show(const.PROXY, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('6003cbe8-73a5-416a-9be0-7aa5699dc157')
+ def test_TCP_SIP_pool_show(self):
+ self._test_pool_show(const.TCP, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('1400529e-3a0c-4bac-b6ed-669fdd723956')
+ def test_UDP_SIP_pool_show(self):
+ self._test_pool_show(const.UDP, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ # Test with session persistence
+ @decorators.idempotent_id('6fa12ae6-a61a-43d0-85d7-5367811c9c5a')
+ def test_HTTP_RR_app_cookie_pool_show(self):
+ self._test_pool_show(
+ const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN,
+ session_persistence=const.SESSION_PERSISTENCE_APP_COOKIE)
+
+ @decorators.idempotent_id('4a1b6e2c-c216-4589-9ab6-2cd63217f06a')
+ def test_HTTP_RR_http_cookie_pool_show(self):
+ self._test_pool_show(
+ const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN,
+ session_persistence=const.SESSION_PERSISTENCE_HTTP_COOKIE)
+
+ @decorators.idempotent_id('373f1c80-e51e-4260-b8d8-f6aeb512f81c')
+ def test_HTTP_RR_source_IP_pool_show(self):
+ self._test_pool_show(
+ const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN,
+ session_persistence=const.SESSION_PERSISTENCE_SOURCE_IP)
+
+ @decorators.idempotent_id('bd732c36-bdaa-4591-bf4e-28268874d22c')
+ def test_UDP_RR_source_IP_pool_show(self):
+ self._test_pool_show(
+ const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN,
+ session_persistence=const.SESSION_PERSISTENCE_SOURCE_IP)
+
+ def _test_pool_show(self, pool_protocol, algorithm,
+ session_persistence=None):
"""Tests pool show API.
* Create a fully populated pool.
@@ -480,6 +979,13 @@
* Validate the show reflects the requested values.
* Validates that other accounts cannot see the pool.
"""
+ if (algorithm == const.LB_ALGORITHM_SOURCE_IP_PORT and not
+ self.mem_listener_client.is_version_supported(
+ self.api_version, '2.13')):
+ raise testtools.TestCase.skipException(
+ 'Skipping this test as load balancing algorithm '
+ 'SOURCE_IP_PORT requires API version 2.13 or newer.')
+
pool_name = data_utils.rand_name("lb_member_pool1-show")
pool_description = data_utils.arbitrary_string(size=255)
pool_sp_cookie_name = 'my_cookie'
@@ -487,17 +993,40 @@
const.NAME: pool_name,
const.DESCRIPTION: pool_description,
const.ADMIN_STATE_UP: True,
- const.PROTOCOL: self.protocol,
- const.LB_ALGORITHM: self.lb_algorithm,
+ const.PROTOCOL: pool_protocol,
+ const.LB_ALGORITHM: algorithm,
const.LOADBALANCER_ID: self.lb_id,
}
- if self.lb_feature_enabled.session_persistence_enabled:
+
+ if session_persistence == const.SESSION_PERSISTENCE_APP_COOKIE:
pool_kwargs[const.SESSION_PERSISTENCE] = {
const.TYPE: const.SESSION_PERSISTENCE_APP_COOKIE,
- const.COOKIE_NAME: pool_sp_cookie_name,
+ const.COOKIE_NAME: pool_sp_cookie_name
+ }
+ elif session_persistence == const.SESSION_PERSISTENCE_HTTP_COOKIE:
+ pool_kwargs[const.SESSION_PERSISTENCE] = {
+ const.TYPE: const.SESSION_PERSISTENCE_HTTP_COOKIE
+ }
+ elif session_persistence == const.SESSION_PERSISTENCE_SOURCE_IP:
+ pool_kwargs[const.SESSION_PERSISTENCE] = {
+ const.TYPE: const.SESSION_PERSISTENCE_SOURCE_IP
}
- pool = self.mem_pool_client.create_pool(**pool_kwargs)
+ # This is a special case as the reference driver does not support
+ # SOURCE-IP-PORT. Since it runs with not_implemented_is_error, we must
+ # handle this test case special.
+ try:
+ pool = self.mem_pool_client.create_pool(**pool_kwargs)
+ except exceptions.NotImplemented as e:
+ if algorithm != const.LB_ALGORITHM_SOURCE_IP_PORT:
+ raise
+ message = ("The configured provider driver '{driver}' "
+ "does not support a feature required for this "
+ "test.".format(driver=CONF.load_balancer.provider))
+ if hasattr(e, 'resp_body'):
+ message = e.resp_body.get('faultstring', message)
+ raise testtools.TestCase.skipException(message)
+
self.addClassResourceCleanup(
self.mem_pool_client.cleanup_pool,
pool[const.ID],
@@ -523,19 +1052,27 @@
UUID(pool[const.ID])
# Operating status for pools will always be offline without members
self.assertEqual(const.OFFLINE, pool[const.OPERATING_STATUS])
- self.assertEqual(self.protocol, pool[const.PROTOCOL])
+ self.assertEqual(pool_protocol, pool[const.PROTOCOL])
self.assertEqual(1, len(pool[const.LOADBALANCERS]))
self.assertEqual(self.lb_id, pool[const.LOADBALANCERS][0][const.ID])
self.assertEmpty(pool[const.LISTENERS])
- self.assertEqual(self.lb_algorithm,
- pool[const.LB_ALGORITHM])
- if self.lb_feature_enabled.session_persistence_enabled:
+ self.assertEqual(algorithm, pool[const.LB_ALGORITHM])
+
+ if session_persistence == const.SESSION_PERSISTENCE_APP_COOKIE:
self.assertIsNotNone(pool.get(const.SESSION_PERSISTENCE))
self.assertEqual(const.SESSION_PERSISTENCE_APP_COOKIE,
pool[const.SESSION_PERSISTENCE][const.TYPE])
self.assertEqual(pool_sp_cookie_name,
pool[const.SESSION_PERSISTENCE][
const.COOKIE_NAME])
+ elif session_persistence == const.SESSION_PERSISTENCE_HTTP_COOKIE:
+ self.assertIsNotNone(pool.get(const.SESSION_PERSISTENCE))
+ self.assertEqual(const.SESSION_PERSISTENCE_HTTP_COOKIE,
+ pool[const.SESSION_PERSISTENCE][const.TYPE])
+ elif session_persistence == const.SESSION_PERSISTENCE_SOURCE_IP:
+ self.assertIsNotNone(pool.get(const.SESSION_PERSISTENCE))
+ self.assertEqual(const.SESSION_PERSISTENCE_SOURCE_IP,
+ pool[const.SESSION_PERSISTENCE][const.TYPE])
# Test that a user with lb_admin role can see the pool
if CONF.load_balancer.RBAC_test_type == const.ADVANCED:
@@ -565,8 +1102,116 @@
self.os_primary.pool_client.show_pool,
pool[const.ID])
+ @decorators.idempotent_id('d73755fe-ba3a-4248-9543-8e167a5aa7f4')
+ def test_HTTP_LC_pool_update(self):
+ self._test_pool_update(const.HTTP,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('ca641999-7817-4f8f-a58b-2ccd7a5dca97')
+ def test_HTTPS_LC_pool_update(self):
+ self._test_pool_update(const.HTTPS,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('67a2cbab-f4fc-41c8-93e8-97ddba39c1ab')
+ def test_PROXY_LC_pool_update(self):
+ self._test_pool_update(const.PROXY,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('c9f1ed23-f6d4-4d44-9d22-bdc1fbe5854d')
+ def test_TCP_LC_pool_update(self):
+ self._test_pool_update(const.TCP, const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('8e6b8802-c4a7-43eb-a4e8-9f6bf7899a7d')
+ def test_UDP_LC_pool_update(self):
+ self._test_pool_update(const.UDP, const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
@decorators.idempotent_id('7bd0a6bf-57b4-46a6-83ef-f9991896658a')
- def test_pool_update(self):
+ def test_HTTP_RR_pool_update(self):
+ self._test_pool_update(const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('ac097c2e-4f79-4714-8de4-517598d37919')
+ def test_HTTPS_RR_pool_update(self):
+ self._test_pool_update(const.HTTPS, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('4392bc21-c18e-4e25-bb7e-2c9e3777d784')
+ def test_PROXY_RR_pool_update(self):
+ self._test_pool_update(const.PROXY, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('f6a5970d-2f27-419b-a0ee-7a420ee7b396')
+ def test_TCP_RR_pool_update(self):
+ self._test_pool_update(const.TCP, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('a1cded67-9fd6-4155-8761-ce165d518b47')
+ def test_UDP_RR_pool_update(self):
+ self._test_pool_update(const.UDP, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('42a742d2-ef9c-47fd-8585-5588bb867431')
+ def test_HTTP_SI_pool_update(self):
+ self._test_pool_update(const.HTTP, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('3b4e6462-4e0c-4c05-bc30-d6f86f67bb60')
+ def test_HTTPS_SI_pool_update(self):
+ self._test_pool_update(const.HTTPS, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('d2cb7a0a-8268-46bc-a519-08474c42c4ca')
+ def test_PROXY_SI_pool_update(self):
+ self._test_pool_update(const.PROXY, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('84e63663-0bf7-45bc-a4d9-b3bbd664fd8c')
+ def test_TCP_SI_pool_update(self):
+ self._test_pool_update(const.TCP, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('cdb230b9-996a-4933-a7a2-a7b09465c18c')
+ def test_UDP_SI_pool_update(self):
+ self._test_pool_update(const.UDP, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('7c770af5-782e-453c-bd2e-41ec90b37907')
+ def test_HTTP_SIP_pool_update(self):
+ self._test_pool_update(const.HTTP, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('72cee49d-36d5-4b54-8883-8fe7be9fd0f0')
+ def test_HTTPS_SIP_pool_update(self):
+ self._test_pool_update(const.HTTPS, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('f269293c-b6fa-4fe2-82a6-57fc8ef89260')
+ def test_PROXY_SIP_pool_update(self):
+ self._test_pool_update(const.PROXY, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('f5445a86-247f-4075-8b71-e4e5415d0bed')
+ def test_TCP_SIP_pool_update(self):
+ self._test_pool_update(const.TCP, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('d9e1aeee-21c3-4b0f-9685-834768597607')
+ def test_UDP_SIP_pool_update(self):
+ self._test_pool_update(const.UDP, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ # Test with session persistence
+ @decorators.idempotent_id('8677a512-77e1-4af3-96f7-8a3d66725e08')
+ def test_HTTP_RR_app_cookie_pool_update(self):
+ self._test_pool_update(
+ const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN,
+ session_persistence=const.SESSION_PERSISTENCE_APP_COOKIE)
+
+ @decorators.idempotent_id('4d3b3a4a-a652-4dca-9a49-b14471ce5309')
+ def test_HTTP_RR_http_cookie_pool_update(self):
+ self._test_pool_update(
+ const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN,
+ session_persistence=const.SESSION_PERSISTENCE_HTTP_COOKIE)
+
+ @decorators.idempotent_id('2e7bbf67-ed32-4a3c-b5ae-1aff8b07bacc')
+ def test_HTTP_RR_source_IP_pool_update(self):
+ self._test_pool_update(
+ const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN,
+ session_persistence=const.SESSION_PERSISTENCE_SOURCE_IP)
+
+ @decorators.idempotent_id('28b90650-a612-4b10-981f-d3dd6a366e4f')
+ def test_UDP_RR_source_IP_pool_update(self):
+ self._test_pool_update(
+ const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN,
+ session_persistence=const.SESSION_PERSISTENCE_SOURCE_IP)
+
+ def _test_pool_update(self, pool_protocol, algorithm,
+ session_persistence=None):
"""Tests pool update and show APIs.
* Create a fully populated pool.
@@ -577,6 +1222,13 @@
* Show pool details.
* Validate the show reflects the updated values.
"""
+ if (algorithm == const.LB_ALGORITHM_SOURCE_IP_PORT and not
+ self.mem_listener_client.is_version_supported(
+ self.api_version, '2.13')):
+ raise testtools.TestCase.skipException(
+ 'Skipping this test as load balancing algorithm '
+ 'SOURCE_IP_PORT requires API version 2.13 or newer.')
+
pool_name = data_utils.rand_name("lb_member_pool1-update")
pool_description = data_utils.arbitrary_string(size=255)
pool_sp_cookie_name = 'my_cookie'
@@ -584,8 +1236,8 @@
const.NAME: pool_name,
const.DESCRIPTION: pool_description,
const.ADMIN_STATE_UP: False,
- const.PROTOCOL: self.protocol,
- const.LB_ALGORITHM: self.lb_algorithm,
+ const.PROTOCOL: pool_protocol,
+ const.LB_ALGORITHM: algorithm,
const.LOADBALANCER_ID: self.lb_id,
}
@@ -595,12 +1247,35 @@
const.TAGS: pool_tags
})
- if self.lb_feature_enabled.session_persistence_enabled:
+ if session_persistence == const.SESSION_PERSISTENCE_APP_COOKIE:
pool_kwargs[const.SESSION_PERSISTENCE] = {
const.TYPE: const.SESSION_PERSISTENCE_APP_COOKIE,
- const.COOKIE_NAME: pool_sp_cookie_name,
+ const.COOKIE_NAME: pool_sp_cookie_name
}
- pool = self.mem_pool_client.create_pool(**pool_kwargs)
+ elif session_persistence == const.SESSION_PERSISTENCE_HTTP_COOKIE:
+ pool_kwargs[const.SESSION_PERSISTENCE] = {
+ const.TYPE: const.SESSION_PERSISTENCE_HTTP_COOKIE
+ }
+ elif session_persistence == const.SESSION_PERSISTENCE_SOURCE_IP:
+ pool_kwargs[const.SESSION_PERSISTENCE] = {
+ const.TYPE: const.SESSION_PERSISTENCE_SOURCE_IP
+ }
+
+ # This is a special case as the reference driver does not support
+ # SOURCE-IP-PORT. Since it runs with not_implemented_is_error, we must
+ # handle this test case special.
+ try:
+ pool = self.mem_pool_client.create_pool(**pool_kwargs)
+ except exceptions.NotImplemented as e:
+ if algorithm != const.LB_ALGORITHM_SOURCE_IP_PORT:
+ raise
+ message = ("The configured provider driver '{driver}' "
+ "does not support a feature required for this "
+ "test.".format(driver=CONF.load_balancer.provider))
+ if hasattr(e, 'resp_body'):
+ message = e.resp_body.get('faultstring', message)
+ raise testtools.TestCase.skipException(message)
+
self.addClassResourceCleanup(
self.mem_pool_client.cleanup_pool,
pool[const.ID],
@@ -626,19 +1301,27 @@
UUID(pool[const.ID])
# Operating status for pools will always be offline without members
self.assertEqual(const.OFFLINE, pool[const.OPERATING_STATUS])
- self.assertEqual(self.protocol, pool[const.PROTOCOL])
+ self.assertEqual(pool_protocol, pool[const.PROTOCOL])
self.assertEqual(1, len(pool[const.LOADBALANCERS]))
self.assertEqual(self.lb_id, pool[const.LOADBALANCERS][0][const.ID])
self.assertEmpty(pool[const.LISTENERS])
- self.assertEqual(self.lb_algorithm,
- pool[const.LB_ALGORITHM])
- if self.lb_feature_enabled.session_persistence_enabled:
+ self.assertEqual(algorithm, pool[const.LB_ALGORITHM])
+
+ if session_persistence == const.SESSION_PERSISTENCE_APP_COOKIE:
self.assertIsNotNone(pool.get(const.SESSION_PERSISTENCE))
self.assertEqual(const.SESSION_PERSISTENCE_APP_COOKIE,
pool[const.SESSION_PERSISTENCE][const.TYPE])
self.assertEqual(pool_sp_cookie_name,
pool[const.SESSION_PERSISTENCE][
const.COOKIE_NAME])
+ elif session_persistence == const.SESSION_PERSISTENCE_HTTP_COOKIE:
+ self.assertIsNotNone(pool.get(const.SESSION_PERSISTENCE))
+ self.assertEqual(const.SESSION_PERSISTENCE_HTTP_COOKIE,
+ pool[const.SESSION_PERSISTENCE][const.TYPE])
+ elif session_persistence == const.SESSION_PERSISTENCE_SOURCE_IP:
+ self.assertIsNotNone(pool.get(const.SESSION_PERSISTENCE))
+ self.assertEqual(const.SESSION_PERSISTENCE_SOURCE_IP,
+ pool[const.SESSION_PERSISTENCE][const.TYPE])
# Test that a user, without the load balancer member role, cannot
# use this command
@@ -677,11 +1360,13 @@
new_name = data_utils.rand_name("lb_member_pool1-UPDATED")
new_description = data_utils.arbitrary_string(size=255,
base_text='new')
+ # We have to set it to the same protocol as not all
+ # drivers support more than one pool algorithm
pool_update_kwargs = {
const.NAME: new_name,
const.DESCRIPTION: new_description,
const.ADMIN_STATE_UP: True,
- const.LB_ALGORITHM: self.lb_algorithm,
+ const.LB_ALGORITHM: algorithm,
}
if self.mem_lb_client.is_version_supported(self.api_version, '2.5'):
@@ -690,10 +1375,22 @@
const.TAGS: new_tags
})
- if self.lb_feature_enabled.session_persistence_enabled:
+ if session_persistence == const.SESSION_PERSISTENCE_APP_COOKIE:
pool_update_kwargs[const.SESSION_PERSISTENCE] = {
- const.TYPE: const.SESSION_PERSISTENCE_HTTP_COOKIE,
+ const.TYPE: const.SESSION_PERSISTENCE_HTTP_COOKIE
}
+ elif session_persistence == const.SESSION_PERSISTENCE_HTTP_COOKIE:
+ pool_update_kwargs[const.SESSION_PERSISTENCE] = {
+ const.TYPE: const.SESSION_PERSISTENCE_APP_COOKIE,
+ const.COOKIE_NAME: pool_sp_cookie_name
+ }
+ elif session_persistence == const.SESSION_PERSISTENCE_SOURCE_IP:
+ # Some protocols only support source IP session persistence
+ # so set this to the same.
+ pool_update_kwargs[const.SESSION_PERSISTENCE] = {
+ const.TYPE: const.SESSION_PERSISTENCE_SOURCE_IP
+ }
+
pool = self.mem_pool_client.update_pool(
pool[const.ID], **pool_update_kwargs)
@@ -712,21 +1409,34 @@
self.assertEqual(new_name, pool[const.NAME])
self.assertEqual(new_description, pool[const.DESCRIPTION])
self.assertTrue(pool[const.ADMIN_STATE_UP])
- self.assertEqual(self.lb_algorithm,
- pool[const.LB_ALGORITHM])
- if self.lb_feature_enabled.session_persistence_enabled:
+ self.assertEqual(algorithm, pool[const.LB_ALGORITHM])
+
+ if session_persistence == const.SESSION_PERSISTENCE_APP_COOKIE:
self.assertIsNotNone(pool.get(const.SESSION_PERSISTENCE))
self.assertEqual(const.SESSION_PERSISTENCE_HTTP_COOKIE,
pool[const.SESSION_PERSISTENCE][const.TYPE])
self.assertIsNone(
pool[const.SESSION_PERSISTENCE].get(const.COOKIE_NAME))
+ elif session_persistence == const.SESSION_PERSISTENCE_HTTP_COOKIE:
+ self.assertIsNotNone(pool.get(const.SESSION_PERSISTENCE))
+ self.assertEqual(const.SESSION_PERSISTENCE_APP_COOKIE,
+ pool[const.SESSION_PERSISTENCE][const.TYPE])
+ self.assertEqual(pool_sp_cookie_name,
+ pool[const.SESSION_PERSISTENCE][
+ const.COOKIE_NAME])
+ elif session_persistence == const.SESSION_PERSISTENCE_SOURCE_IP:
+ self.assertIsNotNone(pool.get(const.SESSION_PERSISTENCE))
+ self.assertEqual(const.SESSION_PERSISTENCE_SOURCE_IP,
+ pool[const.SESSION_PERSISTENCE][const.TYPE])
+ self.assertIsNone(
+ pool[const.SESSION_PERSISTENCE].get(const.COOKIE_NAME))
if self.mem_lb_client.is_version_supported(self.api_version, '2.5'):
self.assertCountEqual(pool_update_kwargs[const.TAGS],
pool[const.TAGS])
# Also test removing a Session Persistence
- if self.lb_feature_enabled.session_persistence_enabled:
+ if session_persistence is not None:
pool_update_kwargs = {
const.SESSION_PERSISTENCE: None,
}
@@ -744,11 +1454,119 @@
const.ACTIVE,
CONF.load_balancer.build_interval,
CONF.load_balancer.build_timeout)
- if self.lb_feature_enabled.session_persistence_enabled:
+ if session_persistence is not None:
self.assertIsNone(pool.get(const.SESSION_PERSISTENCE))
+ @decorators.idempotent_id('008088c8-696e-47ba-bc18-75827fe5956b')
+ def test_HTTP_LC_pool_delete(self):
+ self._test_pool_delete(const.HTTP,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('c4b2dad0-378f-4f85-a1f3-597de609b0f3')
+ def test_HTTPS_LC_pool_delete(self):
+ self._test_pool_delete(const.HTTPS,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('d906c63e-6090-422c-9627-e5a971e1665c')
+ def test_PROXY_LC_pool_delete(self):
+ self._test_pool_delete(const.PROXY,
+ const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('3bfd2d96-813b-48af-86e0-97361873a68a')
+ def test_TCP_LC_pool_delete(self):
+ self._test_pool_delete(const.TCP, const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
+ @decorators.idempotent_id('ea58bede-1934-480b-86fc-665b872fc946')
+ def test_UDP_LC_pool_delete(self):
+ self._test_pool_delete(const.UDP, const.LB_ALGORITHM_LEAST_CONNECTIONS)
+
@decorators.idempotent_id('35ed3800-7a4a-47a6-9b94-c1033fff1112')
- def test_pool_delete(self):
+ def test_HTTP_RR_pool_delete(self):
+ self._test_pool_delete(const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('c305126b-3ead-4ea8-a886-77d355c0d4a2')
+ def test_HTTPS_RR_pool_delete(self):
+ self._test_pool_delete(const.HTTPS, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('729be91c-82c5-4b4e-9feb-08a1c786488b')
+ def test_PROXY_RR_pool_delete(self):
+ self._test_pool_delete(const.PROXY, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('a455dea2-19ce-435c-90ae-e143fe84245e')
+ def test_TCP_RR_pool_delete(self):
+ self._test_pool_delete(const.TCP, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('63559694-6b38-4bad-9f10-3675131b28c0')
+ def test_UDP_RR_pool_delete(self):
+ self._test_pool_delete(const.UDP, const.LB_ALGORITHM_ROUND_ROBIN)
+
+ @decorators.idempotent_id('06bec76b-8fbf-4be8-9350-92590ac48606')
+ def test_HTTP_SI_pool_delete(self):
+ self._test_pool_delete(const.HTTP, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('4b21149e-64f8-4e5f-8f71-020abbd0d0eb')
+ def test_HTTPS_SI_pool_delete(self):
+ self._test_pool_delete(const.HTTPS, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('277fba8f-d72b-47f0-9723-5e013f53fb7a')
+ def test_PROXY_SI_pool_delete(self):
+ self._test_pool_delete(const.PROXY, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('8411295f-aec0-40ab-a25d-a4677c711d98')
+ def test_TCP_SI_pool_delete(self):
+ self._test_pool_delete(const.TCP, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('33322f21-12cc-4f2e-b406-0c11b05a1c6e')
+ def test_UDP_SI_pool_delete(self):
+ self._test_pool_delete(const.UDP, const.LB_ALGORITHM_SOURCE_IP)
+
+ @decorators.idempotent_id('9b40351e-1140-4b98-974c-46bd1a19763d')
+ def test_HTTP_SIP_pool_delete(self):
+ self._test_pool_delete(const.HTTP, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('391a4ed7-be97-4231-8198-5c2802bc6e30')
+ def test_HTTPS_SIP_pool_delete(self):
+ self._test_pool_delete(const.HTTPS, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('1f6b6b9c-96c6-420b-bc51-8568c081a1ee')
+ def test_PROXY_SIP_pool_delete(self):
+ self._test_pool_delete(const.PROXY, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('fe54f133-865a-4613-9cf0-0469c780f53e')
+ def test_TCP_SIP_pool_delete(self):
+ self._test_pool_delete(const.TCP, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ @decorators.idempotent_id('7cac0520-c7ea-49cb-8b38-0e309af2ea53')
+ def test_UDP_SIP_pool_delete(self):
+ self._test_pool_delete(const.UDP, const.LB_ALGORITHM_SOURCE_IP_PORT)
+
+ # Test with session persistence
+ @decorators.idempotent_id('f9aa5a8c-4e2a-4029-8581-2980f1d111cf')
+ def test_HTTP_RR_app_cookie_pool_delete(self):
+ self._test_pool_delete(
+ const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN,
+ session_persistence=const.SESSION_PERSISTENCE_APP_COOKIE)
+
+ @decorators.idempotent_id('12a31fb5-85fc-4ec8-9475-079dc06f358b')
+ def test_HTTP_RR_http_cookie_pool_delete(self):
+ self._test_pool_delete(
+ const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN,
+ session_persistence=const.SESSION_PERSISTENCE_HTTP_COOKIE)
+
+ @decorators.idempotent_id('07528fe6-12a6-4fca-8819-9980e9d3db84')
+ def test_HTTP_RR_source_IP_pool_delete(self):
+ self._test_pool_delete(
+ const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN,
+ session_persistence=const.SESSION_PERSISTENCE_SOURCE_IP)
+
+ @decorators.idempotent_id('cc69c0d0-9191-4faf-a154-e33df880f44e')
+ def test_UDP_RR_source_IP_pool_delete(self):
+ self._test_pool_delete(
+ const.HTTP, const.LB_ALGORITHM_ROUND_ROBIN,
+ session_persistence=const.SESSION_PERSISTENCE_SOURCE_IP)
+
+ def _test_pool_delete(self, pool_protocol, algorithm,
+ session_persistence=None):
"""Tests pool create and delete APIs.
* Creates a pool.
@@ -756,20 +1574,51 @@
* Deletes the pool.
* Validates the pool is in the DELETED state.
"""
+ if (algorithm == const.LB_ALGORITHM_SOURCE_IP_PORT and not
+ self.mem_listener_client.is_version_supported(
+ self.api_version, '2.13')):
+ raise testtools.TestCase.skipException(
+ 'Skipping this test as load balancing algorithm '
+ 'SOURCE_IP_PORT requires API version 2.13 or newer.')
+
pool_name = data_utils.rand_name("lb_member_pool1-delete")
pool_sp_cookie_name = 'my_cookie'
pool_kwargs = {
const.NAME: pool_name,
- const.PROTOCOL: self.protocol,
- const.LB_ALGORITHM: self.lb_algorithm,
+ const.PROTOCOL: pool_protocol,
+ const.LB_ALGORITHM: algorithm,
const.LOADBALANCER_ID: self.lb_id,
}
- if self.lb_feature_enabled.session_persistence_enabled:
+
+ if session_persistence == const.SESSION_PERSISTENCE_APP_COOKIE:
pool_kwargs[const.SESSION_PERSISTENCE] = {
const.TYPE: const.SESSION_PERSISTENCE_APP_COOKIE,
- const.COOKIE_NAME: pool_sp_cookie_name,
+ const.COOKIE_NAME: pool_sp_cookie_name
}
- pool = self.mem_pool_client.create_pool(**pool_kwargs)
+ elif session_persistence == const.SESSION_PERSISTENCE_HTTP_COOKIE:
+ pool_kwargs[const.SESSION_PERSISTENCE] = {
+ const.TYPE: const.SESSION_PERSISTENCE_HTTP_COOKIE
+ }
+ elif session_persistence == const.SESSION_PERSISTENCE_SOURCE_IP:
+ pool_kwargs[const.SESSION_PERSISTENCE] = {
+ const.TYPE: const.SESSION_PERSISTENCE_SOURCE_IP
+ }
+
+ # This is a special case as the reference driver does not support
+ # SOURCE-IP-PORT. Since it runs with not_implemented_is_error, we must
+ # handle this test case special.
+ try:
+ pool = self.mem_pool_client.create_pool(**pool_kwargs)
+ except exceptions.NotImplemented as e:
+ if algorithm != const.LB_ALGORITHM_SOURCE_IP_PORT:
+ raise
+ message = ("The configured provider driver '{driver}' "
+ "does not support a feature required for this "
+ "test.".format(driver=CONF.load_balancer.provider))
+ if hasattr(e, 'resp_body'):
+ message = e.resp_body.get('faultstring', message)
+ raise testtools.TestCase.skipException(message)
+
self.addClassResourceCleanup(
self.mem_pool_client.cleanup_pool,
pool[const.ID],
diff --git a/octavia_tempest_plugin/tests/test_base.py b/octavia_tempest_plugin/tests/test_base.py
index adb872d..f260e88 100644
--- a/octavia_tempest_plugin/tests/test_base.py
+++ b/octavia_tempest_plugin/tests/test_base.py
@@ -154,6 +154,7 @@
"Configuration value test_network_override must be "
"specified if test_subnet_override is used.")
+ # TODO(johnsom) Remove this
# Get loadbalancing algorithms supported by provider driver.
try:
algorithms = const.SUPPORTED_LB_ALGORITHMS[
diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml
index 6e4d685..523802e 100644
--- a/zuul.d/jobs.yaml
+++ b/zuul.d/jobs.yaml
@@ -399,6 +399,9 @@
"$TEMPEST_CONFIG":
load_balancer:
test_with_noop: True
+ build_interval: 0.5
+ check_interval: 0.5
+ lb_build_interval: 0.5
# AZ API tests with no-op need AZs configured but they do not
# need to actually exist in Nova due to the no-op driver.
availability_zone: bogus-az-1
@@ -429,7 +432,7 @@
enabled: True
audit_middleware_notifications:
driver: log
- tempest_concurrency: 2
+ tempest_concurrency: 4
tempest_test_regex: ^octavia_tempest_plugin.tests.api.v2
tox_envlist: all
irrelevant-files:
@@ -877,6 +880,35 @@
######### Third party jobs ##########
- job:
+ name: neutron-ovn-provider-v2-api
+ parent: ovn-octavia-provider-v2-dsvm-scenario
+ description: Runs the neutron OVN provider driver for Octavia api test.
+ voting: false
+ timeout: 5400
+ attempts: 1
+ tags: ovn-octavia-provider
+ irrelevant-files:
+ - ^.*\.rst$
+ - ^api-ref/.*$
+ - ^doc/.*$
+ - ^etc/.*$
+ - ^releasenotes/.*$
+ - ^octavia/amphorae/.*$
+ - ^octavia/api/drivers/amphora_driver/.*$
+ - ^octavia/compute/.*$
+ - ^octavia/controller/.*$
+ - ^octavia/distributor/.*$
+ - ^octavia/volume/.*$
+ - ^octavia/tests/.*$
+ vars:
+ tempest_test_regex: ^octavia_tempest_plugin.tests.api.v2
+ devstack_local_conf:
+ test-config:
+ "$TEMPEST_CONFIG":
+ loadbalancer-feature-enabled:
+ not_implemented_is_error: False
+
+- job:
name: neutron-ovn-provider-v2-scenario
parent: ovn-octavia-provider-v2-dsvm-scenario
description: Runs the neutron OVN provider driver for Octavia scenario test.
diff --git a/zuul.d/projects.yaml b/zuul.d/projects.yaml
index 3f9efb5..d66f616 100644
--- a/zuul.d/projects.yaml
+++ b/zuul.d/projects.yaml
@@ -45,6 +45,8 @@
- octavia-v2-dsvm-cinder-amphora:
voting: false
# Third party provider jobs
+ - neutron-ovn-provider-v2-api:
+ voting: false
- neutron-ovn-provider-v2-scenario:
voting: false
gate: