redict/tests/unit
Oran Agra c31055db61 Sanitize dump payload: fuzz tester and fixes for segfaults and leaks it exposed
The test creates keys with various encodings, DUMP them, corrupt the payload
and RESTORES it.
It utilizes the recently added use-exit-on-panic config to distinguish between
 asserts and segfaults.
If the restore succeeds, it runs random commands on the key to attempt to
trigger a crash.

It runs in two modes, one with deep sanitation enabled and one without.
In the first one we don't expect any assertions or segfaults, in the second one
we expect assertions, but no segfaults.
We also check for leaks and invalid reads using valgrind, and if we find them
we print the commands that lead to that issue.

Changes in the code (other than the test):
- Replace a few NPD (null pointer deference) flows and division by zero with an
  assertion, so that it doesn't fail the test. (since we set the server to use
  `exit` rather than `abort` on assertion).
- Fix quite a lot of flows in rdb.c that could have lead to memory leaks in
  RESTORE command (since it now responds with an error rather than panic)
- Add a DEBUG flag for SET-SKIP-CHECKSUM-VALIDATION so that the test don't need
  to bother with faking a valid checksum
- Remove a pile of code in serverLogObjectDebugInfo which is actually unsafe to
  run in the crash report (see comments in the code)
- fix a missing boundary check in lzf_decompress

test suite infra improvements:
- be able to run valgrind checks before the process terminates
- rotate log files when restarting servers
2020-12-06 14:54:34 +02:00
..
moduleapi Make sure we do not propagate nested MULTI/EXEC (#8097) 2020-12-06 13:14:18 +02:00
type Sanitize dump payload: improve tests of ziplist and stream encodings 2020-12-06 14:54:34 +02:00
acl.tcl Fix ACL Pub/Sub test timings (#8122) 2020-12-02 17:24:27 +02:00
aofrw.tcl AOF: run tests with preamble off when it makes sense. 2018-03-25 13:03:38 +02:00
auth.tcl ACL: AUTH + no default user password raises an error. 2019-01-17 18:30:23 +01:00
bitfield.tcl Fix BITFIELD_RO test. 2020-03-23 12:02:12 +01:00
bitops.tcl Regression test for #3282. 2016-06-15 11:49:49 +02:00
dump.tcl Test:Fix invalid cases in hash.tcl and dump.tcl (#4611) 2020-08-12 10:25:24 +08:00
expire.tcl fix broken PEXPIREAT test (#7791) 2020-09-13 13:50:23 +03:00
geo.tcl Revert "Geo: output 10 chars of geohash, not 11." 2019-12-18 12:54:46 +01:00
hyperloglog.tcl Squash merging 125 typo/grammar/comment/doc PRs (#7773) 2020-09-10 13:43:38 +03:00
introspection-2.tcl EXISTS should not alter LRU, OBJECT should not reveal expired keys on replica (#8016) 2020-11-18 11:16:21 +02:00
introspection.tcl Sanitize dump payload: fuzz tester and fixes for segfaults and leaks it exposed 2020-12-06 14:54:34 +02:00
keyspace.tcl Improve dbid range check for SELECT, MOVE, COPY (#8085) 2020-12-01 21:41:26 +02:00
latency-monitor.tcl Add a --no-latency tests flag. (#7939) 2020-10-22 11:10:53 +03:00
lazyfree.tcl Test: basic lazyfree unit test. 2015-10-09 09:47:17 +02:00
limits.tcl TLS: Connections refactoring and TLS support. 2019-10-07 21:06:13 +03:00
maxmemory.tcl prevent client tracking from causing feedback loop in performEvictions (#8100) 2020-12-06 14:51:22 +02:00
memefficiency.tcl Fix test failure on slower systems. 2020-11-04 21:43:55 +02:00
multi.tcl Unified MULTI, LUA, and RM_Call with respect to blocking commands (#8025) 2020-11-17 18:58:55 +02:00
obuf-limits.tcl Fix new obuf-limits tests to work with TLS (#7848) 2020-09-27 17:13:33 +03:00
oom-score-adj.tcl Tests: fix oom-score-adj false positives. (#7772) 2020-09-09 18:58:06 +03:00
other.tcl Limit the main db and expires dictionaries to expand (#7954) 2020-12-06 11:53:04 +02:00
pendingquerybuf.tcl Slave removal: remove slave from top-level tests descriptions. 2018-09-11 15:32:28 +02:00
printver.tcl Print version info before running the test 2011-05-20 11:44:54 +02:00
protocol.tcl TLS: Connections refactoring and TLS support. 2019-10-07 21:06:13 +03:00
pubsub.tcl pubsub: Return integers for NUMSUB, not strings 2014-08-08 11:19:37 +02:00
quit.tcl Add tests for OK on QUIT 2010-10-15 12:54:53 +02:00
scan.tcl Implement SCAN cursor [TYPE type] modifier suggested in issue #6107. 2019-05-22 16:39:04 +01:00
scripting.tcl Unified MULTI, LUA, and RM_Call with respect to blocking commands (#8025) 2020-11-17 18:58:55 +02:00
shutdown.tcl Fix new obuf-limits tests to work with TLS (#7848) 2020-09-27 17:13:33 +03:00
slowlog.tcl Rewritten commands are logged as their original command (#8006) 2020-11-10 13:50:03 -08:00
sort.tcl Config: Add quicklist, remove old list options 2015-01-02 11:16:10 -05:00
tls.tcl Add optional tls verification (#7502) 2020-07-28 10:45:21 +03:00
tracking.tcl Extend client tracking tests (#7998) 2020-11-09 22:54:47 +02:00
wait.tcl Tests: fix redis-cli with remote hosts. (#7693) 2020-08-23 10:17:43 +03:00