From 1066dffe368e20ae43b1e6191a9138598da4f816 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Thu, 7 May 2009 16:24:27 -0400 Subject: - make sure that %referred() and %deref() don't return empty strings --- tests/test32-nis-empty/before.sh | 8 ++++++++ tests/test32-nis-empty/before.txt | 17 +++++++++++++++++ tests/test32-nis-empty/description.txt | 1 + tests/test32-nis-empty/dse.ldif | 22 ++++++++++++++++++++++ tests/test32-nis-empty/userRoot.ldif | 28 ++++++++++++++++++++++++++++ 5 files changed, 76 insertions(+) create mode 100755 tests/test32-nis-empty/before.sh create mode 100644 tests/test32-nis-empty/before.txt create mode 100644 tests/test32-nis-empty/description.txt create mode 100644 tests/test32-nis-empty/dse.ldif create mode 100644 tests/test32-nis-empty/userRoot.ldif (limited to 'tests/test32-nis-empty') diff --git a/tests/test32-nis-empty/before.sh b/tests/test32-nis-empty/before.sh new file mode 100755 index 0000000..27afbdf --- /dev/null +++ b/tests/test32-nis-empty/before.sh @@ -0,0 +1,8 @@ +#!/bin/sh +echo map list: +$YP maplist example.com +$YP -c maplist example.com +for map in `$YP maplist example.com` ; do + echo contents of example.com:"$map": + $YP cat example.com $map +done diff --git a/tests/test32-nis-empty/before.txt b/tests/test32-nis-empty/before.txt new file mode 100644 index 0000000..6d4b257 --- /dev/null +++ b/tests/test32-nis-empty/before.txt @@ -0,0 +1,17 @@ +map list: +groups +memberships +groups +memberships +contents of example.com:groups: +group1 group1-fake-uid:group1 +group2 group2-fake-uid:group2,group2-fake-uid:group2-alternate-name +group2-alternate-name group2-fake-uid:group2,group2-fake-uid:group2-alternate-name +contents of example.com:memberships: +user1 group1 +user1a +user1b +user1c +user2a +user2b +user2c diff --git a/tests/test32-nis-empty/description.txt b/tests/test32-nis-empty/description.txt new file mode 100644 index 0000000..795f1be --- /dev/null +++ b/tests/test32-nis-empty/description.txt @@ -0,0 +1 @@ +deref() and referred() not returning empties diff --git a/tests/test32-nis-empty/dse.ldif b/tests/test32-nis-empty/dse.ldif new file mode 100644 index 0000000..b371b01 --- /dev/null +++ b/tests/test32-nis-empty/dse.ldif @@ -0,0 +1,22 @@ +dn: nis-domain=example.com+nis-map=groups,cn=NIS Server,cn=plugins,cn=config +objectClass: top +objectClass: extensibleObject +nis-domain: example.com +nis-map: groups +nis-base: cn=Groups1, cn=Accounts, dc=example, dc=com +nis-base: cn=Groups2, cn=Accounts, dc=example, dc=com +nis-filter: objectclass=posixGroup +nis-keys-format: %{cn} +nis-values-format: %merge(",", "%deref(\"member\", \"madeup\")", "%deref(\"madeup\", \"madeup\")", "%{uid}:%{cn}") + +dn: nis-domain=example.com+nis-map=memberships,cn=NIS Server,cn=plugins,cn=config +objectClass: top +objectClass: extensibleObject +nis-domain: example.com +nis-map: memberships +nis-base: cn=Users1, cn=Accounts, dc=example, dc=com +nis-base: cn=Users2, cn=Accounts, dc=example, dc=com +nis-filter: objectclass=posixAccount +nis-keys-format: %{uid} +nis-values-format: %merge(",", "%referred(\"groups\", \"member\", \"cn\")", "%referred(\"groups\", \"member\", \"madeup\")", "%referred(\"groups\", \"madeup\", \"madeup\")", "%referred(\"madeup\", \"madeup\", \"madeup\")") + diff --git a/tests/test32-nis-empty/userRoot.ldif b/tests/test32-nis-empty/userRoot.ldif new file mode 100644 index 0000000..876d6ed --- /dev/null +++ b/tests/test32-nis-empty/userRoot.ldif @@ -0,0 +1,28 @@ +dn: uid=user1, cn=Users1, cn=Accounts, dc=example, dc=com +objectClass: posixAccount +objectClass: inetUser +cn: user1 +uid: user1 +uidNumber: 1001 +gidNumber: 1001 +gecos: User +loginShell: /bin/bash +homeDirectory: /home/user + +dn: cn=group1, cn=Groups1, cn=Accounts, dc=example, dc=com +objectClass: posixgroup +objectClass: extensibleObject +cn: group1 +uid: group1-fake-uid +gidNumber: 1002 +member: uid=user1, cn=Users1, cn=Accounts, dc=example, dc=com + +dn: cn=group2, cn=Groups1, cn=Accounts, dc=example, dc=com +objectClass: posixgroup +objectClass: extensibleObject +cn: group2 +cn: group2-alternate-name +uid: group2-fake-uid +gidNumber: 1003 +member: cn=group1, cn=Groups1, cn=Accounts, dc=example, dc=com + -- cgit