Skip to content

Commit 262b22a

Browse files
authored
Merge pull request #200 from RedisLabsModules/enable_edit_protected_configs
2 parents 9548544 + ff39f43 commit 262b22a

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

RLTest/__main__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,10 @@ def do_normal_conn(self, line):
282282
'--enable-debug-command', action='store_const', const=True, default=False,
283283
help='On Redis 7, debug command need to be enabled in order to be used.')
284284

285+
parser.add_argument(
286+
'--enable-protected-configs', action='store_const', const=True, default=False,
287+
help='On Redis 7, this option needs to be enabled in order to change protected configuration in runtime.')
288+
285289
parser.add_argument('--check-exitcode', help='Check redis process exit code',
286290
default=False, action='store_true')
287291

@@ -449,6 +453,7 @@ def __init__(self):
449453
Defaults.oss_password = self.args.oss_password
450454
Defaults.cluster_node_timeout = self.args.cluster_node_timeout
451455
Defaults.enable_debug_command = self.args.enable_debug_command
456+
Defaults.enable_protected_configs = self.args.enable_protected_configs
452457
if Defaults.use_unix and Defaults.use_slaves:
453458
raise Exception('Cannot use unix sockets with slaves')
454459

RLTest/env.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ class Defaults:
146146
curr_test_name = None
147147
port=6379
148148
enable_debug_command=False
149+
enable_protected_configs=False
149150
terminate_retries=None
150151
terminate_retry_secs=None
151152
protocol=2
@@ -179,7 +180,7 @@ def getKwargs(self):
179180
class Env:
180181
RTestInstance = None
181182
EnvCompareParams = ['module', 'moduleArgs', 'env', 'useSlaves', 'shardsCount', 'useAof',
182-
'useRdbPreamble', 'forceTcp', 'enableDebugCommand', 'protocol']
183+
'useRdbPreamble', 'forceTcp', 'enableDebugCommand', 'enableProtectedConfigs', 'protocol']
183184

184185
def compareEnvs(self, env):
185186
if env is None:
@@ -194,7 +195,8 @@ def __init__(self, testName=None, testDescription=None, module=None,
194195
useAof=None, useRdbPreamble=None, forceTcp=False, useTLS=False, tlsCertFile=None, tlsKeyFile=None,
195196
tlsCaCertFile=None, tlsPassphrase=None, logDir=None, redisBinaryPath=None, dmcBinaryPath=None,
196197
redisEnterpriseBinaryPath=None, noDefaultModuleArgs=False, clusterNodeTimeout = None,
197-
freshEnv=False, enableDebugCommand=None, protocol=None, terminateRetries=None, terminateRetrySecs=None):
198+
freshEnv=False, enableDebugCommand=None, enableProtectedConfigs=None, protocol=None,
199+
terminateRetries=None, terminateRetrySecs=None):
198200

199201
self.testName = testName if testName else Defaults.curr_test_name
200202
if self.testName is None:
@@ -232,6 +234,8 @@ def __init__(self, testName=None, testDescription=None, module=None,
232234
self.clusterNodeTimeout = clusterNodeTimeout if clusterNodeTimeout else Defaults.cluster_node_timeout
233235
self.port = Defaults.port
234236
self.enableDebugCommand = enableDebugCommand if enableDebugCommand else Defaults.enable_debug_command
237+
self.enableProtectedConfigs = enableProtectedConfigs if enableProtectedConfigs\
238+
else Defaults.enable_protected_configs
235239
self.terminateRetries = terminateRetries
236240
self.terminateRetrySecs = terminateRetrySecs
237241

@@ -348,6 +352,7 @@ def getEnvKwargs(self):
348352
'tlsPassphrase': self.tlsPassphrase,
349353
'port': self.port,
350354
'enableDebugCommand': self.enableDebugCommand,
355+
'enableProtectedConfigs': self.enableProtectedConfigs,
351356
'protocol': self.protocol,
352357
'terminateRetries': self.terminateRetries,
353358
'terminateRetrySecs': self.terminateRetrySecs,

RLTest/redis_std.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(self, redisBinaryPath, port=6379, modulePath=None, moduleArgs=None,
2222
dbDirPath=None, useSlaves=False, serverId=1, password=None, libPath=None, clusterEnabled=False, decodeResponses=False,
2323
useAof=False, useRdbPreamble=True, debugger=None, sanitizer=None, noCatch=False, noLog=False, unix=False, verbose=False, useTLS=False,
2424
tlsCertFile=None, tlsKeyFile=None, tlsCaCertFile=None, clusterNodeTimeout=None, tlsPassphrase=None, enableDebugCommand=False, protocol=2,
25-
terminateRetries=None, terminateRetrySecs=None, loglevel=None):
25+
terminateRetries=None, terminateRetrySecs=None, enableProtectedConfigs=False, loglevel=None):
2626
self.uuid = uuid.uuid4().hex
2727
self.redisBinaryPath = os.path.expanduser(redisBinaryPath) if redisBinaryPath.startswith(
2828
'~/') else redisBinaryPath
@@ -63,6 +63,7 @@ def __init__(self, redisBinaryPath, port=6379, modulePath=None, moduleArgs=None,
6363
self.clusterNodeTimeout = clusterNodeTimeout
6464
self.tlsPassphrase = tlsPassphrase
6565
self.enableDebugCommand = enableDebugCommand
66+
self.enableProtectedConfigs = enableProtectedConfigs
6667
self.protocol = protocol
6768
self.terminateRetries = terminateRetries
6869
self.terminateRetrySecs = terminateRetrySecs
@@ -236,9 +237,11 @@ def createCmdArgs(self, role):
236237

237238
cmdArgs += ['--tls-replication', 'yes']
238239

239-
if self.enableDebugCommand:
240-
if self._getRedisVersion() > 70000:
240+
if self._getRedisVersion() > 70000:
241+
if self.enableDebugCommand:
241242
cmdArgs += ['--enable-debug-command', 'yes']
243+
if self.enableProtectedConfigs:
244+
cmdArgs += ['--enable-protected-configs', 'yes']
242245

243246
return cmdArgs
244247

config.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
#-vv
22
--clear-logs
3+
--enable-debug-command
4+
--enable-protected-configs
35
#--debug

0 commit comments

Comments
 (0)