2011-10-10 22:21:17 +02:00
|
|
|
start_server {tags {"auth"}} {
|
|
|
|
test {AUTH fails if there is no password configured server side} {
|
|
|
|
catch {r auth foo} err
|
|
|
|
set _ $err
|
2019-01-17 18:30:23 +01:00
|
|
|
} {ERR*any password*}
|
2011-10-10 22:21:17 +02:00
|
|
|
}
|
|
|
|
|
2010-06-02 23:14:55 +02:00
|
|
|
start_server {tags {"auth"} overrides {requirepass foobar}} {
|
2010-05-14 17:31:11 +02:00
|
|
|
test {AUTH fails when a wrong password is given} {
|
|
|
|
catch {r auth wrong!} err
|
2011-10-10 22:21:17 +02:00
|
|
|
set _ $err
|
2019-01-17 18:30:23 +01:00
|
|
|
} {WRONGPASS*}
|
2014-07-31 14:39:49 -04:00
|
|
|
|
2010-05-14 17:31:11 +02:00
|
|
|
test {Arbitrary command gives an error when AUTH is required} {
|
|
|
|
catch {r set foo bar} err
|
2011-10-10 22:21:17 +02:00
|
|
|
set _ $err
|
2013-02-12 16:25:41 +01:00
|
|
|
} {NOAUTH*}
|
2010-05-14 17:31:11 +02:00
|
|
|
|
|
|
|
test {AUTH succeeds when the right password is given} {
|
|
|
|
r auth foobar
|
|
|
|
} {OK}
|
2011-10-10 22:21:17 +02:00
|
|
|
|
|
|
|
test {Once AUTH succeeded we can actually send commands to the server} {
|
|
|
|
r set foo 100
|
|
|
|
r incr foo
|
|
|
|
} {101}
|
2010-05-14 17:31:11 +02:00
|
|
|
}
|