2008-05-22 03:47:22 +04:00
#!/bin/sh
2008-05-30 08:36:24 +04:00
if [ $# -lt 1 ] ; then
2022-02-23 14:03:50 +03:00
cat <<EOF
2008-05-30 08:36:24 +04:00
Usage: blackbox_setpassword.sh PREFIX
2008-05-22 03:47:22 +04:00
EOF
2022-02-23 14:03:50 +03:00
exit 1
2008-05-22 03:47:22 +04:00
fi
PREFIX = " $1 "
2008-05-30 08:36:24 +04:00
shift 1
2008-05-22 03:47:22 +04:00
2022-02-23 14:03:50 +03:00
. $( dirname $0 ) /../../../testprogs/blackbox/subunit.sh
2008-05-22 03:47:22 +04:00
2010-10-24 06:27:26 +04:00
samba_tool = "./bin/samba-tool"
2009-12-30 22:40:11 +03:00
2010-07-09 20:29:27 +04:00
rm -rf $PREFIX /simple-dc
2014-02-14 14:13:37 +04:00
mkdir -p $PREFIX /simple-dc
2012-09-10 16:47:21 +04:00
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
2008-05-22 03:47:22 +04:00
2018-10-10 13:14:59 +03:00
testit "user add" $PYTHON $samba_tool user create --configfile= $PREFIX /simple-dc/etc/smb.conf testuser testp@ssw0Rd
2008-05-22 03:47:22 +04:00
2018-10-10 13:14:59 +03:00
testit "setpassword" $PYTHON $samba_tool user setpassword --configfile= $PREFIX /simple-dc/etc/smb.conf testuser --newpassword= testp@ssw0Rd
2008-05-22 03:47:22 +04:00
2018-10-10 13:14:59 +03:00
testit "setpassword" $PYTHON $samba_tool user setpassword --configfile= $PREFIX /simple-dc/etc/smb.conf testuser --newpassword= testp@ssw0Rd --must-change-at-next-login
2009-06-17 03:14:17 +04:00
2018-10-10 13:14:59 +03:00
testit "setpassword" $PYTHON $samba_tool user setpassword --configfile= $PREFIX /simple-dc/etc/smb.conf testuser --newpassword= Täst123 --must-change-at-next-login
2018-05-14 15:48:18 +03:00
2018-10-10 13:14:59 +03:00
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
2009-09-08 15:01:18 +04:00
2008-05-22 03:47:22 +04:00
exit $failed