2 # Blackbox tests for winbind offline logon support
3 # Copyright (c) 2021 Andreas Schneider <asn@samba.org>
7 Usage: test_offline_logon.sh DOMAIN CACHED_USER_NAME_1 CACHED_USER_PASS_1 CACHED_USER_NAME_2 CACHED_USER_PASS_2 ONLINE_USER_NAME_1 ONLINE_USER_PASS_1 ONLINE_USER_NAME_2 ONLINE_USER_PASS_2
23 . $
(dirname $0)/subunit.sh
25 samba_bindir
="$BINDIR"
26 wbinfo
="$samba_bindir/wbinfo"
28 # Check that the DC is offline
29 testit_expect_failure
"wbinfo.ping-dc" $VALGRIND $wbinfo --ping-dc || failed
=$
(expr $failed + 1)
31 # We should have cached credentials for alice and bob
32 # --pam-logon sets always the WBFLAG_PAM_CACHED_LOGIN flag
33 testit
"wbinfo.pam_logon_$CACHED_USER_NAME_1" $VALGRIND $wbinfo --pam-logon=$DOMAIN/$CACHED_USER_NAME_1%$CACHED_USER_PASS_1 || failed
=$
(expr $failed + 1)
34 testit
"wbinfo.kerberos_logon_$CACHED_USER_NAME_1" $VALGRIND $wbinfo --krb5auth=$DOMAIN/$CACHED_USER_NAME_2%$CACHED_USER_PASS_2 || failed
=$
(expr $failed + 1)
36 testit
"wbinfo.pam_logon_$CACHED_USER_NAME_2" $VALGRIND $wbinfo --pam-logon=$DOMAIN/$CACHED_USER_NAME_2%$CACHED_USER_PASS_2 || failed
=$
(expr $failed + 1)
37 testit
"wbinfo.kerberos_logon_$CACHED_USER_NAME_2" $VALGRIND $wbinfo --krb5auth=$DOMAIN/$CACHED_USER_NAME_2%$CACHED_USER_PASS_2 || failed
=$
(expr $failed + 1)
39 # We should not be able to auth with jane or joe
40 testit_expect_failure
"wbinfo.pam_logon_$ONLINE_USER_NAME_1" $VALGRIND $wbinfo --pam-logon=$DOMAIN/$ONLINE_USER_NAME_1%$ONLINE_USER_PASS_1 || failed
=$
(expr $failed + 1)
41 testit_expect_failure
"wbinfo.pam_logon_$ONLINE_USER_NAME_2" $VALGRIND $wbinfo --pam-logon=$DOMAIN/$ONLINE_USER_NAME_2%$ONLINE_USER_PASS_2 || failed
=$
(expr $failed + 1)