s4/setup/tests: PY3 samba-tool needs to be called with correct python ver.
[samba.git] / source4 / setup / tests / blackbox_setpassword.sh
1 #!/bin/sh
2
3 if [ $# -lt 1 ]; then
4 cat <<EOF
5 Usage: blackbox_setpassword.sh PREFIX
6 EOF
7 exit 1;
8 fi
9
10 PREFIX="$1"
11 shift 1
12
13 . `dirname $0`/../../../testprogs/blackbox/subunit.sh
14
15 samba_tool="./bin/samba-tool"
16
17 rm -rf $PREFIX/simple-dc
18 mkdir -p $PREFIX/simple-dc
19
20 testit "simple-dc" $PYTHON $BINDIR/samba-tool domain provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/simple-dc --use-ntvfs
21
22 testit "user add" $PYTHON $samba_tool user create --configfile=$PREFIX/simple-dc/etc/smb.conf testuser testp@ssw0Rd
23
24 testit "setpassword" $PYTHON $samba_tool user setpassword --configfile=$PREFIX/simple-dc/etc/smb.conf testuser --newpassword=testp@ssw0Rd
25
26 testit "setpassword" $PYTHON $samba_tool user setpassword --configfile=$PREFIX/simple-dc/etc/smb.conf testuser --newpassword=testp@ssw0Rd --must-change-at-next-login
27
28 testit "setpassword" $PYTHON $samba_tool user setpassword --configfile=$PREFIX/simple-dc/etc/smb.conf testuser --newpassword=Täst123 --must-change-at-next-login
29
30 testit "passwordsettings" $PYTHON $samba_tool domain passwordsettings set --quiet --configfile=$PREFIX/simple-dc/etc/smb.conf --complexity=default --history-length=default --min-pwd-length=default --min-pwd-age=default --max-pwd-age=default --store-plaintext=on
31
32 exit $failed