]> git.saurik.com Git - redis.git/blame - tests/unit/auth.tcl
Added a new hash fuzzy tester.
[redis.git] / tests / unit / auth.tcl
CommitLineData
ab52d1f4 1start_server {tags {"auth"}} {
2 test {AUTH fails if there is no password configured server side} {
3 catch {r auth foo} err
4 set _ $err
5 } {ERR*no password*}
6}
7
7f7499ee 8start_server {tags {"auth"} overrides {requirepass foobar}} {
98578b57
PN
9 test {AUTH fails when a wrong password is given} {
10 catch {r auth wrong!} err
ab52d1f4 11 set _ $err
98578b57
PN
12 } {ERR*invalid password}
13
14 test {Arbitrary command gives an error when AUTH is required} {
15 catch {r set foo bar} err
ab52d1f4 16 set _ $err
98578b57
PN
17 } {ERR*operation not permitted}
18
19 test {AUTH succeeds when the right password is given} {
20 r auth foobar
21 } {OK}
ab52d1f4 22
23 test {Once AUTH succeeded we can actually send commands to the server} {
24 r set foo 100
25 r incr foo
26 } {101}
98578b57 27}