summaryrefslogtreecommitdiffstats
path: root/tests/test16-schema-nested
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin.dahyabhai@pobox.com>2008-11-04 17:19:33 -0500
committerNalin Dahyabhai <nalin.dahyabhai@pobox.com>2008-11-04 17:19:33 -0500
commitb3eec3cda6d609383d554d731c2da492046bd204 (patch)
treec655793271ec20d8badd2aea71948f8a4aba5177 /tests/test16-schema-nested
parent2cc6d75d32a5d7ae7f2f51fd67e66bb95826fa34 (diff)
downloadslapi-nis-b3eec3cda6d609383d554d731c2da492046bd204.tar.gz
slapi-nis-b3eec3cda6d609383d554d731c2da492046bd204.tar.xz
slapi-nis-b3eec3cda6d609383d554d731c2da492046bd204.zip
- add a "link" function
Diffstat (limited to 'tests/test16-schema-nested')
-rwxr-xr-xtests/test16-schema-nested/after.sh8
-rw-r--r--tests/test16-schema-nested/after.txt42
-rwxr-xr-xtests/test16-schema-nested/before.sh8
-rw-r--r--tests/test16-schema-nested/before.txt35
-rwxr-xr-xtests/test16-schema-nested/change.sh15
-rw-r--r--tests/test16-schema-nested/change.txt4
-rw-r--r--tests/test16-schema-nested/dse.ldif15
-rw-r--r--tests/test16-schema-nested/userRoot.ldif199
8 files changed, 326 insertions, 0 deletions
diff --git a/tests/test16-schema-nested/after.sh b/tests/test16-schema-nested/after.sh
new file mode 100755
index 0000000..8b810ac
--- /dev/null
+++ b/tests/test16-schema-nested/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 -b cn=ng,cn=compat,cn=accounts,dc=example,dc=com > $tmpfile
+$LDIFSORT $tmpfile
diff --git a/tests/test16-schema-nested/after.txt b/tests/test16-schema-nested/after.txt
new file mode 100644
index 0000000..b0315ba
--- /dev/null
+++ b/tests/test16-schema-nested/after.txt
@@ -0,0 +1,42 @@
+dn: cn=ng,cn=compat,cn=Accounts,dc=example,dc=com
+objectClass: extensibleObject
+cn: ng
+
+dn: cn=ng1,cn=ng,cn=compat,cn=accounts,dc=example,dc=com
+objectClass: nisNetgroup
+objectClass: top
+memberNisNetgroup: ng2
+nisNetgroupTriple: (myhost.lab.com,steve_sss,oldnis.domain.com)
+nisNetgroupTriple: (guest1.vg.com,gorelock,oldnis.domain.com)
+nisNetgroupTriple: (guest2.vg.com,dev1,oldnis.domain.com)
+nisNetgroupTriple: (guest3.vg.com,dev2,oldnis.domain.com)
+nisNetgroupTriple: (nvguest1.vg.com,dev3,oldnis.domain.com)
+nisNetgroupTriple: (nvguest2.vg.com,-,oldnis.domain.com)
+nisNetgroupTriple: (nvguest3.vg.com,-,oldnis.domain.com)
+nisNetgroupTriple: (otherhost.lab.com,-,oldnis.domain.com)
+cn: ng1
+
+dn: cn=ng2,cn=ng,cn=compat,cn=accounts,dc=example,dc=com
+objectClass: nisNetgroup
+objectClass: top
+nisNetgroupTriple: (foo.lab.domain.com,rcrow,lab.domain.com)
+nisNetgroupTriple: (-,support1,lab.domain.com)
+nisNetgroupTriple: (-,support2,lab.domain.com)
+nisNetgroupTriple: (-,support3,lab.domain.com)
+nisNetgroupTriple: (-,dev1,lab.domain.com)
+nisNetgroupTriple: (-,dev2,lab.domain.com)
+nisNetgroupTriple: (-,dev3,lab.domain.com)
+cn: ng2
+
+dn: cn=ng3,cn=ng,cn=compat,cn=accounts,dc=example,dc=com
+objectClass: nisNetgroup
+objectClass: top
+nisNetgroupTriple: (,rcrow,lab.domain.com)
+nisNetgroupTriple: (-,support1,lab.domain.com)
+nisNetgroupTriple: (-,support2,lab.domain.com)
+nisNetgroupTriple: (-,support3,lab.domain.com)
+nisNetgroupTriple: (-,dev1,lab.domain.com)
+nisNetgroupTriple: (-,dev2,lab.domain.com)
+nisNetgroupTriple: (-,dev3,lab.domain.com)
+cn: ng3
+
diff --git a/tests/test16-schema-nested/before.sh b/tests/test16-schema-nested/before.sh
new file mode 100755
index 0000000..8b810ac
--- /dev/null
+++ b/tests/test16-schema-nested/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 -b cn=ng,cn=compat,cn=accounts,dc=example,dc=com > $tmpfile
+$LDIFSORT $tmpfile
diff --git a/tests/test16-schema-nested/before.txt b/tests/test16-schema-nested/before.txt
new file mode 100644
index 0000000..29c2a8c
--- /dev/null
+++ b/tests/test16-schema-nested/before.txt
@@ -0,0 +1,35 @@
+dn: cn=ng,cn=compat,cn=Accounts,dc=example,dc=com
+objectClass: extensibleObject
+cn: ng
+
+dn: cn=ng1,cn=ng,cn=compat,cn=accounts,dc=example,dc=com
+objectClass: nisNetgroup
+objectClass: top
+memberNisNetgroup: ng2
+nisNetgroupTriple: (myhost.lab.com,steve_sss,oldnis.domain.com)
+nisNetgroupTriple: (guest1.vg.com,gorelock,oldnis.domain.com)
+nisNetgroupTriple: (guest2.vg.com,dev1,oldnis.domain.com)
+nisNetgroupTriple: (guest3.vg.com,dev2,oldnis.domain.com)
+nisNetgroupTriple: (nvguest1.vg.com,dev3,oldnis.domain.com)
+nisNetgroupTriple: (nvguest2.vg.com,-,oldnis.domain.com)
+nisNetgroupTriple: (nvguest3.vg.com,-,oldnis.domain.com)
+cn: ng1
+
+dn: cn=ng2,cn=ng,cn=compat,cn=accounts,dc=example,dc=com
+objectClass: nisNetgroup
+objectClass: top
+nisNetgroupTriple: (foo.lab.domain.com,rcrow,lab.domain.com)
+nisNetgroupTriple: (-,support1,lab.domain.com)
+nisNetgroupTriple: (-,support2,lab.domain.com)
+nisNetgroupTriple: (-,support3,lab.domain.com)
+cn: ng2
+
+dn: cn=ng3,cn=ng,cn=compat,cn=accounts,dc=example,dc=com
+objectClass: nisNetgroup
+objectClass: top
+nisNetgroupTriple: (,rcrow,lab.domain.com)
+nisNetgroupTriple: (-,support1,lab.domain.com)
+nisNetgroupTriple: (-,support2,lab.domain.com)
+nisNetgroupTriple: (-,support3,lab.domain.com)
+cn: ng3
+
diff --git a/tests/test16-schema-nested/change.sh b/tests/test16-schema-nested/change.sh
new file mode 100755
index 0000000..a5864b2
--- /dev/null
+++ b/tests/test16-schema-nested/change.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+modify << EOF
+dn: cn=Support,cn=groups,cn=accounts,dc=example,dc=com
+changetype: modify
+add: member
+member: cn=Engineering,cn=groups,cn=accounts,dc=example,dc=com
+-
+
+dn: cn=NestedVirtualGuests,cn=hostgroups,cn=accounts,dc=example,dc=com
+changetype: modify
+add: member
+member: fqdn=otherhost.lab.com,cn=computers,cn=accounts,dc=example,dc=com
+-
+
+EOF
diff --git a/tests/test16-schema-nested/change.txt b/tests/test16-schema-nested/change.txt
new file mode 100644
index 0000000..2ba5d7b
--- /dev/null
+++ b/tests/test16-schema-nested/change.txt
@@ -0,0 +1,4 @@
+modifying entry "cn=Support,cn=groups,cn=accounts,dc=example,dc=com"
+
+modifying entry "cn=NestedVirtualGuests,cn=hostgroups,cn=accounts,dc=example,dc=com"
+
diff --git a/tests/test16-schema-nested/dse.ldif b/tests/test16-schema-nested/dse.ldif
new file mode 100644
index 0000000..403b424
--- /dev/null
+++ b/tests/test16-schema-nested/dse.ldif
@@ -0,0 +1,15 @@
+dn: cn=ng,cn=Schema Compatibility,cn=plugins,cn=config
+objectClass: top
+objectClass: extensibleObject
+cn: ng
+schema-compat-container-group: cn=compat, cn=Accounts, dc=example, dc=com
+schema-compat-container-rdn: cn=ng
+schema-compat-check-access: yes
+schema-compat-search-base: cn=ng,cn=accounts,dc=example,dc=com
+schema-compat-search-filter: !(cn=ng)
+schema-compat-entry-rdn: cn=%{cn}
+schema-compat-entry-attribute: objectclass=nisNetgroup
+schema-compat-entry-attribute: memberNisNetgroup=%deref_r("member","cn")
+schema-compat-entry-attribute: memberNisNetgroup=%referred_r("cn=ng","memberOf","cn")
+schema-compat-entry-attribute: nisNetgroupTriple=(%link("%ifeq(\"allHostsFlag\",\"TRUE\",\"\",\"%collect(\\\"%{externalHost}\\\",\\\"%deref_r(\\\\\\\"memberHosts\\\\\\\",\\\\\\\"fqdn\\\\\\\")\\\",\\\"%deref_r(\\\\\\\"memberHosts\\\\\\\",\\\\\\\"member\\\\\\\",\\\\\\\"fqdn\\\\\\\")\\\")\")","-",",","%ifeq(\"allUsersFlag\",\"TRUE\",\"\",\"%collect(\\\"%deref_r(\\\\\\\"memberUsers\\\\\\\",\\\\\\\"uid\\\\\\\")\\\",\\\"%deref_r(\\\\\\\"memberUsers\\\\\\\",\\\\\\\"member\\\\\\\",\\\\\\\"uid\\\\\\\")\\\")\")","-"),%{nisDomainName:-})
+
diff --git a/tests/test16-schema-nested/userRoot.ldif b/tests/test16-schema-nested/userRoot.ldif
new file mode 100644
index 0000000..9dbb340
--- /dev/null
+++ b/tests/test16-schema-nested/userRoot.ldif
@@ -0,0 +1,199 @@
+dn: cn=ng,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: nsContainer
+cn: ng
+
+dn: cn=computers,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: nsContainer
+cn: computers
+
+dn: fqdn=myhost.lab.com,cn=computers,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+fqdn: myhost.lab.com
+
+dn: fqdn=otherhost.lab.com,cn=computers,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+fqdn: otherhost.lab.com
+
+dn: fqdn=thirdhost.lab.com,cn=computers,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+fqdn: thirdhost.lab.com
+
+dn: fqdn=nvguest1.vg.com,cn=computers,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+fqdn: nvguest1.vg.com
+
+dn: fqdn=nvguest2.vg.com,cn=computers,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+fqdn: nvguest2.vg.com
+
+dn: fqdn=nvguest3.vg.com,cn=computers,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+fqdn: nvguest3.vg.com
+
+dn: fqdn=guest1.vg.com,cn=computers,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+fqdn: guest1.vg.com
+
+dn: fqdn=guest2.vg.com,cn=computers,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+fqdn: guest2.vg.com
+
+dn: fqdn=guest3.vg.com,cn=computers,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+fqdn: guest3.vg.com
+
+dn: cn=users,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: nsContainer
+cn: users
+
+dn: cn=dev1,cn=users,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+uid: dev1
+
+dn: cn=dev2,cn=users,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+uid: dev2
+
+dn: cn=dev3,cn=users,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+uid: dev3
+
+dn: cn=support1,cn=users,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+uid: support1
+
+dn: cn=support2,cn=users,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+uid: support2
+
+dn: cn=support3,cn=users,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+uid: support3
+
+dn: uid=gorelock,cn=users,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+cn: Gorelock
+uid: gorelock
+
+dn: cn=torgo,cn=users,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+cn: Torgo
+uid: torgo
+
+dn: cn=sc,cn=users,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+cn: sc
+uid: steve_sc
+
+dn: cn=sss,cn=users,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+cn: sss
+uid: steve_sss
+
+dn: cn=Robert Crow,cn=users,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+cn: Robert Crow
+uid: rcrow
+
+dn: cn=groups,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: nsContainer
+cn: groups
+
+dn: cn=Engineering,cn=groups,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+cn: Engineering
+member: cn=dev1,cn=users,cn=accounts,dc=example,dc=com
+member: cn=dev2,cn=users,cn=accounts,dc=example,dc=com
+member: cn=dev3,cn=users,cn=accounts,dc=example,dc=com
+
+dn: cn=Support,cn=groups,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+cn: Support
+member: cn=support1,cn=users,cn=accounts,dc=example,dc=com
+member: cn=support2,cn=users,cn=accounts,dc=example,dc=com
+member: cn=support3,cn=users,cn=accounts,dc=example,dc=com
+
+dn: cn=hostgroups,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: nsContainer
+cn: hostgroups
+
+dn: cn=NestedVirtualGuests,cn=hostgroups,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+member: fqdn=nvguest1.vg.com,cn=computers,cn=accounts,dc=example,dc=com
+member: fqdn=nvguest2.vg.com,cn=computers,cn=accounts,dc=example,dc=com
+member: fqdn=nvguest3.vg.com,cn=computers,cn=accounts,dc=example,dc=com
+cn: NestedVirtualGuests
+
+dn: cn=VirtGuests,cn=hostgroups,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+member: fqdn=guest1.vg.com,cn=computers,cn=accounts,dc=example,dc=com
+member: fqdn=guest2.vg.com,cn=computers,cn=accounts,dc=example,dc=com
+member: fqdn=guest3.vg.com,cn=computers,cn=accounts,dc=example,dc=com
+member: cn=NestedVirtualGuests,cn=hostgroups,cn=accounts,dc=example,dc=com
+cn: VirtGuests
+
+dn: cn=ng1,cn=ng,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+cn: ng1
+allHostsFlag: false
+allUsersFlag: false
+memberHosts: fqdn=myhost.lab.com,cn=computers,cn=accounts,dc=example,dc=com
+memberHosts: cn=VirtGuests,cn=hostgroups,cn=accounts,dc=example,dc=com
+memberUsers: cn=sss,cn=users,cn=accounts,dc=example,dc=com
+memberUsers: uid=gorelock,cn=users,cn=accounts,dc=example,dc=com
+memberUsers: cn=Engineering,cn=groups,cn=accounts,dc=example,dc=com
+nisDomainName: oldnis.domain.com
+member: cn=ng2,cn=ng,cn=accounts,dc=example,dc=com
+
+dn: cn=ng2,cn=ng,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+cn: ng2
+allHostsFlag: false
+allUsersFlag: false
+externalHost: foo.lab.domain.com
+memberUsers: cn=Robert Crow,cn=users,cn=accounts,dc=example,dc=com
+memberUsers: cn=Support,cn=groups,cn=accounts,dc=example,dc=com
+nisDomainName: lab.domain.com
+
+dn: cn=ng3,cn=ng,cn=accounts,dc=example,dc=com
+objectclass: top
+objectclass: extensibleObject
+cn: ng3
+allHostsFlag: true
+allUsersFlag: false
+memberUsers: cn=Robert Crow,cn=users,cn=accounts,dc=example,dc=com
+memberUsers: cn=Support,cn=groups,cn=accounts,dc=example,dc=com
+nisDomainName: lab.domain.com
+memberOf: cn=ng1,cn=ng,cn=accounts,dc=example,dc=com
+