1
0
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:
Alberto Bertogli
2018-02-25 03:24:57 +00:00
parent 61d2961ee9
commit 420754b0a0
2 changed files with 14 additions and 0 deletions

View File

@@ -269,4 +269,10 @@ func TestReload(t *testing.T) {
t.Errorf("unexpected reload counts: %d %d %d != 2 2 2",
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)
}
}

View File

@@ -96,6 +96,14 @@ func TestAutodetect(t *testing.T) {
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 {
addr, err := net.ResolveUnixAddr("unix", path)
if err != nil {