Commit Graph

275 Commits

Author SHA1 Message Date
Yossi Gottlieb
b087dd1db6 TLS: Connections refactoring and TLS support.
* Introduce a connection abstraction layer for all socket operations and
integrate it across the code base.
* Provide an optional TLS connections implementation based on OpenSSL.
* Pull a newer version of hiredis with TLS support.
* Tests, redis-cli updates for TLS support.
2019-10-07 21:06:13 +03:00
Madelyn Olson
ea7c3fe7fd Allowed passing in of password hash and fixed config rewrite 2019-09-30 17:57:49 +02:00
Oran Agra
c56b4ddc6f prevent diskless replica from terminating on short read
now that replica can read rdb directly from the socket, it should avoid exiting
on short read and instead try to re-sync.

this commit tries to have minimal effects on non-diskless rdb reading.
and includes a test that tries to trigger this scenario on various read cases.
2019-07-17 16:46:22 +02:00
Oran Agra
2de544cfcc diskless replication on slave side (don't store rdb to file), plus some other related fixes
The implementation of the diskless replication was currently diskless only on the master side.
The slave side was still storing the received rdb file to the disk before loading it back in and parsing it.

This commit adds two modes to load rdb directly from socket:
1) when-empty
2) using "swapdb"
the third mode of using diskless slave by flushdb is risky and currently not included.

other changes:
--------------
distinguish between aof configuration and state so that we can re-enable aof only when sync eventually
succeeds (and not when exiting from readSyncBulkPayload after a failed attempt)
also a CONFIG GET and INFO during rdb loading would have lied

When loading rdb from the network, don't kill the server on short read (that can be a network error)

Fix rdb check when performed on preamble AOF

tests:
run replication tests for diskless slave too
make replication test a bit more aggressive
Add test for diskless load swapdb
2019-07-08 15:37:48 +03:00
Oran Agra
d0850369c4 fix small test suite race conditions 2018-11-12 10:26:10 +02:00
maya-rv
227965221a
Fix typo 2018-09-04 13:32:02 +03:00
Oran Agra
7829287691 test suite conveniency improvements
* allowing --single to be repeated
* adding --only so that only a specific test inside a unit can be run
* adding --skiptill useful to resume a test that crashed passed the problematic unit.
  useful together with --clients 1
* adding --skipfile to use a file containing list of tests names to skip
* printing the names of the tests that are skiped by skipfile or denytags
* adding --config to add config file options from command line
2018-07-30 19:13:15 +03:00
antirez
3d7d20b7f3 Test: fix lshuffle by providing the "K" combinator. 2018-07-13 17:52:39 +02:00
antirez
967ad3643c Test: add lshuffle in the Tcl utility functions set. 2018-07-13 17:51:03 +02:00
Oran Agra
751eea24c4 test suite infra improvements and fix
* fail the test (exit code) in case of timeout.
* add --wait-server to allow attaching a debugger
* add --dont-clean to keep log files when tests are done
2018-06-26 20:23:55 +03:00
antirez
8444b46d20 Fix test "server is up" detection after logging changes. 2016-12-19 16:49:58 +01:00
Oran Agra
5e3880a492 various cleanups and minor fixes 2016-04-25 16:49:57 +03:00
antirez
5b7b235367 Fix to Cluster test to support @busport format. 2016-02-02 11:03:53 +01:00
antirez
36be34bb87 Test: support for stack logging for OSX malloc/leaks. 2015-10-01 13:02:25 +02:00
antirez
175707e550 Test: csvdump now scans all DBs. 2015-08-05 12:27:15 +02:00
antirez
386804246f Test: be more patient waiting for servers to exit.
This should likely fix a false positive when running with the --valgrind
option.
2015-03-31 23:43:38 +02:00
Matt Stancliff
491d57abaa Add --track-origins=yes to valgrind 2015-01-21 15:48:19 +01:00
antirez
f3fd58eb4a Cluster test: also write from Lua script in resharding test. 2015-01-09 11:23:22 +01:00
Matt Stancliff
5e362b84ab Add quicklist implementation
This replaces individual ziplist vs. linkedlist representations
for Redis list operations.

Big thanks for all the reviews and feedback from everybody in
https://github.com/antirez/redis/pull/2143
2015-01-02 11:16:08 -05:00
antirez
fe0d371995 Test: wait for actual startup in start_server.
start_server now uses return value from Tcl exec to get the server pid,
however this introduces errors that depend from timing: a lot of the
testing code base assumed the server to be actually up and running when
server_start returns.

