summaryrefslogtreecommitdiff
path: root/tests/unit/acl.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/acl.tcl')
-rw-r--r--tests/unit/acl.tcl22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/unit/acl.tcl b/tests/unit/acl.tcl
index f423bf111..71cf9ae43 100644
--- a/tests/unit/acl.tcl
+++ b/tests/unit/acl.tcl
@@ -616,6 +616,28 @@ start_server {tags {"acl external:skip"}} {
# The test framework will detect a leak if any.
}
+ test {ACL LOG aggregates similar errors together and assigns unique entry-id to new errors} {
+ r ACL LOG RESET
+ r ACL setuser user1 >foo
+ assert_error "*WRONGPASS*" {r AUTH user1 doo}
+ set entry_id_initial_error [dict get [lindex [r ACL LOG] 0] entry-id]
+ set timestamp_created_original [dict get [lindex [r ACL LOG] 0] timestamp-created]
+ set timestamp_last_update_original [dict get [lindex [r ACL LOG] 0] timestamp-last-updated]
+ for {set j 0} {$j < 10} {incr j} {
+ assert_error "*WRONGPASS*" {r AUTH user1 doo}
+ }
+ set entry_id_lastest_error [dict get [lindex [r ACL LOG] 0] entry-id]
+ set timestamp_created_updated [dict get [lindex [r ACL LOG] 0] timestamp-created]
+ set timestamp_last_updated_after_update [dict get [lindex [r ACL LOG] 0] timestamp-last-updated]
+ assert {$entry_id_lastest_error eq $entry_id_initial_error}
+ assert {$timestamp_last_update_original < $timestamp_last_updated_after_update}
+ assert {$timestamp_created_original eq $timestamp_created_updated}
+ r ACL setuser user2 >doo
+ assert_error "*WRONGPASS*" {r AUTH user2 foo}
+ set new_error_entry_id [dict get [lindex [r ACL LOG] 0] entry-id]
+ assert {$new_error_entry_id eq $entry_id_lastest_error + 1 }
+ }
+
test {ACL LOG shows failed command executions at toplevel} {
r ACL LOG RESET
r ACL setuser antirez >foo on +set ~object:1234