assert_equal "This user has no permissions to access the 'nopattern1' channel"[r ACL DRYRUN testuser getchannels.command subscribe literal channel subscribe literal nopattern1]
assert_equal "This user has no permissions to access the 'nopattern1' channel"[r ACL DRYRUN testuser getchannels.command publish literal channel subscribe literal nopattern1]
assert_equal "This user has no permissions to access the 'otherchannel' channel"[r ACL DRYRUN testuser getchannels.command subscribe literal otherchannel subscribe literal pattern1]
assert_equal "This user has no permissions to access the 'otherchannel' channel"[r ACL DRYRUN testuser getchannels.command publish literal otherchannel subscribe literal pattern1]
assert_equal "This user has no permissions to access the 'pattern1' channel"[r ACL DRYRUN testuser getchannels.command subscribe pattern pattern1 subscribe pattern pattern*]
assert_equal "This user has no permissions to access the 'pattern1' channel"[r ACL DRYRUN testuser getchannels.command publish pattern pattern1 subscribe pattern pattern*]
assert_equal "This user has no permissions to access the 'otherpattern*' channel"[r ACL DRYRUN testuser getchannels.command subscribe pattern otherpattern* subscribe pattern pattern*]
assert_equal "This user has no permissions to access the 'otherpattern*' channel"[r ACL DRYRUN testuser getchannels.command publish pattern otherpattern* subscribe pattern pattern*]
# redis.pcall() failure due to scripting specific error state (write cmd with eval_ro) returns lua error table with Redis error message without '-' prefix
r config resetstat
assert_equal [
r eval_ro {
local t = redis.pcall('set','x','y')
if t['err'] == "ERR Write commands are not allowed from read-only scripts." then
return 1
else
return 0
end
} 1 x
] 1
assert_equal [errorrstat ERR r]{count=1}
assert_equal [s total_error_replies]{1}
assert_match {calls=0*rejected_calls=1,failed_calls=0*}[cmdrstat set r]