So the old code that waits to see the pid in the log file was restored.
2014-11-28 11:49:26 +01:00
antirez
bd3a51615c Test: try to cleanup still running Redis instances on exit.
It's hard to run the Redis test continuously if it leaks processes on
exceptions / errors.
2014-11-28 11:38:17 +01:00
Matt Stancliff
1cedebb799 Remove trailing spaces from tests 2014-09-29 06:49:08 -04:00
Matt Stancliff
09cb281bc3 Fix spelling in some test cases 2014-09-29 06:49:08 -04:00
Mariano Pérez Rodríguez
5afe1e37c7 Stop tests from leaving a black background
Uses ANSI "default background" color code after closing tests
so any non-black terminals don't remain polluted.

Fixes #1649
Closes #1912
2014-08-25 10:14:03 +02:00
antirez
e01195e90d Test: AOF rewrite during write load. 2014-07-10 11:25:12 +02:00
antirez
54157bc49e Test: find_available_port: check that cluster port is free as well.
The function will only return ports that have also port+10000 free, so
that Redis Cluster instances can be executed at the returned port.
2014-06-30 12:08:24 +02:00
antirez
670d164fbe Test: Tcl client initial support for automatic reconnection. 2014-06-18 15:52:14 +02:00
antirez
9162b5f8f9 Test: tcl client, unset deferred var on close. 2014-06-18 15:07:08 +02:00
Matt Stancliff
6c16ecaaaa Fix test framework to detect proper server PID
Previously the PID format was:
[PID] Timestamp

But it recently changed to:
PID:X Timestamp

The tcl testing framework was grabbing the PID from \[\d+\], but
that's not valid anymore.

Now we grab the pid from "PID: <PID>" in the part of Redis startup
output to the right of the ASCII logo.
2014-05-23 13:54:29 -04:00
antirez
27ca133d35 cluster.tcl: fix redis links leak in refresh_nodes_map. 2014-05-14 09:10:03 +02:00
antirez
cdf2271c5b cluster.tcl: saner error handling.
Better handling of connection errors in order to update the table and
recovery, populate the startup nodes table after fetching the list of
nodes.

More work to do about it, it is still not as reliable as
redis-rb-cluster implementation which is the minimal reference
implementation for Redis Cluster clients.
2014-05-14 00:15:52 +02:00
antirez
bae30479fb redis.tcl: return I/O error message when peer closes connection. 2014-05-14 00:14:35 +02:00
antirez
088b9eadc4 Test: handle new osx 'leaks' error.
Sometimes the process is still there but no longer in a state that can
be checked (after being killed). This used to happen after a call to
SHUTDOWN NOSAVE in the scripting unit, causing a false positive.
2014-05-07 16:12:32 +02:00
antirez
3bc119c155 Cluster: Tcl cluster client: handle MOVED/ASK. 2014-05-02 15:35:08 +02:00
antirez
fcd2065f8e Cluster: Tcl cluster client: slots-nodes map and close method.
Now the client is able to actually run commands in a Redis Cluster
assuming the slots->nodes map is stable.
2014-05-02 10:56:02 +02:00
antirez
5344357f80 Cluster: Tcl cluster client: build nodes representation. 2014-05-02 10:19:28 +02:00
antirez
8b7e23bdde Cluster: Tcl cluster client: get nodes description. 2014-05-02 09:55:27 +02:00
antirez
bc8ea04a7d Cluster: Tcl cluster client key -> hashslot. 2014-04-30 18:55:28 +02:00
antirez
e8357d0f85 Cluster test: Tcl cluster library initial skeleton. 2014-04-30 15:47:19 +02:00
antirez
9e0b9f12b2 Test: do not complain when "leaks" can't run because process died. 2014-03-25 09:33:37 +01:00
antirez
8c254415f7 Sentinel test: framework improved and conf-update unit added.
It is now possible to kill and restart sentinel or redis instances for
more real-world testing.

