mirror of
http://github.com/valkey-io/valkey
synced 2024-11-22 18:54:58 +00:00
b87815c1f8
This way the behavior is very similar to the past one. This is useful in order to remember the user she probably failed to configure a password correctly.
28 lines
735 B
Tcl
28 lines
735 B
Tcl
start_server {tags {"auth"}} {
|
|
test {AUTH fails if there is no password configured server side} {
|
|
catch {r auth foo} err
|
|
set _ $err
|
|
} {ERR*any password*}
|
|
}
|
|
|
|
start_server {tags {"auth"} overrides {requirepass foobar}} {
|
|
test {AUTH fails when a wrong password is given} {
|
|
catch {r auth wrong!} err
|
|
set _ $err
|
|
} {WRONGPASS*}
|
|
|
|
test {Arbitrary command gives an error when AUTH is required} {
|
|
catch {r set foo bar} err
|
|
set _ $err
|
|
} {NOAUTH*}
|
|
|
|
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}
|
|
}
|