From 516eb50a45ac8debd53e14fb28dc38ecef1be2ee Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Tue, 24 Jan 2012 12:29:09 -0500 Subject: - add multiple-result capable versions of match/regmatch/regsub --- tests/test37-nis-multi/before.sh | 8 ++++++ tests/test37-nis-multi/before.txt | 49 ++++++++++++++++++++++++++++++++++ tests/test37-nis-multi/description.txt | 1 + tests/test37-nis-multi/dse.ldif | 20 ++++++++++++++ tests/test37-nis-multi/userRoot.ldif | 18 +++++++++++++ 5 files changed, 96 insertions(+) create mode 100755 tests/test37-nis-multi/before.sh create mode 100644 tests/test37-nis-multi/before.txt create mode 100644 tests/test37-nis-multi/description.txt create mode 100644 tests/test37-nis-multi/dse.ldif create mode 100644 tests/test37-nis-multi/userRoot.ldif (limited to 'tests') diff --git a/tests/test37-nis-multi/before.sh b/tests/test37-nis-multi/before.sh new file mode 100755 index 0000000..a49cf3e --- /dev/null +++ b/tests/test37-nis-multi/before.sh @@ -0,0 +1,8 @@ +#!/bin/sh +echo map list: +$YP maplist example.com +$YP -c maplist example.com +for map in name2mac mac2name ; do + echo all contents of example.com:"$map": + $YP -c all example.com $map | LANG=C sort +done diff --git a/tests/test37-nis-multi/before.txt b/tests/test37-nis-multi/before.txt new file mode 100644 index 0000000..32c84a2 --- /dev/null +++ b/tests/test37-nis-multi/before.txt @@ -0,0 +1,49 @@ +map list: +mac2name +name2mac +mac2name +name2mac +all contents of example.com:name2mac: +testbox1 01:02:03:04:05:06 testbox1 +testbox1 01:02:03:04:05:07 testbox1 +testbox1 01:02:03:04:05:08 testbox1 +testbox1 01:02:03:04:05:09 testbox1 +testbox1 01:02:03:04:05:0a testbox1 +testbox1 01:02:03:04:05:0b testbox1 +testbox1 01:02:03:04:05:0c testbox1 +testbox2 01:02:03:04:05:06 testbox2 +testbox2 01:02:03:04:05:07 testbox2 +testbox2 01:02:03:04:05:08 testbox2 +testbox2 01:02:03:04:05:09 testbox2 +testbox2 01:02:03:04:05:0a testbox2 +testbox2 01:02:03:04:05:0b testbox2 +testbox2 01:02:03:04:05:0c testbox2 +testbox3 01:02:03:04:05:06 testbox3 +testbox3 01:02:03:04:05:07 testbox3 +testbox3 01:02:03:04:05:08 testbox3 +testbox3 01:02:03:04:05:09 testbox3 +testbox3 01:02:03:04:05:0a testbox3 +testbox3 01:02:03:04:05:0b testbox3 +testbox3 01:02:03:04:05:0c testbox3 +all contents of example.com:mac2name: +01:02:03:04:05:06 01:02:03:04:05:06 testbox1 +01:02:03:04:05:06 01:02:03:04:05:06 testbox2 +01:02:03:04:05:06 01:02:03:04:05:06 testbox3 +01:02:03:04:05:07 01:02:03:04:05:07 testbox1 +01:02:03:04:05:07 01:02:03:04:05:07 testbox2 +01:02:03:04:05:07 01:02:03:04:05:07 testbox3 +01:02:03:04:05:08 01:02:03:04:05:08 testbox1 +01:02:03:04:05:08 01:02:03:04:05:08 testbox2 +01:02:03:04:05:08 01:02:03:04:05:08 testbox3 +01:02:03:04:05:09 01:02:03:04:05:09 testbox1 +01:02:03:04:05:09 01:02:03:04:05:09 testbox2 +01:02:03:04:05:09 01:02:03:04:05:09 testbox3 +01:02:03:04:05:0a 01:02:03:04:05:0a testbox1 +01:02:03:04:05:0a 01:02:03:04:05:0a testbox2 +01:02:03:04:05:0a 01:02:03:04:05:0a testbox3 +01:02:03:04:05:0b 01:02:03:04:05:0b testbox1 +01:02:03:04:05:0b 01:02:03:04:05:0b testbox2 +01:02:03:04:05:0b 01:02:03:04:05:0b testbox3 +01:02:03:04:05:0c 01:02:03:04:05:0c testbox1 +01:02:03:04:05:0c 01:02:03:04:05:0c testbox2 +01:02:03:04:05:0c 01:02:03:04:05:0c testbox3 diff --git a/tests/test37-nis-multi/description.txt b/tests/test37-nis-multi/description.txt new file mode 100644 index 0000000..2f296c8 --- /dev/null +++ b/tests/test37-nis-multi/description.txt @@ -0,0 +1 @@ +multiple regsub (mregsub) diff --git a/tests/test37-nis-multi/dse.ldif b/tests/test37-nis-multi/dse.ldif new file mode 100644 index 0000000..6c32914 --- /dev/null +++ b/tests/test37-nis-multi/dse.ldif @@ -0,0 +1,20 @@ +dn: nis-domain=example.com+nis-map=name2mac,cn=NIS Server,cn=plugins,cn=config +objectClass: top +objectClass: extensibleObject +nis-domain: example.com +nis-map: name2mac +nis-base: cn=computers, cn=Accounts, dc=example, dc=com +nis-filter: objectclass=ieee802device +nis-keys-format: %mregsub("%{macaddress} %{cn}","(..:..:..:..:..:..) (.*)","%2") +nis-values-format: %{macaddress} %{cn} + +dn: nis-domain=example.com+nis-map=mac2name,cn=NIS Server,cn=plugins,cn=config +objectClass: top +objectClass: extensibleObject +nis-domain: example.com +nis-map: mac2name +nis-base: cn=computers, cn=Accounts, dc=example, dc=com +nis-filter: objectclass=ieee802device +nis-keys-format: %mregsub("%{macaddress} %{cn}","(..:..:..:..:..:..) (.*)","%1") +nis-values-format: %{macaddress} %{cn} + diff --git a/tests/test37-nis-multi/userRoot.ldif b/tests/test37-nis-multi/userRoot.ldif new file mode 100644 index 0000000..98727a6 --- /dev/null +++ b/tests/test37-nis-multi/userRoot.ldif @@ -0,0 +1,18 @@ +dn: cn=computers, cn=Accounts, dc=example, dc=com +objectClass: nsContainer +cn: computers + +dn: cn=testbox1, cn=computers, cn=Accounts, dc=example, dc=com +objectClass: ieee802device +objectClass: device +cn: testbox1 +cn: testbox2 +cn: testbox3 +macAddress: 01:02:03:04:05:06 +macAddress: 01:02:03:04:05:07 +macAddress: 01:02:03:04:05:08 +macAddress: 01:02:03:04:05:09 +macAddress: 01:02:03:04:05:0a +macAddress: 01:02:03:04:05:0b +macAddress: 01:02:03:04:05:0c + -- cgit