The 01 unit tests the capability of Sentinel to update the configuration
of Sentinels rejoining the cluster, however the test is pretty trivial
and more tests should be added.
2014-02-22 17:27:49 +01:00
antirez
34c404e069 Test: colorstr moved to util.tcl. 2014-02-17 17:36:50 +01:00
antirez
a1dca2efab Test: code to test server availability refactored.
Some inline test moved into server_is_up procedure.
Also find_available_port was moved into util since it is going
to be used for the Sentinel test as well.
2014-02-17 16:44:57 +01:00
antirez
d1f2d0733c Test: randomInt() behavior commented. 2013-06-25 15:32:37 +02:00
antirez
434a86dbd8 Tests added for min-slaves feature. 2013-05-30 18:54:28 +02:00
antirez
dc24a6b132 Return a specific NOAUTH error if authentication is required. 2013-02-12 16:25:41 +01:00
antirez
a18ca73681 Test: fixed osx "leaks" support in test.
Due to changes in recent releases of osx leaks utility, the osx leak
detection no longer worked. Now it is fixed in a way that should be
backward compatible.
2012-12-03 12:06:38 +01:00
YAMAMOTO Takashi
164d57c60d fix a typo in a comment 2012-10-24 17:47:56 +09:00
antirez
c0de45924c New test: hash ziplist -> hashtable encoding conversion.
A new stress test was added to stress test the code converting a ziplist
into an hash table.

In this commit also randomValue helper function was modified to also
return negative values.
2012-06-11 15:19:46 +02:00
antirez
80e808b6d6 EVAL replication test: less false positives.
wait_for_condition is now used instead of the usual "after 1000" (that
is the way to sleep in Tcl). This should avoid to find the replica in
a state where it is loading the RDB in memory, returning -LOADING error.

This test used to fail when running the test over valgrind, due to the
added latencies.
2012-06-02 23:29:57 +02:00
antirez
bc70b8e5f4 Tests modified to account for INFO fields renaming.
Commit 33e1db36fa modified the name of a
few INFO fields. This commit changes the Redis test to account for this
changes.
2012-05-25 15:20:59 +02:00
antirez
2bcd18a2e9 Redis test: include bug report on crash.
Due to a change in the format of the bug report in case of crash of
failed assertion the test suite was no longer able to properly log it.
Instead just a protocol error was logged by the Redis TCL client that
provided no clue about the actual problem.

