Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions RLTest/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ def do_normal_conn(self, line):
'--cluster_node_timeout', default=5000,
help='sets the node timeout on cluster in milliseconds')

parser.add_argument(
'--cluster_bus_port_protected_mode', default=None, choices=['yes', 'no'],
help='sets cluster-bus-port-protected-mode; only pass it to a redis that has the option '
'(8.12 and up, or a backported 8.2.10/8.4.7/8.6.7/8.8.3/8.10.2), as an unknown '
'directive stops the server from starting')

parser.add_argument(
'--cluster-start-timeout', default=40, type=int,
help='timeout in seconds to wait for cluster to be ready (default 40 seconds). '
Expand Down Expand Up @@ -543,6 +549,7 @@ def __init__(self):
Defaults.tls_passphrase = self.args.tls_passphrase
Defaults.oss_password = self.args.oss_password
Defaults.cluster_node_timeout = self.args.cluster_node_timeout
Defaults.cluster_bus_port_protected_mode = self.args.cluster_bus_port_protected_mode
Defaults.cluster_start_timeout = self.args.cluster_start_timeout
if Defaults.cluster_start_timeout < 5:
raise Exception('--cluster-start-timeout must be at least 5 seconds')
Expand Down
7 changes: 6 additions & 1 deletion RLTest/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class Defaults:
randomize_ports = False
oss_password = None
cluster_node_timeout = None
cluster_bus_port_protected_mode = None
cluster_start_timeout = 40
curr_test_name = None
port = 6379
Expand Down Expand Up @@ -188,7 +189,8 @@ class Env:
RTestInstance = None
EnvCompareParams = ['module', 'moduleArgs', 'env', 'useSlaves', 'shardsCount', 'useAof',
'useRdbPreamble', 'forceTcp', 'enableDebugCommand', 'enableProtectedConfigs',
'enableModuleCommand', 'protocol', 'password']
'enableModuleCommand', 'protocol', 'password',
'clusterBusPortProtectedMode']

def __new__(cls, *args, **kwargs):
if cls is Env and Defaults.env_class is not None:
Expand All @@ -208,6 +210,7 @@ def __init__(self, testName=None, testDescription=None, module=None,
useAof=None, useRdbPreamble=None, forceTcp=False, useTLS=False, tlsCertFile=None, tlsKeyFile=None,
tlsCaCertFile=None, tlsPassphrase=None, logDir=None, redisBinaryPath=None, dmcBinaryPath=None,
redisEnterpriseBinaryPath=None, noDefaultModuleArgs=False, clusterNodeTimeout = None,
clusterBusPortProtectedMode=None,
freshEnv=False, enableDebugCommand=None, enableModuleCommand=None, enableProtectedConfigs=None, protocol=None,
terminateRetries=None, terminateRetrySecs=None, redisConfigFile=None, dualTLS=False,
startupGraceSecs=None):
Expand Down Expand Up @@ -247,6 +250,7 @@ def __init__(self, testName=None, testDescription=None, module=None,
self.dmcBinaryPath = expandBinary(dmcBinaryPath) if dmcBinaryPath else Defaults.proxy_binary
self.redisEnterpriseBinaryPath = expandBinary(redisEnterpriseBinaryPath) if redisEnterpriseBinaryPath else Defaults.re_binary
self.clusterNodeTimeout = clusterNodeTimeout if clusterNodeTimeout else Defaults.cluster_node_timeout
self.clusterBusPortProtectedMode = clusterBusPortProtectedMode if clusterBusPortProtectedMode is not None else Defaults.cluster_bus_port_protected_mode
self.port = Defaults.port
self.enableDebugCommand = enableDebugCommand if enableDebugCommand is not None else Defaults.enable_debug_command
self.enableProtectedConfigs = enableProtectedConfigs if enableProtectedConfigs is not None\
Expand Down Expand Up @@ -373,6 +377,7 @@ def getEnvKwargs(self):
'tlsKeyFile': self.tlsKeyFile,
'tlsCaCertFile': self.tlsCaCertFile,
'clusterNodeTimeout': self.clusterNodeTimeout,
'clusterBusPortProtectedMode': self.clusterBusPortProtectedMode,
'tlsPassphrase': self.tlsPassphrase,
'port': self.port,
'enableDebugCommand': self.enableDebugCommand,
Expand Down
10 changes: 9 additions & 1 deletion RLTest/redis_std.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class StandardEnv(object):
def __init__(self, redisBinaryPath, port=6379, modulePath=None, moduleArgs=None, outputFilesFormat=None,
dbDirPath=None, useSlaves=False, serverId=1, password=None, libPath=None, clusterEnabled=False, decodeResponses=False,
useAof=False, useRdbPreamble=True, debugger=None, sanitizer=None, noCatch=False, noLog=False, unix=False, verbose=False, useTLS=False,
tlsCertFile=None, tlsKeyFile=None, tlsCaCertFile=None, clusterNodeTimeout=None, tlsPassphrase=None, enableDebugCommand=False, protocol=2,
tlsCertFile=None, tlsKeyFile=None, tlsCaCertFile=None, clusterNodeTimeout=None, clusterBusPortProtectedMode=None, tlsPassphrase=None, enableDebugCommand=False, protocol=2,
terminateRetries=None, terminateRetrySecs=None, enableProtectedConfigs=False, enableModuleCommand=False, loglevel=None,
redisConfigFile=None, dualTLS=False, startupGraceSecs=0.1
):
Expand Down Expand Up @@ -63,6 +63,11 @@ def __init__(self, redisBinaryPath, port=6379, modulePath=None, moduleArgs=None,
self.tlsKeyFile = tlsKeyFile
self.tlsCaCertFile = tlsCaCertFile
self.clusterNodeTimeout = clusterNodeTimeout
# None emits nothing. Set it only for a redis that has the option, as an unknown
# directive stops the server from starting: 8.12 and up, where it also defaults to
# enabled and so refuses an unauthenticated cluster bus, or one of the backports
# (8.2.10, 8.4.7, 8.6.7, 8.8.3, 8.10.2), where it defaults to disabled.
self.clusterBusPortProtectedMode = clusterBusPortProtectedMode
self.tlsPassphrase = tlsPassphrase
self.enableDebugCommand = enableDebugCommand
self.enableModuleCommand = enableModuleCommand
Expand Down Expand Up @@ -233,6 +238,9 @@ def createCmdArgs(self, role):
'--cluster-node-timeout', '5000' if self.clusterNodeTimeout is None else str(self.clusterNodeTimeout)]
if self.useTLS:
cmdArgs += ['--tls-cluster', 'yes']
if self.clusterBusPortProtectedMode is not None:
cmdArgs += ['--cluster-bus-port-protected-mode',
'yes' if self.clusterBusPortProtectedMode in (True, 'yes') else 'no']
if self.useAof:
cmdArgs += ['--appendonly', 'yes']
cmdArgs += ['--appendfilename', self._getFileName(role, '.aof')]
Expand Down
Loading