From e663357b4d7d5cb0c4d8a0ebc97cfcb58429b894 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 4 Apr 2017 15:28:36 +0200 Subject: test_idmap_rfc2307: Test wbinfo -r for 35 supplementary group memberships BUG: https://bugzilla.samba.org/show_bug.cgi?id=12757 Signed-off-by: Volker Lendecke Reviewed-by: Christof Schmitt --- nsswitch/tests/test_idmap_rfc2307.sh | 66 ++++++++++++++++++++++++++++++++---- 1 file changed, 60 insertions(+), 6 deletions(-) (limited to 'nsswitch') diff --git a/nsswitch/tests/test_idmap_rfc2307.sh b/nsswitch/tests/test_idmap_rfc2307.sh index e0f550d739b..5fabdc650d2 100755 --- a/nsswitch/tests/test_idmap_rfc2307.sh +++ b/nsswitch/tests/test_idmap_rfc2307.sh @@ -1,7 +1,9 @@ #!/bin/sh # Test id mapping through idmap_rfc2307 module -if [ $# -lt 13 ]; then - echo Usage: $0 DOMAIN USERNAME UID USERNAME2 UID2 GROUPNAME GID GROUPNAME2 GID2 LDAPPREFIX DC_SERVER DC_USERNAME DC_PASSWORD +if [ $# -lt 15 ]; then + echo Usage: $0 DOMAIN USERNAME UID USERNAME2 UID2 \ + GROUPNAME GID GROUPNAME2 GID2 GID_START NUMGROUPS \ + LDAPPREFIX DC_SERVER DC_USERNAME DC_PASSWORD exit 1 fi @@ -15,12 +17,15 @@ GROUPGID="$7" GROUPNAME2="$8" GROUPGID2="$9" shift 9 -LDAPPREFIX="$1" -DC_SERVER="$2" -DC_USERNAME="$3" -DC_PASSWORD="$4" +GID_START="$1" +NUMGROUPS="$2" +LDAPPREFIX="$3" +DC_SERVER="$4" +DC_USERNAME="$5" +DC_PASSWORD="$6" wbinfo="$VALGRIND $BINDIR/wbinfo" +net="$VALGRIND $BINDIR/net" ldbsearch="ldbsearch" if [ -x "$BINDIR/ldbsearch" ]; then @@ -146,6 +151,55 @@ echo "SID $group_sid2 resolved to $group_name2" testit "test $group_name2 = $DOMAIN/$GROUPNAME2" test "$(echo $group_name2 | tr A-Z a-z)" = "$(echo $DOMAIN/$GROUPNAME2 | tr A-Z a-z)" || failed=$(expr $failed + 1) +i=0 +while [ ${i} -lt ${NUMGROUPS} ] ; do + GRP=$(printf "test_rfc2307_group_%3.3d" "$i") + GRP_GID=$(expr "$GID_START" + "$i") + testit "Add group $GRP" $net rpc group add "$GRP" -S "$DC_SERVER" \ + -U"${DOMAIN}\\${DC_USERNAME}"%"${DC_PASSWORD}" || + failed=$(expr $failed + 1) + testit "Add groupmem $GRP $USERNAME" \ + $net rpc group addmem "$GRP" "$USERNAME" \ + -S "$DC_SERVER" \ + -U"${DOMAIN}\\${DC_USERNAME}"%"${DC_PASSWORD}" || + failed=$(expr $failed + 1) + testit "Add group object for $GRP $GRP_GID" \ + $VALGRIND $ldbadd \ + -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD <