New tests for password stuff

svn: r12343
This commit is contained in:
Jay McCarthy 2008-11-07 17:23:56 +00:00
parent 72db2436c0
commit b90c1da006
2 changed files with 46 additions and 0 deletions

View File

@ -19,6 +19,46 @@
(read-configuration-table default-configuration-table-path)
(make-temporary-file))))
(test-case
"False allowed in configuration file for passwords"
(let ([false-sexpr
`((port 80)
(max-waiting 40)
(initial-connection-timeout 30)
(default-host-table
(host-table
(default-indices "index.html" "index.htm")
(log-format parenthesized-default)
(messages
(servlet-message "servlet-error.html")
(authentication-message "forbidden.html")
(servlets-refreshed "servlet-refresh.html")
(passwords-refreshed "passwords-refresh.html")
(file-not-found-message "not-found.html")
(protocol-message "protocol-error.html")
(collect-garbage "collect-garbage.html"))
(timeouts
(default-servlet-timeout 30)
(password-connection-timeout 300)
(servlet-connection-timeout 86400)
(file-per-byte-connection-timeout 1/20)
(file-base-connection-timeout 30))
(paths
(configuration-root "conf")
(host-root ".")
(log-file-path "log")
(file-root "htdocs")
(servlet-root ".")
(mime-types "mime.types")
(password-authentication #f))))
(virtual-host-table))])
(check-equal?
(configuration-table->sexpr
(sexpr->configuration-table
false-sexpr))
false-sexpr)))
(test-case
"Default configuration file may be converted to sexpr and back"
(check-not-false

View File

@ -62,6 +62,12 @@
"Distribution file parses"
(read-passwords default-passwords))
(test-exn
"False not allowed as password-file"
exn?
(lambda ()
(passwords:password-file->authorized? #f)))
(test-exn "authorized"
exn:dispatcher?
(lambda () (runt #t #t)))