2 # Blackbox test for wbinfo primary groups and samlogon caching
3 # Copyright (c) 2020 Andreas Schneider <asn@samba.org>
7 Usage: $(basename $0) DOMAIN REALM USERNAME PASSWORD PRIMARY_GROUP
19 DEFAULT_GROUP
="Domain Users"
23 samba_bindir
="$BINDIR"
24 wbinfo_tool
="$VALGRIND $samba_bindir/wbinfo"
25 net_tool
="$VALGRIND $samba_bindir/net --configfile=$SERVERCONFFILE"
27 . $
(dirname $0)/..
/..
/testprogs
/blackbox
/subunit.sh
29 KRB5CCNAME_PATH
="$PREFIX/test_wbinfo_user_info_cached_krb5ccache"
30 rm -f $KRB5CCNAME_PATH
32 KRB5CCNAME
="FILE:$KRB5CCNAME_PATH"
35 USER
="$DOMAIN/$USERNAME"
36 USER_SID
=$
($wbinfo_tool --name-to-sid="$USER" |
sed -e 's/ .*//')
38 testit_grep
"user_info.no_cache" "$DEFAULT_GROUP" $wbinfo_tool --user-info=$USER || failed
=$
(expr $failed + 1)
40 # Fill the samlogon cache
41 testit
"kerberos_login" $wbinfo_tool --krb5ccname=$KRB5CCNAME --krb5auth=$USER%$PASSWORD || failed
=$
(expr $failed + 1)
43 testit_grep
"user_info.samlogon_cache" "$PRIMARY_GROUP" $wbinfo_tool --user-info=$USER || failed
=$
(expr $failed + 1)
46 $net_tool cache samlogon delete
$USER_SID
48 rm -f $KRB5CCNAME_PATH