mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-18 14:47:03 +00:00
auth, dovecot: Add missing Reload tests
auth.wrapNoErrorBackend.Reload and dovecot.Reload were not being tested; this patch fixes that by adding a simple test for each.
This commit is contained in:
@@ -269,4 +269,10 @@ func TestReload(t *testing.T) {
|
|||||||
t.Errorf("unexpected reload counts: %d %d %d != 2 2 2",
|
t.Errorf("unexpected reload counts: %d %d %d != 2 2 2",
|
||||||
be1.reloadCount, be2.reloadCount, fallback.reloadCount)
|
be1.reloadCount, be2.reloadCount, fallback.reloadCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a2 := NewAuthenticator()
|
||||||
|
a2.Register("domain", WrapNoErrorBackend(userdb.New("/dev/null")))
|
||||||
|
if err = a2.Reload(); err != nil {
|
||||||
|
t.Errorf("unexpected error reloading wrapped backend: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,6 +96,14 @@ func TestAutodetect(t *testing.T) {
|
|||||||
cL.Close()
|
cL.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestReload(t *testing.T) {
|
||||||
|
// Make sure Reload does not fail.
|
||||||
|
a := Auth{}
|
||||||
|
if err := a.Reload(); err != nil {
|
||||||
|
t.Errorf("Reload failed")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func mustListen(t *testing.T, path string) *net.UnixListener {
|
func mustListen(t *testing.T, path string) *net.UnixListener {
|
||||||
addr, err := net.ResolveUnixAddr("unix", path)
|
addr, err := net.ResolveUnixAddr("unix", path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user