diff options
Diffstat (limited to 'tests/unit/moduleapi/aclcheck.tcl')
-rw-r--r-- | tests/unit/moduleapi/aclcheck.tcl | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/tests/unit/moduleapi/aclcheck.tcl b/tests/unit/moduleapi/aclcheck.tcl index 94af2cc00..3fa3ed43f 100644 --- a/tests/unit/moduleapi/aclcheck.tcl +++ b/tests/unit/moduleapi/aclcheck.tcl @@ -20,11 +20,20 @@ start_server {tags {"modules acl"}} { test {test module check acl for key perm} { # give permission for SET and block all keys but x - r acl setuser default +set resetkeys ~x - assert_equal [r aclcheck.set.check.key x 5] OK - catch {r aclcheck.set.check.key y 5} e - set e - } {*DENIED KEY*} + r acl setuser default +set resetkeys ~x %W~y %R~z + + assert_equal [r aclcheck.set.check.key "*" x 5] OK + catch {r aclcheck.set.check.key "*" v 5} e + assert_match "*DENIED KEY*" $e + + assert_equal [r aclcheck.set.check.key "W" y 5] OK + catch {r aclcheck.set.check.key "W" v 5} e + assert_match "*DENIED KEY*" $e + + assert_equal [r aclcheck.set.check.key "R" z 5] OK + catch {r aclcheck.set.check.key "R" v 5} e + assert_match "*DENIED KEY*" $e + } test {test module check acl for module user} { # the module user has access to all keys |