Commit Graph

17 Commits

Author SHA1 Message Date
Mikhail Fesenko cbcdebe3b5 fflush stdout after responses partial backport from (#9136)
2. Make redis-cli flush stdout when printing a reply
  This was needed in order to fix a hung in redis-cli test that uses
  --replica.
   Note that printf does flush when there's a newline, but fwrite does not.

3. fix the redis-cli --replica test which used to pass previously
   because it didn't really care what it read, and because redis-cli
   used printf to print these other things to stdout.

4. improve redis-cli --replica test to run with both diskless and disk-based.

Co-authored-by: Oran Agra <oran@redislabs.com>
Co-authored-by: Viktor Söderqvist <viktor@zuiderkwast.se>
(cherry picked from commit 1eb4baa5b8)
(cherry picked from commit 8884971223)
2023-01-17 14:59:41 +02:00
Yossi Gottlieb 3c8b394511 Tests: clean up stale .cli files. (#7768)
(cherry picked from commit 918abd7276)
2020-09-10 14:09:00 +03:00
Yossi Gottlieb 8d79702d8a Tests: fix redis-cli with remote hosts. (#7693)
(cherry picked from commit f80f3f492a)
2020-09-01 09:27:58 +03:00
Yossi Gottlieb f1d5d5d28e Tests: drop TCL 8.6 dependency. (#7548)
This re-implements the redis-cli --pipe test so it no longer depends on a close feature available only in TCL 8.6.

Basically what this test does is run redis-cli --pipe, generates a bunch of commands and pipes them through redis-cli, and inspects the result in both Redis and the redis-cli output.

To do that, we need to close stdin for redis-cli to indicate we're done so it can flush its buffers and exit. TCL has bi-directional channels can only offers a way to "one-way close" a channel with TCL 8.6. To work around that, we now generate the commands into a file and feed that file to redis-cli directly.

As we're writing to an actual file, the number of commands is now reduced.

(cherry picked from commit f57e844b2e)
2020-09-01 09:27:58 +03:00
Oran Agra 05f8975d21 redis-cli tests, fix valgrind timing issue (#7519)
this test when run with valgrind on github actions takes 160 seconds

(cherry picked from commit 254c962554)
2020-07-20 21:08:26 +03:00
Oran Agra aea4db2f5a fix recently added time sensitive tests failing with valgrind (#7512)
interestingly the latency monitor test fails because valgrind is slow
enough so that the time inside PEXPIREAT command from the moment of
the first mstime() call to get the basetime until checkAlreadyExpired
calls mstime() again is more than 1ms, and that test was too sensitive.

using this opportunity to speed up the test (unrelated to the failure)
the fix is just the longer time passed to PEXPIRE.

(cherry picked from commit e5227aab89)
2020-07-20 21:08:26 +03:00
Yossi Gottlieb b057ff81ee TLS: Add missing redis-cli options. (#7456)
* Tests: fix and reintroduce redis-cli tests.

These tests have been broken and disabled for 10 years now!

* TLS: add remaining redis-cli support.

This adds support for the redis-cli --pipe, --rdb and --replica options
previously unsupported in --tls mode.

* Fix writeConn().

(cherry picked from commit d9f970d8d3)
2020-07-20 21:08:26 +03:00
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
Pieter Noordhuis b4b62c34db Use fstat to detect if stdin was redirected 2010-08-25 14:48:50 +02:00
Pieter Noordhuis f791d66e20 Make helper functions simpler 2010-08-25 14:15:41 +02:00
Pieter Noordhuis f9b252613b Comments in redis-cli tests 2010-08-25 14:08:32 +02:00
Pieter Noordhuis ae77016e57 Add a newline to tty output after every reply 2010-08-25 13:39:11 +02:00
Pieter Noordhuis 3a51bff035 Change output format for non-tty redis-cli execution 2010-08-04 17:46:56 +02:00
Pieter Noordhuis 123a10f7a5 Let the output mode depend on having a tty or not 2010-08-04 17:16:05 +02:00
Pieter Noordhuis 07242c0ccf Tests for redis-cli in non-interactive mode
Minor change in redis-cli output for the (multi-)bulk response but this
will be fixed in the next commit.
2010-08-04 17:02:13 +02:00
Pieter Noordhuis 0439d792c4 Add tests for quotation in an interactive redis-cli session
Patched redis-cli to abort on unexpected quotation. This caused
redis-cli to get into an infinite, memory-consuming loop.
2010-08-04 16:15:33 +02:00
Pieter Noordhuis f2dd4769dd Tests for the interactive mode of redis-cli
Changed redis-cli to output the raw response for a bulk reply when it is
run in interactive mode instead of checking isatty.
2010-08-04 15:28:03 +02:00