selftest: Define template homedir for 'ad_member' env
authorAndreas Schneider <asn@samba.org>
Fri, 17 Mar 2017 09:04:19 +0000 (10:04 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 30 Mar 2017 02:26:17 +0000 (04:26 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12699

With this set, the samba3.local.nss test for ad_member will ensure that
we correctly substitute those smb.conf options.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar 30 04:26:18 CEST 2017 on sn-devel-144

nsswitch/tests/test_wbinfo.sh
selftest/target/Samba3.pm

index cfe582d..f9c040e 100755 (executable)
@@ -205,13 +205,18 @@ subunit_start_test "$test_name"
 # The full name (GECOS) is based on name (the RDN, in this case CN)
 # and displayName in winbindd_ads, and is based only on displayName in
 # winbindd_msrpc and winbindd_rpc.  Allow both versions.
-expected_line="$DOMAIN/administrator:*:$admin_uid:$gid:Administrator:/home/$DOMAIN/administrator:/bin/false"
-expected2_line="$DOMAIN/administrator:*:$admin_uid:$gid::/home/$DOMAIN/administrator:/bin/false"
+if test "$TARGET" = "ad_member"; then
+       expected1_line="$DOMAIN/administrator:*:$admin_uid:$gid:Administrator:/home/$DOMAIN/Domain Users/administrator:/bin/false"
+       expected2_line="$DOMAIN/administrator:*:$admin_uid:$gid::/home/$DOMAIN/Domain Users/administrator:/bin/false"
+else
+       expected1_line="$DOMAIN/administrator:*:$admin_uid:$gid:Administrator:/home/$DOMAIN/administrator:/bin/false"
+       expected2_line="$DOMAIN/administrator:*:$admin_uid:$gid::/home/$DOMAIN/administrator:/bin/false"
+fi
 
-if test x$passwd_line = x"$expected_line" -o x$passwd_line = x"$expected2_line"; then
+if test "x$passwd_line" = "x$expected1_line" -o "x$passwd_line" = "x$expected2_line"; then
        subunit_pass_test "$test_name"
 else
-       echo "expected '$expected_line' or '$expected2_line' got '$passwd_line'" | subunit_fail_test "$test_name"
+       echo "expected '$expected1_line' or '$expected2_line' got '$passwd_line'" | subunit_fail_test "$test_name"
        failed=`expr $failed + 1`
 fi
 
@@ -227,10 +232,10 @@ fi
 
 test_name="confirm output of wbinfo --uid-info against $TARGET"
 subunit_start_test "$test_name"
-if test x$passwd_line = x"$expected_line" -o x$passwd_line = x"$expected2_line"; then
+if test "x$passwd_line" = "x$expected1_line" -o "x$passwd_line" = "x$expected2_line"; then
        subunit_pass_test "$test_name"
 else
-       echo "expected '$expected_line' or '$expected2_line' got '$passwd_line'" | subunit_fail_test "$test_name"
+       echo "expected '$expected1_line' or '$expected2_line' got '$passwd_line'" | subunit_fail_test "$test_name"
        failed=`expr $failed + 1`
 fi
 
index a3ab56c..92031a1 100755 (executable)
@@ -412,6 +412,7 @@ sub setup_admember($$$$)
         workgroup = $dcvars->{DOMAIN}
         realm = $dcvars->{REALM}
         netbios aliases = foo bar
+       template homedir = /home/%D/%G/%U
 
 [sub_dug]
        path = $share_dir/D_%D/U_%U/G_%G