ctdb-scripts: Improve update and listing code
[samba4-gss.git] / python / samba / tests / test_pam_winbind_setcred.sh
blob7d7acc25aecd79ca5d964552b00b7fcb3a0a92ee
1 #!/bin/sh
3 PYTHON="$1"
4 PAM_WRAPPER_SO_PATH="$2"
5 shift 2
7 DOMAIN="$1"
8 export DOMAIN
9 USERNAME="$2"
10 export USERNAME
11 PASSWORD="$3"
12 export PASSWORD
13 shift 3
15 PAM_OPTIONS="$1"
16 export PAM_OPTIONS
17 shift 1
19 PAM_WRAPPER_PATH="$BINDIR/default/third_party/pam_wrapper"
21 pam_winbind="$BINDIR/plugins/pam_winbind.so"
22 service_dir="$SELFTEST_TMPDIR/pam_services"
23 service_file="$service_dir/samba"
25 mkdir $service_dir
26 echo "auth required $pam_winbind debug debug_state $PAM_OPTIONS" > $service_file
27 echo "account required $pam_winbind debug debug_state $PAM_OPTIONS" >> $service_file
28 echo "password required $pam_winbind debug debug_state $PAM_OPTIONS" >> $service_file
29 echo "session required $pam_winbind debug debug_state $PAM_OPTIONS" >> $service_file
31 PAM_WRAPPER="1"
32 export PAM_WRAPPER
33 PAM_WRAPPER_SERVICE_DIR="$service_dir"
34 export PAM_WRAPPER_SERVICE_DIR
35 LD_PRELOAD="$LD_PRELOAD:$PAM_WRAPPER_SO_PATH"
36 export LD_PRELOAD
38 PAM_WRAPPER_DEBUGLEVEL=${PAM_WRAPPER_DEBUGLEVEL:="3"}
39 export PAM_WRAPPER_DEBUGLEVEL
41 PYTHONPATH="$PYTHONPATH:$PAM_WRAPPER_PATH:$(dirname $0)" $PYTHON -m samba.subunit.run samba.tests.pam_winbind_setcred
42 exit_code=$?
44 rm -rf $service_dir
46 exit $exit_code