From 6ac0bdc4513bb5a7bf9ecf0cd0986f6122f96dba Mon Sep 17 00:00:00 2001 From: Christof Schmitt Date: Thu, 21 Feb 2013 12:33:23 -0700 Subject: Add testcase for idmap_rfc2307 module Create a new test environment with 'idmap config DOMAIN : backend = rfc2307'. A new test script adds LDAP records and queries them again for the mapped uid and gid. Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Sat Mar 9 08:18:43 CET 2013 on sn-devel-104 --- nsswitch/tests/test_idmap_rfc2307.sh | 94 ++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100755 nsswitch/tests/test_idmap_rfc2307.sh (limited to 'nsswitch') diff --git a/nsswitch/tests/test_idmap_rfc2307.sh b/nsswitch/tests/test_idmap_rfc2307.sh new file mode 100755 index 0000000000..b9efd346c8 --- /dev/null +++ b/nsswitch/tests/test_idmap_rfc2307.sh @@ -0,0 +1,94 @@ +#!/bin/sh +# Test id mapping through idmap_rfc2307 module +if [ $# -lt 9 ]; then + echo Usage: $0 DOMAIN USERNAME UID GROUPNAME GID LDAPPREFIX DC_SERVER DC_USERNAME DC_PASSWORD + exit 1 +fi + +DOMAIN="$1" +USERNAME="$2" +USERUID="$3" +GROUPNAME="$4" +GROUPGID="$5" +LDAPPREFIX="$6" +DC_SERVER="$7" +DC_USERNAME="$8" +DC_PASSWORD="$9" + +echo called with: $1 $2 $3 $4 $5 $6 $7 $8 $9 + +wbinfo="$VALGRIND $BINDIR/wbinfo" +ldbadd="$BINDIR/ldbadd" +ldbdel="$BINDIR/ldbdel" +failed=0 + +. `dirname $0`/../../testprogs/blackbox/subunit.sh + +# Delete LDAP records +$VALGRIND $ldbdel -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD "cn=$USERNAME,$LDAPPREFIX" +$VALGRIND $ldbdel -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD "cn=$GROUPNAME,$LDAPPREFIX" +$VALGRIND $ldbdel -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD "$LDAPPREFIX" + +# Add id mapping information to LDAP + +cat > $PREFIX/tmpldb < $PREFIX/tmpldb < $PREFIX/tmpldb <