]> git.sur5r.net Git - openldap/commitdiff
ITS#7423 Update slapo-constraint tests
authorJan Synacek <jsynacek@redhat.com>
Mon, 29 Oct 2012 11:20:25 +0000 (12:20 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 31 Oct 2012 19:57:55 +0000 (12:57 -0700)
34 files changed:
tests/data/constraint/constraint.out
tests/data/constraint/root.ldif
tests/data/constraint/t_fail_01.ldif
tests/data/constraint/t_fail_02.ldif
tests/data/constraint/t_fail_03.ldif
tests/data/constraint/t_fail_04.ldif
tests/data/constraint/t_fail_05.ldif
tests/data/constraint/t_fail_06.ldif
tests/data/constraint/t_fail_07.ldif
tests/data/constraint/t_fail_08.ldif
tests/data/constraint/t_fail_09.ldif
tests/data/constraint/t_fail_10.ldif
tests/data/constraint/t_fail_11.ldif
tests/data/constraint/t_fail_12.ldif
tests/data/constraint/t_fail_13.ldif
tests/data/constraint/t_fail_14.ldif
tests/data/constraint/t_fail_15.ldif [new file with mode: 0644]
tests/data/constraint/t_ok_01.ldif
tests/data/constraint/t_ok_02.ldif
tests/data/constraint/t_ok_03.ldif
tests/data/constraint/t_ok_04.ldif
tests/data/constraint/t_ok_05.ldif
tests/data/constraint/t_ok_06.ldif
tests/data/constraint/t_ok_07.ldif
tests/data/constraint/t_ok_08.ldif
tests/data/constraint/t_ok_09.ldif
tests/data/constraint/t_ok_10.ldif
tests/data/constraint/t_ok_11.ldif
tests/data/constraint/t_ok_12.ldif
tests/data/constraint/t_ok_13.ldif
tests/data/constraint/t_ok_14.ldif
tests/data/constraint/t_ok_15.ldif [new file with mode: 0644]
tests/data/constraint/user.ldif
tests/scripts/test064-constraint

index f2d21e998e5ae4bee08b713782545b81c062484a..468d3afc6efbfb0c88d1a8811e1f57ab59350ae1 100644 (file)
@@ -12,6 +12,8 @@ OK
 OK
 OK
 OK
+OK
+FAIL
 FAIL
 FAIL
 FAIL
index 3e099fcb1213576bef74813be8c8e5a802e277cb..6c2969060def0518ec74290605610b1a20933c1e 100644 (file)
@@ -3,3 +3,23 @@ objectclass: dcObject
 objectclass: organization
 dc: example
 o: My Domain corp.
+
+dn: ou=users,dc=example,dc=com
+ou: users
+objectclass: organizationalUnit
+
+dn: ou=groups,dc=example,dc=com
+ou: groups
+objectclass: organizationalUnit
+
+dn: uid=1,ou=groups,dc=example,dc=com
+objectclass: inetOrgPerson
+cn: test 1
+sn: test1
+uid: 1
+
+dn: uid=2,ou=groups,dc=example,dc=com
+objectclass: inetOrgPerson
+cn: test 2
+sn: test2
+uid: 2
index f90f33c10fae5f0ebc06f8d764b67e1a3a94de52..e0c82e2896faf47aa76d76232f53633cdf48b402 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 add: mail
 mail: b@example.com
index cccbb18b51ca3fa473705cb7963481eb21fab836..462a1748ffd3fed2b684f08257ca3192ec99881a 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 add: mail
 mail: b@example.com
index 41b0d086648ce42686c4e045995f3de32d0a0182..471a332b5b973767886c6540b3773e4514845d69 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 add: mail
 mail: b@example.com
index f5e449aa8e689f01e3702569d91f76ebfa012f90..747357c77d9fe7f118188e6a3fefcc44c83757ef 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 add: mail
 mail: b@example.com
index f2ed68d7893a4f37f0300fe7c3fcf2611c2e25a5..da48748454453b889395c9f515e60d0569e92b8b 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 add: mail
 mail: b@example.com
index 17bdc2e1c14af9689d6a73965511fa54681f6d67..950cf5b40f4a3cd2ab38ecc7ecd0fde6aa8fc0e5 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 replace: mail
 mail: a@example.com
index a7539dd5de601c137ed3380a3db27d7a1cea45ca..85c8c6377eef1c9831d00497253b8462729ae90d 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 replace: mail
 mail: a@example.com
index f2269ede01dda68240c33d598ee5ffbba54c96b5..7dc94ac817266c4485ef4407527f2f968f8d4748 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 add: mail
 mail: b@example.com
index 10e2b9893f567311fa766797894b63db1c43f6ab..61c2799aa22affd54b0b945944798d86bc22c17c 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 add: mail
 mail: b@example.com
index 812e8662ebfa8a3686b3078ccaa7c8f84225dcf6..d50f9117cfeab4d5884f8a2dd650128282568804 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 add: mail
 mail: example@not-allowed.com
index e3e9d4b5cfeece2936066c73782a655d36a130a2..48bed059dae72c5e98fadec50a761b569b113e3e 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 delete: mail
 mail: original@example.com
index 60558edd815384803f34ff4fca021ad0e8acf994..071d829e302c873b01647471bef1c2716f76f20f 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 delete: mail
 mail: original@example.com
index 855de830219d847b23680eb171c12a6534d9203f..b8c2ab522ef710af6a4a62c347d99247229d670c 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 replace: givenname
 givenname: Joe
index 5ba56812c04cfe43bdcd8afde801e8535df8b313..090e48b0e724d5932e77457fc16262d9c6684c9c 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 replace: sn
 sn: Down
diff --git a/tests/data/constraint/t_fail_15.ldif b/tests/data/constraint/t_fail_15.ldif
new file mode 100644 (file)
index 0000000..94d7dd7
--- /dev/null
@@ -0,0 +1,5 @@
+dn: cn=John Doe,ou=users,dc=example,dc=com
+changetype: modify
+replace: uid
+uid: 3
+
index 3724eb0e087ac925abca1b901c650ec37064e01a..57664610aef7378ba33ba3df22c1d0c34b052f5d 100644 (file)
@@ -1,3 +1,3 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 delete: mail
index 20526bdb6b7b1232437771faf5e67a42f39c9ff1..17ce4b2a3374a1cfa25b20a6ba8aaa7aa4c04bfd 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 replace: mail
 mail: a@example.com
index 311fa0df218cc7e652b59aaffc84442930b404cd..3d2a9d1e178c35f6497538ff023fbdb960b4efa4 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 replace: mail
 mail: a@example.com
index 3724eb0e087ac925abca1b901c650ec37064e01a..57664610aef7378ba33ba3df22c1d0c34b052f5d 100644 (file)
@@ -1,3 +1,3 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 delete: mail
index 0f24b2abae5a920fa4aaddbadb32253809f420b9..c30d339d793f55014013dd8eb88ed1a83417c116 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 add: mail
 mail: a@example.com
index dbe8670ee6a125567b03f558e56838da61bf1db4..eef34bd8e341a653a9625c436b94aae534d44432 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 delete: mail
 -
index d2293e04de94ca24e37d4d280547a18cad23f99b..f5c733368bbf6c2ed30e9de0cafaef4e4cc24341 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 delete: mail
 -
index 450b4c0173ffa545cee26db76a3e43c6b96c8cbd..40b7fa9f71c979909f9c8dfcf501fc6a0f087326 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 add: mail
 mail: b@example.com
index b161e1b7d59def71c1f50fd0c89fc049ef06e238..73cec0154b886f55f55755a6bd7db36ce4d13d5b 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 replace: mail
 mail: a@example.com
index 7eb72cdc2f9178e9721010449f652278f7c1616d..367e9a895e5287646fca1777d790ba045b4494dd 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 add: mail
 mail: b@example.com
index 04766bf3a4cd7d911628b17aa8c0fd867c5d6d63..76cbb172a25cf6202b4a1e4f9be7fc92fe62edcc 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 add: mail
 mail: b@example.com
index 1cfab0a968e40210d1fdba1ede55fc6fd9fcf649..ce89978645ec6fdbf103a650226f360edc463efa 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 add: mail
 mail: b@example.com
index acd5771d339afe890f75a31bb24d6977d4a2b0dd..0e9257e1f2e4745bd894c3fc9b32b1eeddf2d34b 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 add: mail
 mail: b@example.com
index 127e463b5b24f3f716ffbb11dd43c35edaf4fe6c..96ef3a4974959934e4ec8b318734d32f04ba6291 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 changetype: modify
 delete: description
 description: desc1
diff --git a/tests/data/constraint/t_ok_15.ldif b/tests/data/constraint/t_ok_15.ldif
new file mode 100644 (file)
index 0000000..9352caa
--- /dev/null
@@ -0,0 +1,5 @@
+dn: cn=John Doe,ou=users,dc=example,dc=com
+changetype: modify
+replace: uid
+uid: 2
+
index cc244534b3a0ecab1e735e247ec7acb0b668b5f4..6150462f3f362c6768d12a32d4fa4fbea14a5604 100644 (file)
@@ -1,4 +1,4 @@
-dn: cn=John Doe,dc=example,dc=com
+dn: cn=John Doe,ou=users,dc=example,dc=com
 objectclass: inetOrgPerson
 objectclass: organizationalPerson
 cn: John Doe
@@ -7,3 +7,4 @@ sn: Doe
 mail: original@example.com
 description: desc1
 description: desc2
+uid: 1
index a3104e168feb6c7bf7ece808a71bcf8b8bb7953c..79b9814ecae434f9814f382ac17b98aa8e442ab8 100755 (executable)
@@ -13,7 +13,7 @@ ROOTLDIF="$CONSTRAINTDIR/root.ldif"
 USERLDIF="$CONSTRAINTDIR/user.ldif"
 RESULTOUT="$CONSTRAINTDIR/constraint.out"
 SCRIPTOUT="$TESTDIR/constraint.out"
-USERDN="cn=John Doe,$BASEDN"
+USERDN="cn=John Doe,ou=users,$BASEDN"
 
 CONFDIR=$TESTDIR/slapd.d
 mkdir -p $TESTDIR $CONFDIR $DBDIR1
@@ -88,13 +88,21 @@ dn: olcOverlay=constraint,olcDatabase={1}$BACKEND,cn=config
 objectClass: olcOverlayConfig
 objectClass: olcConstraintConfig
 olcOverlay: constraint
-olcConstraintAttribute: mail count 3
+olcConstraintAttribute: mail
+  count 3
+  restrict="ldap:///ou=users,$BASEDN??one?(objectClass=inetOrgPerson)"
+# check if restrict works (if not, this will apply to ou=users subtree as well
+# and some tests will fail)
+olcConstraintAttribute: mail count 1 restrict="ldap:///ou=groups,$BASEDN??one"
 olcConstraintAttribute: mail regex ^[[:alnum:]]+@example.com$
 olcConstraintAttribute: description count 2
 # cn value has to be concatenated givenName SP sn
 olcConstraintAttribute: cn,sn,givenName
   set "(this/givenName + [ ] + this/sn) & this/cn"
   restrict="ldap:///$USERDN??sub?(objectClass=inetOrgPerson)"
+olcConstraintAttribute: uid
+  uri "ldap:///ou=groups,$BASEDN?uid?one?(objectClass=inetOrgPerson)"
+  restrict="ldap:///ou=users,$BASEDN??one"
 EOF
 
 $SLAPADD -F $CONFDIR -n 0 -l $TESTDIR/config.ldif