This commit resolves the issue by logging everything from the first line
of the log including the string REDIS BUG REPORT, till the end of the
file.
2012-05-22 13:13:24 +02:00
antirez
28ccb53008 Redis test: More reliable BRPOPLPUSH replication test.
Now it uses the new wait_for_condition testing primitive.
Also wait_for_condition implementation was fixed in this commit to properly
escape the expr command and its argument.
2012-04-26 11:25:13 +02:00
antirez
5080e625d3 Redis test: scripting EVALSHA replication test more reliable.
A new primitive wait_for_condition was introduced in the scripting
engine that makes waiting for events simpler, so that it is simpler to
write tests that are more resistant to timing issues.
2012-04-26 11:16:52 +02:00
Michael Schlenker
875944a23f Replace unnecessary calls to echo and cat
Tcl's exec can send data to stdout itself, no need to call cat/echo for
that usually.
2012-04-17 22:20:54 +02:00
antirez
ff79ab71db redis.tcl: no longer leave unread replies if an error happens during a MULTI/EXEC block. 2012-04-06 23:52:28 +02:00
Premysl Hruby
9184f8fd00 in kill_server send the signal once, then wait for up to 5sec before sending lethal SIGKILL 2012-04-03 14:20:52 +02:00
antirez
0fefb5bbeb Redis test: regexp to check if valgrind reported errors modified. Now we no longer look at the total count because this includes "possibly lost" bytes that are not interesting for Redis (tons of false positives because of how sds.c works). 2012-03-28 10:55:17 +02:00
antirez
0f9997845a Merge remote-tracking branch 'origin/unstable' into unstable 2012-03-24 12:07:58 +01:00
antirez
74f10793c8 When running the test in valgrind mode, pass the right flags to show memory leaks stack traces but only including the "definitely lost" items. 2012-03-24 12:07:14 +01:00
antirez
7dcdd281f5 DEBUG should not be flagged as w otherwise we can not call DEBUG DIGEST and other commands against read only slaves. 2012-03-20 17:53:47 +01:00
antirez
414c3deac1 Regression test for the main problem causing issue #141. Minor changes/fixes/additions to the test suite itself needed to write the test. 2012-01-06 17:28:40 +01:00
antirez
202e3091d7 Redis test: when assertion fails print not just the expression but also expanded values in the error message. 2011-12-21 09:23:22 +01:00
antirez
b1d08d4540 Redis test: wait more time for the server to start if it is running using valgrind. 2011-12-07 17:51:21 +01:00
antirez
846bcd9abe Redis test: handle inability to start the server in a better way. 2011-12-07 11:47:38 +01:00
antirez
bf758397a1 more valgrind (and other archs) friendly testing of floating number related features. 2011-11-16 14:40:50 +01:00
antirez
24bfb570ee Redis test ports selection made more robust. This prevents the test from hanging if an already bound port is selected but the TCP server listening to it does not cause a protocol error with a Redis client PING. Also base port moved away from the range near to the Redis Cluster gossip ports. 2011-10-04 10:05:21 +02:00
antirez
e54484876a fixed assert proc on Redis test 2011-07-28 12:31:44 +02:00
antirez
4c378d7f6c new test engine valgrind support 2011-07-11 13:41:06 +02:00
antirez
121ffc85f4 better recap of failed tests. 2011-07-11 12:56:00 +02:00
antirez
82e5dd35ea display less useless information in parallel test 2011-07-11 00:14:12 +02:00
antirez
3744824c3e some test colorization and some fix 2011-07-11 00:09:56 +02:00
antirez
13566085cf Initial implementation of a client-server parallel testing system for Redis in order to speedup execution of the test suite. 2011-07-10 23:25:48 +02:00
antirez
5ab1461f98 The test now gives some more time for Redis to start before of exiting with an error, since starting with valgrind can take a significant amount of time. 2011-07-09 19:23:46 +02:00
antirez
cabe03eb75 more valgrind friendly test 2011-07-06 15:22:00 +02:00
antirez
72dff2c084 test fixed after ascii art banner modified the output of a running server 2011-04-15 16:35:54 +02:00
antirez
4a67d194e9 fixed color support for test suite. Now colors are shown as long as there is xterm somewhere inside the TERM env var 2011-02-22 16:41:27 +01:00
antirez
5e1d2d30f7 initial fix of the test suite to run both in in-memory and diskstore mode 2011-01-09 16:49:52 +01:00
antirez
5d46e370b7 diskstore more fixes 2011-01-03 17:18:37 +01:00
antirez
180e07b8c0 fixed test rendering when test failed in non verbose mode 2010-12-15 11:04:04 +01:00
antirez
7982173fef print test names inline in the non verbose output mode 2010-12-15 10:44:36 +01:00
antirez
eae9cce166 colorized make test output when the verbose output is disabled (default) 2010-12-15 10:14:34 +01:00
antirez
d6107fd6f1 Merge remote branch 'pietern/testverbosity' 2010-12-10 17:24:03 +01:00
Pieter Noordhuis
6f8a32d5c7 Be less verbose in testing; improve error handling 2010-12-10 16:13:21 +01:00
antirez
4b918769a1 command line option in test suite to activate valgrind mode 2010-12-10 15:40:48 +01:00
antirez
4d7e125519 minor test suite bug fixed 2010-11-04 10:48:49 +01:00
Pieter Noordhuis
5b12b47df9 Show output of leaks command on a leak 2010-10-15 15:56:16 +02:00
Pieter Noordhuis
00cf82c0bd Change tcl client to only use the multibulk protocol 2010-10-15 15:50:29 +02:00
Pieter Noordhuis
941c9fa285 Return OK on QUIT 2010-10-13 11:25:40 +02:00
antirez
08f55b786b faster server starting in Redis tests 2010-08-31 11:17:06 +02:00
Pieter Noordhuis
a53ebb4c8e Don't abort test suite when the server block has a return value 2010-08-21 10:54:31 +02:00
antirez
6146329f1f replication test with expires 2010-08-03 13:38:39 +02:00
Pieter Noordhuis
6825491928 Fix assertion function on value encoding 2010-08-01 11:20:26 +02:00
Pieter Noordhuis
86d392498b ensure the value is swapped in before testing its encoding 2010-07-29 13:31:24 +02:00
antirez
a0573260b0 better random dataset creation function in test. master-slave replication test now is able to save the two datasets in CSV when an inconsistency is detected. 2010-07-28 14:08:46 +02:00
antirez
dd3f505ff5 Consistency test improved 2010-07-27 14:42:11 +02:00
antirez
b056ca39f2 improved random dataset creation in test: del, sunionstore, zunionstore 2010-07-06 18:30:38 +02:00
antirez
e2641e09cc redis.c split into many different C files.
networking related stuff moved into networking.c

