File tree Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ cd ${TESTDIR}
40
40
# install, run tests
41
41
pip install ${PKG}
42
42
# Redis tests
43
- pytest -m ' not onlycluster'
43
+ pytest -m ' not onlycluster' --ignore=tests/test_scenario
44
44
# RedisCluster tests
45
45
CLUSTER_URL=" redis://localhost:16379/0"
46
46
CLUSTER_SSL_URL=" rediss://localhost:27379/0"
Original file line number Diff line number Diff line change 14
14
RELAX_TIMEOUT = 30
15
15
CLIENT_TIMEOUT = 5
16
16
17
+ DEFAULT_ENDPOINT_NAME = "pslavova-tls" # "m-standard"
18
+
17
19
18
20
@pytest .fixture ()
19
21
def endpoint_name (request ):
20
22
return request .config .getoption ("--endpoint-name" ) or os .getenv (
21
- "REDIS_ENDPOINT_NAME" , "m-standard"
23
+ "REDIS_ENDPOINT_NAME" , DEFAULT_ENDPOINT_NAME
22
24
)
23
25
24
26
@@ -75,6 +77,8 @@ def _get_client_maint_events(
75
77
host = parsed .hostname
76
78
port = parsed .port
77
79
80
+ tls_enabled = True if parsed .scheme == "rediss" else False
81
+
78
82
if not host :
79
83
raise ValueError (f"Could not parse host from endpoint URL: { endpoints [0 ]} " )
80
84
@@ -101,6 +105,9 @@ def _get_client_maint_events(
101
105
socket_timeout = CLIENT_TIMEOUT if socket_timeout is None else socket_timeout ,
102
106
username = username ,
103
107
password = password ,
108
+ ssl = tls_enabled ,
109
+ ssl_cert_reqs = "none" ,
110
+ ssl_check_hostname = False ,
104
111
protocol = 3 , # RESP3 required for push notifications
105
112
maintenance_events_config = maintenance_config ,
106
113
retry = retry ,
Original file line number Diff line number Diff line change @@ -220,6 +220,7 @@ def find_target_node_and_empty_node(
220
220
def find_endpoint_for_bind (
221
221
fault_injector : FaultInjectorClient ,
222
222
endpoint_config : Dict [str , Any ],
223
+ endpoint_name : str ,
223
224
timeout : int = 60 ,
224
225
) -> str :
225
226
"""Find the endpoint ID from cluster status.
@@ -252,13 +253,13 @@ def find_endpoint_for_bind(
252
253
elif endpoints_section_started and line and not line .startswith ("DB:ID" ):
253
254
# Parse endpoint line: db:1 m-standard endpoint:1:1 node:2 single No
254
255
parts = line .split ()
255
- if len (parts ) >= 3 :
256
+ if len (parts ) >= 3 and parts [ 1 ] == endpoint_name :
256
257
endpoint_full = parts [2 ] # endpoint:1:1
257
258
if endpoint_full .startswith ("endpoint:" ):
258
259
endpoint_id = endpoint_full .replace ("endpoint:" , "" ) # 1:1
259
260
return endpoint_id
260
261
261
- raise ValueError ("No endpoint ID found in cluster status" )
262
+ raise ValueError (f "No endpoint ID for { endpoint_name } found in cluster status" )
262
263
263
264
@staticmethod
264
265
def execute_rladmin_migrate (
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ def setup_and_cleanup(
48
48
client_maint_events : Redis ,
49
49
fault_injector_client : FaultInjectorClient ,
50
50
endpoints_config : Dict [str , Any ],
51
+ endpoint_name : str ,
51
52
):
52
53
# Initialize cleanup flags first to ensure they exist even if setup fails
53
54
self ._migration_executed = False
@@ -70,7 +71,7 @@ def setup_and_cleanup(
70
71
71
72
try :
72
73
self .endpoint_id = ClusterOperations .find_endpoint_for_bind (
73
- fault_injector_client , endpoints_config
74
+ fault_injector_client , endpoints_config , endpoint_name
74
75
)
75
76
logging .info (f"Using endpoint: { self .endpoint_id } " )
76
77
except Exception as e :
You can’t perform that action at this time.
0 commit comments