summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMadelyn Olson <34459052+madolson@users.noreply.github.com>2022-11-15 17:21:27 -0800
committerGitHub <noreply@github.com>2022-11-15 17:21:27 -0800
commitd136bf28307ed2add5a0b709586433f4cffd70a7 (patch)
tree5cac166cf0237a3e211998080803641eb0bd94ef /tests
parenta4bcdbcfd3a055eb6320f31e5c710931708a9501 (diff)
downloadredis-d136bf28307ed2add5a0b709586433f4cffd70a7.tar.gz
Explicitly send function commands to monitor (#11510)
Both functions and eval are marked as "no-monitor", since we want to explicitly feed in the script command before the commands generated by the script. Note that we want this behavior generally, so that commands can redact arguments before being added to the monitor.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/introspection.tcl13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/unit/introspection.tcl b/tests/unit/introspection.tcl
index 1e994ab5a..aceec3cca 100644
--- a/tests/unit/introspection.tcl
+++ b/tests/unit/introspection.tcl
@@ -115,6 +115,19 @@ start_server {tags {"introspection"}} {
$rd close
}
+ test {MONITOR can log commands issued by functions} {
+ r function load replace {#!lua name=test
+ redis.register_function('test', function() return redis.call('set', 'foo', 'bar') end)
+ }
+ set rd [redis_deferring_client]
+ $rd monitor
+ $rd read ;# Discard the OK
+ r fcall test 0
+ assert_match {*fcall*test*} [$rd read]
+ assert_match {*lua*"set"*"foo"*"bar"*} [$rd read]
+ $rd close
+ }
+
test {MONITOR supports redacting command arguments} {
set rd [redis_deferring_client]
$rd monitor