From 6cec82b94374075405d791827e3a2d55a1c06366 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 28 Jan 2019 12:06:25 +0100 Subject: [PATCH] ACL: Test: check passwords validity and removal. --- tests/unit/acl.tcl | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/unit/acl.tcl b/tests/unit/acl.tcl index e294c6c8..6e66e311 100644 --- a/tests/unit/acl.tcl +++ b/tests/unit/acl.tcl @@ -14,7 +14,24 @@ start_server {tags {"acl"}} { } {*WRONGPASS*} test {Enabling the user allows the login} { - r ACL setuser newuser on + r ACL setuser newuser on +acl r AUTH newuser passwd1 - } {OK} + r ACL WHOAMI + } {newuser} + + test {Only the set of correct passwords work} { + r ACL setuser newuser >passwd2 + catch {r AUTH newuser passwd1} e + assert {$e eq "OK"} + catch {r AUTH newuser passwd2} e + assert {$e eq "OK"} + catch {r AUTH newuser passwd3} e + set e + } {*WRONGPASS*} + + test {It is possible to remove passwords from the set of valid ones} { + r ACL setuser newuser