diff --git a/RLTest/__main__.py b/RLTest/__main__.py index ab307a98..aaed3e06 100644 --- a/RLTest/__main__.py +++ b/RLTest/__main__.py @@ -118,6 +118,10 @@ def do_normal_conn(self, line): '--env', '-e', default='oss', choices=['oss', 'oss-cluster', 'enterprise', 'enterprise-cluster', 'existing-env', 'cluster_existing-env'], help='env on which to run the test') +parser.add_argument( + '-p', '--redis-port', type=int, default=6379, + help='Redis server port') + parser.add_argument( '--existing-env-addr', default='localhost:6379', help='Address of existing env, relevent only when running with existing-env, cluster_existing-env') @@ -327,6 +331,10 @@ def __init__(self): print(Colors.Green('RLTest version {}'.format(__version__))) sys.exit(0) + if self.args.redis_port not in range(1, pow(2, 16)): + print(Colors.Bred(f'requested port {self.args.redis_port} is not valid')) + sys.exit(1) + if self.args.interactive_debugger: if self.args.env != 'oss' and not (self.args.env == 'oss-cluster' and Defaults.num_shards == 1) and self.args.env != 'enterprise': print(Colors.Bred('interactive debugger can only be used on non cluster env')) @@ -417,6 +425,7 @@ def __init__(self): Defaults.debugger = debugger Defaults.sanitizer = sanitizer Defaults.exit_on_failure = self.args.exit_on_failure + Defaults.port = self.args.redis_port Defaults.external_addr = self.args.existing_env_addr Defaults.use_unix = self.args.unix Defaults.randomize_ports = self.args.randomize_ports diff --git a/RLTest/env.py b/RLTest/env.py index ad534402..02510083 100644 --- a/RLTest/env.py +++ b/RLTest/env.py @@ -148,6 +148,7 @@ def getKwargs(self): kwargs = { 'modulePath': self.module, 'moduleArgs': self.module_args, + 'port': self.port, 'useSlaves': self.use_slaves, 'useAof': self.use_aof, 'useRdbPreamble': self.use_rdb_preamble, diff --git a/pyproject.toml b/pyproject.toml index 6a8dfa7d..ba713e0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "RLTest" -version = "0.5.9" +version = "0.5.10" description="Redis Labs Test Framework, allow to run tests on redis and modules on a variety of environments" authors = ["RedisLabs "] license = "BSD-3-Clause"