RLTest 0.7.14__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
rltest-0.7.14/LICENSE ADDED
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2018, Redis Labs Modules
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ * Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ * Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ * Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
rltest-0.7.14/PKG-INFO ADDED
@@ -0,0 +1,296 @@
1
+ Metadata-Version: 2.1
2
+ Name: RLTest
3
+ Version: 0.7.14
4
+ Summary: Redis Modules Test Framework, allow to run tests on redis and modules on a variety of environments
5
+ License: BSD-3-Clause
6
+ Author: Redis, Inc.
7
+ Author-email: oss@redis.com
8
+ Requires-Python: >=3.7.0
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: BSD License
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.7
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Database
22
+ Requires-Dist: distro (>=1.5.0,<2.0.0)
23
+ Requires-Dist: progressbar2 (==4.2)
24
+ Requires-Dist: psutil (>=5.9.5,<6.0.0)
25
+ Requires-Dist: pytest (>=7.4,<8.0)
26
+ Requires-Dist: pytest-cov (>=4.1.0,<5.0.0)
27
+ Requires-Dist: redis (>=5.0.0rc2,<6.0.0)
28
+ Project-URL: repository, https://github.com/RedisLabsModules/RLTest
29
+ Description-Content-Type: text/markdown
30
+
31
+ [![license](https://img.shields.io/github/license/RedisLabsModules/RLTest.svg)](https://github.com/RedisLabsModules/RLTest/blob/master/LICENSE)
32
+ [![PyPI version](https://badge.fury.io/py/rltest.svg)](https://badge.fury.io/py/rltest)
33
+ [![CI](https://github.com/RedisLabsModules/RLTest/workflows/CI/badge.svg)](https://github.com/RedisLabsModules/RLTest/actions)
34
+ [![Version](https://img.shields.io/github/release/RedisLabsModules/RLTest.svg)](https://github.com/RedisLabsModules/RLTest/releases/latest)
35
+ [![Codecov](https://codecov.io/gh/RedisLabsModules/RLTest/branch/master/graph/badge.svg)](https://codecov.io/gh/RedisLabsModules/RLTest)
36
+ [![Known Vulnerabilities](https://snyk.io/test/github/RedisLabsModules/RLTest/badge.svg?targetFile=pyproject.toml)](https://snyk.io/test/github/RedisLabsModules/RLTest?targetFile=pyproject.toml)
37
+
38
+
39
+
40
+ # RLTest
41
+
42
+ Redis Labs Test Framework, allow running tests on redis and modules on a variety of environments.
43
+
44
+ Supported Environment: oss, oss-cluster, enterprise, enterprise-cluster
45
+
46
+ The framework allow you to write a test without environment specification and then run the test on all supported environment.
47
+
48
+
49
+ # Install
50
+ ```
51
+ $ pip install git+https://github.com/RedisLabsModules/RLTest.git@master
52
+
53
+ ```
54
+
55
+ # Usage:
56
+ ```
57
+ $ RLTest --help
58
+ usage: RLTest [-h] [--version] [--module MODULE] [--module-args MODULE_ARGS]
59
+ [--env {oss,oss-cluster,enterprise,enterprise-cluster,existing-env,cluster_existing-env}]
60
+ [--existing-env-addr EXISTING_ENV_ADDR]
61
+ [--shards_ports SHARDS_PORTS]
62
+ [--cluster_address CLUSTER_ADDRESS]
63
+ [--oss_password OSS_PASSWORD]
64
+ [--cluster_credentials CLUSTER_CREDENTIALS]
65
+ [--cluster_node_timeout CLUSTER_NODE_TIMEOUT]
66
+ [--internal_password INTERNAL_PASSWORD]
67
+ [--oss-redis-path OSS_REDIS_PATH]
68
+ [--enterprise-redis-path ENTERPRISE_REDIS_PATH]
69
+ [--stop-on-failure] [-x] [--verbose] [--debug] [-t TEST]
70
+ [--env-only] [--clear-logs] [--log-dir LOG_DIR] [--use-slaves]
71
+ [--shards-count SHARDS_COUNT] [--download-enterprise-binaries]
72
+ [--proxy-binary-path PROXY_BINARY_PATH]
73
+ [--enterprise-lib-path ENTERPRISE_LIB_PATH] [-r]
74
+ [--use-aof] [--use-rdb-preamble]
75
+ [--debug-print] [-V] [--vg-suppressions VG_SUPPRESSIONS]
76
+ [--vg-options VG_OPTIONS] [--vg-no-leakcheck] [--vg-verbose]
77
+ [--vg-no-fail-on-errors] [-i] [--debugger DEBUGGER] [-s]
78
+ [--check-exitcode] [--unix] [--randomize-ports] [--collect-only]
79
+ [--tls] [--tls-cert-file TLS_CERT_FILE]
80
+ [--tls-key-file TLS_KEY_FILE]
81
+ [--tls-ca-cert-file TLS_CA_CERT_FILE]
82
+
83
+ Test Framework for redis and redis module
84
+
85
+ optional arguments:
86
+ -h, --help show this help message and exit
87
+ --version Print RLTest version and exit (default: False)
88
+ --module MODULE path to the module file. You can use `--module` more
89
+ than once but it imples that you explicitly specify
90
+ `--module-args` as well. Notice that on enterprise the
91
+ file should be a zip file packed with
92
+ [RAMP](https://github.com/RedisLabs/RAMP). (default:
93
+ None)
94
+ --module-args MODULE_ARGS
95
+ arguments to give to the module on loading (default:
96
+ None)
97
+ --env {oss,oss-cluster,enterprise,enterprise-cluster,existing-env,cluster_existing-env}, -e {oss,oss-cluster,enterprise,enterprise-cluster,existing-env,cluster_existing-env}
98
+ env on which to run the test (default: oss)
99
+ --existing-env-addr EXISTING_ENV_ADDR
100
+ Address of existing env, relevent only when running
101
+ with existing-env, cluster_existing-env (default:
102
+ localhost:6379)
103
+ --shards_ports SHARDS_PORTS
104
+ list of ports, the shards are listening to, relevent
105
+ only when running with cluster_existing-env (default:
106
+ None)
107
+ --cluster_address CLUSTER_ADDRESS
108
+ enterprise cluster ip, relevent only when running with
109
+ cluster_existing-env (default: None)
110
+ --oss_password OSS_PASSWORD
111
+ set redis password, relevant for oss and oss-cluster
112
+ environment (default: None)
113
+ --cluster_credentials CLUSTER_CREDENTIALS
114
+ enterprise cluster cluster_credentials
115
+ "username:password", relevent only when running with
116
+ cluster_existing-env (default: None)
117
+ --cluster_node_timeout CLUSTER_NODE_TIMEOUT
118
+ cluster node timeout in milliseconds
119
+ --internal_password INTERNAL_PASSWORD
120
+ Give an ability to execute commands on shards
121
+ directly, relevent only when running with
122
+ cluster_existing-env (default: )
123
+ --oss-redis-path OSS_REDIS_PATH
124
+ path to the oss redis binary (default: redis-server)
125
+ --enterprise-redis-path ENTERPRISE_REDIS_PATH
126
+ path to the enterprise redis binary (default:
127
+ ~/.RLTest/opt/redislabs/bin/redis-server)
128
+ --redis-config-file REDIS_CONFIG_FILE
129
+ path to the redis configuration file (default: None)
130
+ --stop-on-failure stop running on failure (default: False)
131
+ -x, --exit-on-failure
132
+ Stop test execution and exit on first assertion
133
+ failure (default: False)
134
+ --verbose, -v print more information about the test (default: 0)
135
+ --debug stop before each test allow gdb attachment (default:
136
+ False)
137
+ -t TEST, --test TEST Specify test to run, in the form of "file:test"
138
+ (default: None)
139
+ --env-only start the env but do not run any tests (default:
140
+ False)
141
+ --clear-logs deleting the log direcotry before the execution
142
+ (default: False)
143
+ --log-dir LOG_DIR directory to write logs to (default: ./logs)
144
+ --use-slaves run env with slaves enabled (default: False)
145
+ --shards-count SHARDS_COUNT
146
+ Number shards in bdb (default: 1)
147
+ --download-enterprise-binaries
148
+ run env with slaves enabled (default: False)
149
+ --proxy-binary-path PROXY_BINARY_PATH
150
+ dmc proxy binary path (default:
151
+ ~/.RLTest/opt/redislabs/bin/dmcproxy)
152
+ --enterprise-lib-path ENTERPRISE_LIB_PATH
153
+ path of needed libraries to run enterprise binaries
154
+ (default: ~/.RLTest/opt/redislabs/lib/)
155
+ -r, --env-reuse reuse exists env, this feature is based on best
156
+ efforts, if the env can not be reused then it will be
157
+ taken down. (default: False)
158
+ --use-aof use aof instead of rdb (default: False)
159
+ --use-rdb-preamble use rdb preamble when rewriting aof file (default: True)
160
+ --debug-print print debug messages (default: False)
161
+ -V, --vg, --use-valgrind
162
+ running redis under valgrind (assuming valgrind is
163
+ install on the machine) (default: False)
164
+ --vg-suppressions VG_SUPPRESSIONS
165
+ path valgrind suppressions file (default: None)
166
+ --vg-options VG_OPTIONS
167
+ valgrind [options] (default: None)
168
+ --vg-no-leakcheck Don't perform a leak check (default: False)
169
+ --vg-verbose Don't log valgrind output. Output to screen directly
170
+ (default: False)
171
+ --vg-no-fail-on-errors
172
+ Dont Fail test when valgrind reported any errors in
173
+ the run.By default on RLTest the return value from
174
+ Valgrind will be used to fail the tests.Use this
175
+ option when you wish to dry-run valgrind but not fail
176
+ the test on valgrind reported errors. (default: False)
177
+ -i, --interactive-debugger
178
+ runs the redis on a debuger (gdb/lldb)
179
+ interactivly.debugger interactive mode is only
180
+ possible on a single process and so unsupported on
181
+ cluste or with slaves.it is also not possible to use
182
+ valgrind on interactive mode.interactive mode direcly
183
+ applies: --no-output-catch and --stop-on-failure.it is
184
+ also implies that only one test will be run (if --env-
185
+ only was not specify), an error will be raise
186
+ otherwise. (default: False)
187
+ --debugger DEBUGGER Run specified command line as the debugger (default:
188
+ None)
189
+ -s, --no-output-catch
190
+ all output will be written to the stdout, no log
191
+ files. (default: False)
192
+ --check-exitcode Check redis process exit code (default: False)
193
+ --unix Use Unix domain sockets instead of TCP (default:
194
+ False)
195
+ --randomize-ports Randomize Redis listening port assignment rather
196
+ thanusing default port (default: False)
197
+ --collect-only Collect the tests and exit (default: False)
198
+ --tls Enable TLS Support and disable the non-TLS port
199
+ completely. TLS connections will be available at the
200
+ default non-TLS ports. (default: False)
201
+ --tls-cert-file TLS_CERT_FILE
202
+ /path/to/redis.crt (default: None)
203
+ --tls-key-file TLS_KEY_FILE
204
+ /path/to/redis.key (default: None)
205
+ --tls-ca-cert-file TLS_CA_CERT_FILE
206
+ /path/to/ca.crt (default: None)
207
+
208
+ ```
209
+
210
+ ## Sample usages
211
+
212
+ ### Multiple modules
213
+
214
+ ```
215
+ RLTest --module modules/module1.so --module-args '' --module modules/module2.so --module-args ''
216
+ ```
217
+
218
+ # Configuration File
219
+ By default, the framework search for configuration file on the current directory. The configuration file name is: config.txt.
220
+ It is possible to specify different configuration file on command line using the '@' prefix, for example:
221
+ ```
222
+ RLTest @myConfig.txt # search for myConfig.txt configuration file
223
+ ```
224
+ The configuration file format is the same as the command line argument, i.e : '--< param_name > < param_val >'.
225
+
226
+ It is also possible to comment a specific lines in the configuration file using '#'.
227
+
228
+ Example:
229
+
230
+ ```
231
+ -vv
232
+ --clear-logs
233
+ #--debug
234
+ ```
235
+
236
+
237
+ # Test Example
238
+
239
+ ```python
240
+ from RLTest import Env
241
+ import time
242
+
243
+
244
+ class testExample():
245
+ '''
246
+ run all tests on a single env without taking
247
+ env down between tests
248
+ '''
249
+ def __init__(self):
250
+ self.env = Env()
251
+
252
+ def testExample(self):
253
+ con = self.env.getConnection()
254
+ con.set('x', 1)
255
+ self.env.assertEqual(con.get('x'), '1')
256
+
257
+ def testExample1(self):
258
+ con = self.env.getConnection()
259
+ con.set('x', 1)
260
+ self.env.assertEqual(con.get('x'), '1')
261
+ self.env.assertFalse(True) # check failure
262
+
263
+ def testExample2(self):
264
+ con = self.env.getConnection()
265
+ con.set('x', 1)
266
+ self.env.assertEqual(con.get('x'), '1')
267
+
268
+
269
+ # run each test on different env
270
+ def test_example():
271
+ env = Env()
272
+ con = env.getConnection()
273
+ con.set('x', 1)
274
+ env.assertEqual(con.get('x'), '1')
275
+
276
+
277
+ def test_example_2():
278
+ env = Env()
279
+ env.assertOk(env.cmd('set', 'x', '1'))
280
+ env.expect('get', 'x').equal('1')
281
+
282
+ env.expect('lpush', 'list', '1', '2', '3').equal(3)
283
+ env.expect('lrange', 'list', '0', '-1').debugPrint().contains('1')
284
+ env.debugPrint('this is some debug printing')
285
+
286
+
287
+ def test_example_3():
288
+ env = Env(useSlaves=True, env='oss')
289
+ con = env.getConnection()
290
+ con.set('x', 1)
291
+ con2 = env.getSlaveConnection()
292
+ time.sleep(0.1)
293
+ env.assertEqual(con2.get('x'), '1')
294
+
295
+ ```
296
+
@@ -0,0 +1,265 @@
1
+ [![license](https://img.shields.io/github/license/RedisLabsModules/RLTest.svg)](https://github.com/RedisLabsModules/RLTest/blob/master/LICENSE)
2
+ [![PyPI version](https://badge.fury.io/py/rltest.svg)](https://badge.fury.io/py/rltest)
3
+ [![CI](https://github.com/RedisLabsModules/RLTest/workflows/CI/badge.svg)](https://github.com/RedisLabsModules/RLTest/actions)
4
+ [![Version](https://img.shields.io/github/release/RedisLabsModules/RLTest.svg)](https://github.com/RedisLabsModules/RLTest/releases/latest)
5
+ [![Codecov](https://codecov.io/gh/RedisLabsModules/RLTest/branch/master/graph/badge.svg)](https://codecov.io/gh/RedisLabsModules/RLTest)
6
+ [![Known Vulnerabilities](https://snyk.io/test/github/RedisLabsModules/RLTest/badge.svg?targetFile=pyproject.toml)](https://snyk.io/test/github/RedisLabsModules/RLTest?targetFile=pyproject.toml)
7
+
8
+
9
+
10
+ # RLTest
11
+
12
+ Redis Labs Test Framework, allow running tests on redis and modules on a variety of environments.
13
+
14
+ Supported Environment: oss, oss-cluster, enterprise, enterprise-cluster
15
+
16
+ The framework allow you to write a test without environment specification and then run the test on all supported environment.
17
+
18
+
19
+ # Install
20
+ ```
21
+ $ pip install git+https://github.com/RedisLabsModules/RLTest.git@master
22
+
23
+ ```
24
+
25
+ # Usage:
26
+ ```
27
+ $ RLTest --help
28
+ usage: RLTest [-h] [--version] [--module MODULE] [--module-args MODULE_ARGS]
29
+ [--env {oss,oss-cluster,enterprise,enterprise-cluster,existing-env,cluster_existing-env}]
30
+ [--existing-env-addr EXISTING_ENV_ADDR]
31
+ [--shards_ports SHARDS_PORTS]
32
+ [--cluster_address CLUSTER_ADDRESS]
33
+ [--oss_password OSS_PASSWORD]
34
+ [--cluster_credentials CLUSTER_CREDENTIALS]
35
+ [--cluster_node_timeout CLUSTER_NODE_TIMEOUT]
36
+ [--internal_password INTERNAL_PASSWORD]
37
+ [--oss-redis-path OSS_REDIS_PATH]
38
+ [--enterprise-redis-path ENTERPRISE_REDIS_PATH]
39
+ [--stop-on-failure] [-x] [--verbose] [--debug] [-t TEST]
40
+ [--env-only] [--clear-logs] [--log-dir LOG_DIR] [--use-slaves]
41
+ [--shards-count SHARDS_COUNT] [--download-enterprise-binaries]
42
+ [--proxy-binary-path PROXY_BINARY_PATH]
43
+ [--enterprise-lib-path ENTERPRISE_LIB_PATH] [-r]
44
+ [--use-aof] [--use-rdb-preamble]
45
+ [--debug-print] [-V] [--vg-suppressions VG_SUPPRESSIONS]
46
+ [--vg-options VG_OPTIONS] [--vg-no-leakcheck] [--vg-verbose]
47
+ [--vg-no-fail-on-errors] [-i] [--debugger DEBUGGER] [-s]
48
+ [--check-exitcode] [--unix] [--randomize-ports] [--collect-only]
49
+ [--tls] [--tls-cert-file TLS_CERT_FILE]
50
+ [--tls-key-file TLS_KEY_FILE]
51
+ [--tls-ca-cert-file TLS_CA_CERT_FILE]
52
+
53
+ Test Framework for redis and redis module
54
+
55
+ optional arguments:
56
+ -h, --help show this help message and exit
57
+ --version Print RLTest version and exit (default: False)
58
+ --module MODULE path to the module file. You can use `--module` more
59
+ than once but it imples that you explicitly specify
60
+ `--module-args` as well. Notice that on enterprise the
61
+ file should be a zip file packed with
62
+ [RAMP](https://github.com/RedisLabs/RAMP). (default:
63
+ None)
64
+ --module-args MODULE_ARGS
65
+ arguments to give to the module on loading (default:
66
+ None)
67
+ --env {oss,oss-cluster,enterprise,enterprise-cluster,existing-env,cluster_existing-env}, -e {oss,oss-cluster,enterprise,enterprise-cluster,existing-env,cluster_existing-env}
68
+ env on which to run the test (default: oss)
69
+ --existing-env-addr EXISTING_ENV_ADDR
70
+ Address of existing env, relevent only when running
71
+ with existing-env, cluster_existing-env (default:
72
+ localhost:6379)
73
+ --shards_ports SHARDS_PORTS
74
+ list of ports, the shards are listening to, relevent
75
+ only when running with cluster_existing-env (default:
76
+ None)
77
+ --cluster_address CLUSTER_ADDRESS
78
+ enterprise cluster ip, relevent only when running with
79
+ cluster_existing-env (default: None)
80
+ --oss_password OSS_PASSWORD
81
+ set redis password, relevant for oss and oss-cluster
82
+ environment (default: None)
83
+ --cluster_credentials CLUSTER_CREDENTIALS
84
+ enterprise cluster cluster_credentials
85
+ "username:password", relevent only when running with
86
+ cluster_existing-env (default: None)
87
+ --cluster_node_timeout CLUSTER_NODE_TIMEOUT
88
+ cluster node timeout in milliseconds
89
+ --internal_password INTERNAL_PASSWORD
90
+ Give an ability to execute commands on shards
91
+ directly, relevent only when running with
92
+ cluster_existing-env (default: )
93
+ --oss-redis-path OSS_REDIS_PATH
94
+ path to the oss redis binary (default: redis-server)
95
+ --enterprise-redis-path ENTERPRISE_REDIS_PATH
96
+ path to the enterprise redis binary (default:
97
+ ~/.RLTest/opt/redislabs/bin/redis-server)
98
+ --redis-config-file REDIS_CONFIG_FILE
99
+ path to the redis configuration file (default: None)
100
+ --stop-on-failure stop running on failure (default: False)
101
+ -x, --exit-on-failure
102
+ Stop test execution and exit on first assertion
103
+ failure (default: False)
104
+ --verbose, -v print more information about the test (default: 0)
105
+ --debug stop before each test allow gdb attachment (default:
106
+ False)
107
+ -t TEST, --test TEST Specify test to run, in the form of "file:test"
108
+ (default: None)
109
+ --env-only start the env but do not run any tests (default:
110
+ False)
111
+ --clear-logs deleting the log direcotry before the execution
112
+ (default: False)
113
+ --log-dir LOG_DIR directory to write logs to (default: ./logs)
114
+ --use-slaves run env with slaves enabled (default: False)
115
+ --shards-count SHARDS_COUNT
116
+ Number shards in bdb (default: 1)
117
+ --download-enterprise-binaries
118
+ run env with slaves enabled (default: False)
119
+ --proxy-binary-path PROXY_BINARY_PATH
120
+ dmc proxy binary path (default:
121
+ ~/.RLTest/opt/redislabs/bin/dmcproxy)
122
+ --enterprise-lib-path ENTERPRISE_LIB_PATH
123
+ path of needed libraries to run enterprise binaries
124
+ (default: ~/.RLTest/opt/redislabs/lib/)
125
+ -r, --env-reuse reuse exists env, this feature is based on best
126
+ efforts, if the env can not be reused then it will be
127
+ taken down. (default: False)
128
+ --use-aof use aof instead of rdb (default: False)
129
+ --use-rdb-preamble use rdb preamble when rewriting aof file (default: True)
130
+ --debug-print print debug messages (default: False)
131
+ -V, --vg, --use-valgrind
132
+ running redis under valgrind (assuming valgrind is
133
+ install on the machine) (default: False)
134
+ --vg-suppressions VG_SUPPRESSIONS
135
+ path valgrind suppressions file (default: None)
136
+ --vg-options VG_OPTIONS
137
+ valgrind [options] (default: None)
138
+ --vg-no-leakcheck Don't perform a leak check (default: False)
139
+ --vg-verbose Don't log valgrind output. Output to screen directly
140
+ (default: False)
141
+ --vg-no-fail-on-errors
142
+ Dont Fail test when valgrind reported any errors in
143
+ the run.By default on RLTest the return value from
144
+ Valgrind will be used to fail the tests.Use this
145
+ option when you wish to dry-run valgrind but not fail
146
+ the test on valgrind reported errors. (default: False)
147
+ -i, --interactive-debugger
148
+ runs the redis on a debuger (gdb/lldb)
149
+ interactivly.debugger interactive mode is only
150
+ possible on a single process and so unsupported on
151
+ cluste or with slaves.it is also not possible to use
152
+ valgrind on interactive mode.interactive mode direcly
153
+ applies: --no-output-catch and --stop-on-failure.it is
154
+ also implies that only one test will be run (if --env-
155
+ only was not specify), an error will be raise
156
+ otherwise. (default: False)
157
+ --debugger DEBUGGER Run specified command line as the debugger (default:
158
+ None)
159
+ -s, --no-output-catch
160
+ all output will be written to the stdout, no log
161
+ files. (default: False)
162
+ --check-exitcode Check redis process exit code (default: False)
163
+ --unix Use Unix domain sockets instead of TCP (default:
164
+ False)
165
+ --randomize-ports Randomize Redis listening port assignment rather
166
+ thanusing default port (default: False)
167
+ --collect-only Collect the tests and exit (default: False)
168
+ --tls Enable TLS Support and disable the non-TLS port
169
+ completely. TLS connections will be available at the
170
+ default non-TLS ports. (default: False)
171
+ --tls-cert-file TLS_CERT_FILE
172
+ /path/to/redis.crt (default: None)
173
+ --tls-key-file TLS_KEY_FILE
174
+ /path/to/redis.key (default: None)
175
+ --tls-ca-cert-file TLS_CA_CERT_FILE
176
+ /path/to/ca.crt (default: None)
177
+
178
+ ```
179
+
180
+ ## Sample usages
181
+
182
+ ### Multiple modules
183
+
184
+ ```
185
+ RLTest --module modules/module1.so --module-args '' --module modules/module2.so --module-args ''
186
+ ```
187
+
188
+ # Configuration File
189
+ By default, the framework search for configuration file on the current directory. The configuration file name is: config.txt.
190
+ It is possible to specify different configuration file on command line using the '@' prefix, for example:
191
+ ```
192
+ RLTest @myConfig.txt # search for myConfig.txt configuration file
193
+ ```
194
+ The configuration file format is the same as the command line argument, i.e : '--< param_name > < param_val >'.
195
+
196
+ It is also possible to comment a specific lines in the configuration file using '#'.
197
+
198
+ Example:
199
+
200
+ ```
201
+ -vv
202
+ --clear-logs
203
+ #--debug
204
+ ```
205
+
206
+
207
+ # Test Example
208
+
209
+ ```python
210
+ from RLTest import Env
211
+ import time
212
+
213
+
214
+ class testExample():
215
+ '''
216
+ run all tests on a single env without taking
217
+ env down between tests
218
+ '''
219
+ def __init__(self):
220
+ self.env = Env()
221
+
222
+ def testExample(self):
223
+ con = self.env.getConnection()
224
+ con.set('x', 1)
225
+ self.env.assertEqual(con.get('x'), '1')
226
+
227
+ def testExample1(self):
228
+ con = self.env.getConnection()
229
+ con.set('x', 1)
230
+ self.env.assertEqual(con.get('x'), '1')
231
+ self.env.assertFalse(True) # check failure
232
+
233
+ def testExample2(self):
234
+ con = self.env.getConnection()
235
+ con.set('x', 1)
236
+ self.env.assertEqual(con.get('x'), '1')
237
+
238
+
239
+ # run each test on different env
240
+ def test_example():
241
+ env = Env()
242
+ con = env.getConnection()
243
+ con.set('x', 1)
244
+ env.assertEqual(con.get('x'), '1')
245
+
246
+
247
+ def test_example_2():
248
+ env = Env()
249
+ env.assertOk(env.cmd('set', 'x', '1'))
250
+ env.expect('get', 'x').equal('1')
251
+
252
+ env.expect('lpush', 'list', '1', '2', '3').equal(3)
253
+ env.expect('lrange', 'list', '0', '-1').debugPrint().contains('1')
254
+ env.debugPrint('this is some debug printing')
255
+
256
+
257
+ def test_example_3():
258
+ env = Env(useSlaves=True, env='oss')
259
+ con = env.getConnection()
260
+ con.set('x', 1)
261
+ con2 = env.getSlaveConnection()
262
+ time.sleep(0.1)
263
+ env.assertEqual(con2.get('x'), '1')
264
+
265
+ ```