auth.tcl 735 B

123456789101112131415161718192021222324252627
  1. start_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*any password*}
  6. }
  7. start_server {tags {"auth"} overrides {requirepass foobar}} {
  8. test {AUTH fails when a wrong password is given} {
  9. catch {r auth wrong!} err
  10. set _ $err
  11. } {WRONGPASS*}
  12. test {Arbitrary command gives an error when AUTH is required} {
  13. catch {r set foo bar} err
  14. set _ $err
  15. } {NOAUTH*}
  16. test {AUTH succeeds when the right password is given} {
  17. r auth foobar
  18. } {OK}
  19. test {Once AUTH succeeded we can actually send commands to the server} {
  20. r set foo 100
  21. r incr foo
  22. } {101}
  23. }