nsswitch: Use a swtich in the wbinfo test to lookup users
authorAndreas Schneider <asn@samba.org>
Fri, 6 Jul 2018 12:07:37 +0000 (14:07 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 6 Jul 2018 15:14:44 +0000 (17:14 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13503

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jul  6 17:14:44 CEST 2018 on sn-devel-144

nsswitch/tests/test_wbinfo_user_info.sh

index da30f97be74acefba2b9c871fa1da28c6dfb4c8d..8158ead5a4b2fafa3ff277c9e807a902afa4313f 100755 (executable)
@@ -118,18 +118,21 @@ testit "getpwnam.domain.$DOMAIN.$USERNAME1" test_getpwnam "$DOMAIN/$USERNAME1" 0
 
 testit "getpwnam.upn.$UPN_NAME1" test_getpwnam "$UPN1" 0 "$DOMAIN/$USERNAME1" || failed=$(expr $failed + 1)
 
-# We should not be able to lookup the user just by the name
-test_ret=0
-test_output="$DOMAIN/$USERNAME1"
-
-if [ "$ENVNAME" = "ad_member" ]; then
+case ${ENVNAME} in
+       ad_member*)
+       # We should not be able to lookup the user just by the name
        test_ret=2
        test_output=""
-fi
-if [ "$ENVNAME" = "fl2008r2dc" ]; then
+       ;;
+       fl2008r2dc*)
        test_ret=0
        test_output="$OWN_DOMAIN/$USERNAME1"
-fi
+       ;;
+       *)
+       test_ret=0
+       test_output="$DOMAIN/$USERNAME1"
+       ;;
+esac
 
 testit "getpwnam.local.$USERNAME1" test_getpwnam "$USERNAME1" $test_ret $test_output || failed=$(expr $failed + 1)