summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2010-11-23 14:12:38 -0500
committerNalin Dahyabhai <nalin@redhat.com>2010-11-23 14:12:38 -0500
commit3435a6402a3c1b502778afbd52d8a2ee96d9d2d8 (patch)
tree7fe33f12293331e7b1396e151becece322286ea1
parent4706e07e2ecea0cc3d7b15ae2316f436e8333a75 (diff)
downloadslapi-nis-3435a6402a3c1b502778afbd52d8a2ee96d9d2d8.tar.gz
slapi-nis-3435a6402a3c1b502778afbd52d8a2ee96d9d2d8.tar.xz
slapi-nis-3435a6402a3c1b502778afbd52d8a2ee96d9d2d8.zip
- add a test for deref_f
-rwxr-xr-xtests/test27-schema-compat/after.sh8
-rw-r--r--tests/test27-schema-compat/after.txt16
-rwxr-xr-xtests/test27-schema-compat/before.sh8
-rw-r--r--tests/test27-schema-compat/before.txt15
-rwxr-xr-xtests/test27-schema-compat/change.sh9
-rw-r--r--tests/test27-schema-compat/change.txt2
-rw-r--r--tests/test27-schema-compat/description.txt1
-rw-r--r--tests/test27-schema-compat/dse.ldif14
-rw-r--r--tests/test27-schema-compat/userRoot.ldif75
9 files changed, 148 insertions, 0 deletions
diff --git a/tests/test27-schema-compat/after.sh b/tests/test27-schema-compat/after.sh
new file mode 100755
index 0000000..8a1886d
--- /dev/null
+++ b/tests/test27-schema-compat/after.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+tmpfile=`mktemp ${TMP:-/tmp}/ldifXXXXXX`
+if test -z "$tmpfile" ; then
+ echo error creating temporary file
+fi
+trap 'rm -f "$tmpfile"' EXIT
+search -s one -b cn=groups,cn=compat,dc=example,dc=com > $tmpfile
+$LDIFSORT $tmpfile
diff --git a/tests/test27-schema-compat/after.txt b/tests/test27-schema-compat/after.txt
new file mode 100644
index 0000000..eadd14e
--- /dev/null
+++ b/tests/test27-schema-compat/after.txt
@@ -0,0 +1,16 @@
+dn: cn=g1,cn=groups,cn=compat,dc=example,dc=com
+objectClass: posixGroup
+objectClass: top
+gidNumber: 1001
+memberUid: tuser1
+cn: g1
+
+dn: cn=g2,cn=groups,cn=compat,dc=example,dc=com
+objectClass: posixGroup
+objectClass: top
+gidNumber: 1002
+memberUid: %g1
+memberUid: tuser2
+memberUid: tuser3
+cn: g2
+
diff --git a/tests/test27-schema-compat/before.sh b/tests/test27-schema-compat/before.sh
new file mode 100755
index 0000000..8a1886d
--- /dev/null
+++ b/tests/test27-schema-compat/before.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+tmpfile=`mktemp ${TMP:-/tmp}/ldifXXXXXX`
+if test -z "$tmpfile" ; then
+ echo error creating temporary file
+fi
+trap 'rm -f "$tmpfile"' EXIT
+search -s one -b cn=groups,cn=compat,dc=example,dc=com > $tmpfile
+$LDIFSORT $tmpfile
diff --git a/tests/test27-schema-compat/before.txt b/tests/test27-schema-compat/before.txt
new file mode 100644
index 0000000..73d056e
--- /dev/null
+++ b/tests/test27-schema-compat/before.txt
@@ -0,0 +1,15 @@
+dn: cn=g1,cn=groups,cn=compat,dc=example,dc=com
+objectClass: posixGroup
+objectClass: top
+gidNumber: 1001
+memberUid: tuser1
+cn: g1
+
+dn: cn=g2,cn=groups,cn=compat,dc=example,dc=com
+objectClass: posixGroup
+objectClass: top
+gidNumber: 1002
+memberUid: %g1
+memberUid: tuser2
+cn: g2
+
diff --git a/tests/test27-schema-compat/change.sh b/tests/test27-schema-compat/change.sh
new file mode 100755
index 0000000..3281352
--- /dev/null
+++ b/tests/test27-schema-compat/change.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+modify << EOF
+dn: cn=g2,cn=groups,cn=accounts,dc=example,dc=com
+changetype: modify
+add: member
+member: uid=tuser3,cn=users,cn=accounts,dc=example,dc=com
+-
+
+EOF
diff --git a/tests/test27-schema-compat/change.txt b/tests/test27-schema-compat/change.txt
new file mode 100644
index 0000000..f8ae3a0
--- /dev/null
+++ b/tests/test27-schema-compat/change.txt
@@ -0,0 +1,2 @@
+modifying entry "cn=g2,cn=groups,cn=accounts,dc=example,dc=com"
+
diff --git a/tests/test27-schema-compat/description.txt b/tests/test27-schema-compat/description.txt
new file mode 100644
index 0000000..7232857
--- /dev/null
+++ b/tests/test27-schema-compat/description.txt
@@ -0,0 +1 @@
+deref_f
diff --git a/tests/test27-schema-compat/dse.ldif b/tests/test27-schema-compat/dse.ldif
new file mode 100644
index 0000000..a4493f5
--- /dev/null
+++ b/tests/test27-schema-compat/dse.ldif
@@ -0,0 +1,14 @@
+dn: cn=groups, cn=Schema Compatibility, cn=plugins, cn=config
+objectClass: top
+objectclass: extensibleObject
+cn: groups
+schema-compat-container-group: cn=compat, dc=example, dc=com
+schema-compat-container-rdn: cn=groups
+schema-compat-search-base: cn=Groups, cn=Accounts, dc=example, dc=com
+schema-compat-search-filter: objectclass=posixGroup
+schema-compat-entry-rdn: cn=%{cn}
+schema-compat-entry-attribute: objectclass=posixGroup
+schema-compat-entry-attribute: gidNumber=%{gidNumber}
+schema-compat-entry-attribute: memberUid=%%%deref_f("member","objectclass=posixgroup","cn")
+schema-compat-entry-attribute: memberUid=%deref_f("member","objectclass=posixaccount","uid")
+
diff --git a/tests/test27-schema-compat/userRoot.ldif b/tests/test27-schema-compat/userRoot.ldif
new file mode 100644
index 0000000..698fd12
--- /dev/null
+++ b/tests/test27-schema-compat/userRoot.ldif
@@ -0,0 +1,75 @@
+# users, accounts, example.com
+dn: cn=users,cn=accounts,dc=example,dc=com
+objectClass: top
+objectClass: nsContainer
+cn: users
+
+# groups, accounts, example.com
+dn: cn=groups,cn=accounts,dc=example,dc=com
+objectClass: top
+objectClass: nsContainer
+cn: groups
+
+# tuser1, users, accounts, example.com
+dn: uid=tuser1,cn=users,cn=accounts,dc=example,dc=com
+uid: tuser1
+objectClass: top
+objectClass: person
+objectClass: posixAccount
+loginShell: /bin/sh
+gidNumber: 1003
+gecos: tuser1
+sn: User
+homeDirectory: /home/tuser1
+cn: Tim User
+uidNumber: 1101
+
+# tuser2, users, accounts, example.com
+dn: uid=tuser2,cn=users,cn=accounts,dc=example,dc=com
+uid: tuser2
+objectClass: top
+objectClass: person
+objectClass: posixAccount
+loginShell: /bin/sh
+gidNumber: 1004
+gecos: tuser2
+sn: User
+homeDirectory: /home/tuser2
+cn: Timmy User
+uidNumber: 1102
+
+# tuser3, users, accounts, example.com
+dn: uid=tuser3,cn=users,cn=accounts,dc=example,dc=com
+uid: tuser3
+objectClass: top
+objectClass: person
+objectClass: posixAccount
+loginShell: /bin/sh
+gidNumber: 1004
+gecos: tuser3
+sn: User
+homeDirectory: /home/tuser3
+cn: Timothy User
+uidNumber: 1103
+
+# g1, groups, accounts, example.com
+dn: cn=g1,cn=groups,cn=accounts,dc=example,dc=com
+objectClass: top
+objectClass: groupofnames
+objectClass: posixGroup
+gidNumber: 1001
+cn: g1
+description: g1
+member: uid=tuser1,cn=users,cn=accounts,dc=example,dc=com
+
+# g2, groups, accounts, example.com
+dn: cn=g2,cn=groups,cn=accounts,dc=example,dc=com
+objectClass: top
+objectClass: groupofnames
+objectClass: posixGroup
+gidNumber: 1002
+cn: g2
+description: g2
+member: cn=g1,cn=groups,cn=accounts,dc=example,dc=com
+member: uid=tuser2,cn=users,cn=accounts,dc=example,dc=com
+