X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/ab72b4833d2054231437acccec36f32f07290075..ecd82f59fe5296de2733154bfcf1a4b95d4547aa:/tests/unit/auth.tcl?ds=sidebyside diff --git a/tests/unit/auth.tcl b/tests/unit/auth.tcl index 5bc83de8..bd4b8dca 100644 --- a/tests/unit/auth.tcl +++ b/tests/unit/auth.tcl @@ -1,15 +1,27 @@ -start_server default.conf {{requirepass foobar}} { +start_server {tags {"auth"}} { + test {AUTH fails if there is no password configured server side} { + catch {r auth foo} err + set _ $err + } {ERR*no password*} +} + +start_server {tags {"auth"} overrides {requirepass foobar}} { test {AUTH fails when a wrong password is given} { catch {r auth wrong!} err - format $err + set _ $err } {ERR*invalid password} test {Arbitrary command gives an error when AUTH is required} { catch {r set foo bar} err - format $err + set _ $err } {ERR*operation not permitted} test {AUTH succeeds when the right password is given} { r auth foobar } {OK} + + test {Once AUTH succeeded we can actually send commands to the server} { + r set foo 100 + r incr foo + } {101} }