moved more code

more work on layout of source code

SDS instantaneuos memory saving. By Pieter and Salvatore at VMware ;)

cleanly compiling again after the first split, now splitting it in more C files

moving more things around... work in progress

split replication code

splitting more

Sets split

Hash split

replication split

even more splitting

more splitting

minor change
2010-07-01 14:38:51 +02:00
Pieter Noordhuis
c2ff0e90b8 more pub/sub tests 2010-06-16 11:03:23 +02:00
Pieter Noordhuis
4589a823fd initial basic pub/sub tests 2010-06-16 11:01:42 +02:00
Pieter Noordhuis
5eedc9c65e tests for BLPOP/BRPOP via an option in the tcl client that defers reading the reply 2010-06-15 21:23:18 +02:00
antirez
d52e588869 Merge branch 'ltrim-tests' of git://github.com/pietern/redis 2010-06-14 10:22:38 +02:00
antirez
7d04fc7563 allow running the test suite against an external Redis instance, without auto spawning 2010-06-14 10:19:45 +02:00
Pieter Noordhuis
08b5920750 change ltrim tests to cover all min/max cases and add stronger stresser 2010-06-14 09:45:34 +02:00
Robey Pointer
dedff272f6 squashed merge from robey/twitter3: LINSERT BEFORE|AFTER, LPUSHX, RPUSHX 2010-06-11 10:09:46 +02:00
Pieter Noordhuis
d4507ec615 refactor list tests to test both encodings; implemented assert functions 2010-06-04 16:31:27 +02:00
Pieter Noordhuis
5a9fcb87ca tag memory leak check on kill server as "leaks" 2010-06-03 00:27:09 +02:00
Pieter Noordhuis
f6fa411d6c make sure the config it returned when called without code 2010-06-03 00:25:32 +02:00
Pieter Noordhuis
73bd6c583b pass tags to filter and match via arguments 2010-06-02 23:22:20 +02:00
Pieter Noordhuis
6e0e5bedd9 basic support to tag tests 2010-06-02 22:53:22 +02:00
Pieter Noordhuis
9e5d2e8bd6 changed how server.tcl accepts options to support more directives without requiring more arguments to the proc 2010-06-02 22:23:52 +02:00
Pieter Noordhuis
38273a9ed6 removed obsolete code 2010-06-02 21:53:15 +02:00
Pieter Noordhuis
436f18b618 catch exceptions in the server proc, to be able to kill the entire chain of running servers 2010-06-02 21:53:10 +02:00
antirez
9b30e1a207 WATCH is now able to detect keys removed by FLUSHALL and FLUSHDB 2010-05-25 19:30:24 +02:00
antirez
c22b2ec863 by default test with valgrind does not show full leak info 2010-05-21 13:58:04 +02:00
antirez
c4669d257f tests suite initial support for valgrind, fixed the old test suite until the new one is able to target a specific host/port 2010-05-21 12:00:13 +02:00
Pieter Noordhuis
f166bb1d50 code to enable running tests with the vm enabled 2010-05-20 13:58:58 +02:00
Pieter Noordhuis
53cbf66caf initial tests for AOF (and small changes to server.tcl to support these) 2010-05-19 14:54:20 +02:00
Pieter Noordhuis
46b614edf7 Merge branch 'master' into integration 2010-05-19 14:53:57 +02:00
Pieter Noordhuis
fdfb02e7ff print warnings in redis log when a test raises an exception (very likely to be caused by something like a failed assertion) 2010-05-15 23:48:08 +02:00
antirez
76a224700d added pid info to the check memory leaks test, so that those tests don't appear to be duplicated 2010-05-15 00:43:43 +02:00
Pieter Noordhuis
85ecc65edc initial rough integration test for replication 2010-05-14 20:50:58 +02:00
Pieter Noordhuis
1c4114be40 store entire server object on the stack instead of just the client 2010-05-14 20:50:32 +02:00
Pieter Noordhuis
9cf9e6f197 proc to retrieve values from INFO properties 2010-05-14 20:48:57 +02:00
antirez
ab72b4833d minor fixes to the new test suite, html doc updated 2010-05-14 18:48:33 +02:00