diff options
| author | Mark Rushakoff <[email protected]> | 2018-02-23 15:35:58 -0800 |
|---|---|---|
| committer | Mark Rushakoff <[email protected]> | 2018-02-23 15:42:08 -0800 |
| commit | 82a8f44a2f4cf0686635d2a23ebb41a8f445194e (patch) | |
| tree | 50be4dd4cf5a89eb40f43393def27e14bc777034 /server_modify_test.go | |
| parent | 0fce9cb1f0426d07ce0967ecf2ed82bb4834084c (diff) | |
Simplify server bind functions
For our purposes, it doesn't need to route multiple functions across
different DNs, so use a simple function instead.
Diffstat (limited to 'server_modify_test.go')
| -rw-r--r-- | server_modify_test.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/server_modify_test.go b/server_modify_test.go index 6705343..78c1fde 100644 --- a/server_modify_test.go +++ b/server_modify_test.go @@ -15,7 +15,7 @@ func TestAdd(t *testing.T) { defer s.Close() ln, addr := mustListen() go func() { - s.BindFunc("", modifyTestHandler{}) + s.Bind = BindAnonOK s.AddFunc("", modifyTestHandler{}) if err := s.Serve(ln); err != nil { t.Errorf("s.Serve failed: %s", err.Error()) @@ -51,7 +51,7 @@ func TestDelete(t *testing.T) { defer s.Close() ln, addr := mustListen() go func() { - s.BindFunc("", modifyTestHandler{}) + s.Bind = BindAnonOK s.DeleteFunc("", modifyTestHandler{}) if err := s.Serve(ln); err != nil { t.Errorf("s.Serve failed: %s", err.Error()) @@ -83,7 +83,7 @@ func TestModify(t *testing.T) { defer s.Close() ln, addr := mustListen() go func() { - s.BindFunc("", modifyTestHandler{}) + s.Bind = BindAnonOK s.ModifyFunc("", modifyTestHandler{}) if err := s.Serve(ln); err != nil { t.Errorf("s.Serve failed: %s", err.Error()) @@ -152,12 +152,6 @@ func TestModifyDN(t *testing.T) { type modifyTestHandler struct { } -func (h modifyTestHandler) Bind(bindDN, bindSimplePw string, conn net.Conn) (LDAPResultCode, error) { - if bindDN == "" && bindSimplePw == "" { - return LDAPResultSuccess, nil - } - return LDAPResultInvalidCredentials, nil -} func (h modifyTestHandler) Add(boundDN string, req AddRequest, conn net.Conn) (LDAPResultCode, error) { // only succeed on expected contents of add.ldif: if len(req.attributes) == 5 && req.dn == "cn=Barbara Jensen,dc=example,dc=com" && |
