Skip to content

Commit

Permalink
Fix a bad test of go-ldap
Browse files Browse the repository at this point in the history
  • Loading branch information
louischan-oursky committed Jan 9, 2025
1 parent 67578c6 commit 263d87a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/util/validation/formats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ func TestFormatLDAPDN(t *testing.T) {
So(f(1), ShouldBeNil)
So(f("dc=example,dc=com"), ShouldBeNil)
So(f("cn=admin,dc=example,dc=org"), ShouldBeNil)
So(f("ou="), ShouldBeError, "invalid DN")
// AttributeValue can be empty according to the spec.
// https://datatracker.ietf.org/doc/html/rfc4514#section-3
// go-ldap v3.4.5 used to return parse error in case of empty value.
// That behavior was changed since v3.4.8
So(f("ou="), ShouldBeNil)
So(f("asbbalskjedkbwk"), ShouldBeError, "invalid DN")
So(f(""), ShouldBeError, "expect non-empty base DN")
})
Expand Down

0 comments on commit 263d87a

Please sign in to comment.