Add delay to SOURCE_IP_PORT TCP test
Without a delay it can trigger a "Cannot assign requested
address" warning setting the source port, leading to failure.
Also added a log debug statement when a source port is
being used since it can help with debugging.
Change-Id: Idcc13fdaafb8ffe41710fc3c67f30932725cf66e
diff --git a/octavia_tempest_plugin/tests/scenario/v2/test_traffic_ops.py b/octavia_tempest_plugin/tests/scenario/v2/test_traffic_ops.py
index 92e5ecb..356327b 100644
--- a/octavia_tempest_plugin/tests/scenario/v2/test_traffic_ops.py
+++ b/octavia_tempest_plugin/tests/scenario/v2/test_traffic_ops.py
@@ -928,9 +928,11 @@
listener_id, pool_id = self._listener_pool_create(
const.TCP, 60092,
pool_algorithm=const.LB_ALGORITHM_SOURCE_IP_PORT)
+ # Without a delay this can trigger a "Cannot assign requested
+ # address" warning setting the source port, leading to failure
self._test_basic_traffic(
const.TCP, 60092, listener_id, pool_id, traffic_member_count=1,
- persistent=False, source_port=60092)
+ persistent=False, source_port=60092, delay=0.2)
except exceptions.NotImplemented as e:
message = ("The configured provider driver '{driver}' "
"does not support a feature required for this "
diff --git a/octavia_tempest_plugin/tests/validators.py b/octavia_tempest_plugin/tests/validators.py
index a93e2eb..5972d54 100644
--- a/octavia_tempest_plugin/tests/validators.py
+++ b/octavia_tempest_plugin/tests/validators.py
@@ -284,6 +284,9 @@
HTTPS_verify, requests_session=requests_session,
source_port=source_port)
+ if source_port:
+ LOG.debug('Using source port %s for request(s)', source_port)
+
response_counts = {}
# Send a number requests to lb vip
for i in range(repeat):