1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

dovecot: Add tests for more error cases

This patch adds more tests for the dovecot library, in particular:
 - Protocol errors (invalid versions, etc.).
 - Invalid command (cli-specific test).
 - Connection breakups.
This commit is contained in:
Alberto Bertogli
2018-06-04 01:20:51 +01:00
parent 36692b52d3
commit cf81fbee74
6 changed files with 104 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
# Invalid version
userdb unix_listen .dovecot-userdb
c = ./dovecot-auth-cli .dovecot exists username
userdb -> VERSION 0
c <~ no: error receiving version
c wait 0
# No SPID (send "NOSPID" instead
userdb unix_listen .dovecot-userdb
c = ./dovecot-auth-cli .dovecot exists username
userdb -> VERSION 1 1
userdb -> NOSPID
c <~ no: error receiving SPID:
c wait 0
# Break before sending the final response.
userdb unix_listen .dovecot-userdb
c = ./dovecot-auth-cli .dovecot exists username
userdb -> VERSION 1 1
userdb -> SPID 12345
userdb <- VERSION 1 1
userdb <- USER 1 username service=smtp
userdb close
c <- no: error receiving response: EOF
c wait 0