diff --git a/source3/script/tests/test_net_rpc_oldjoin.sh b/source3/script/tests/test_net_rpc_oldjoin.sh index 070fcc1add7..97586874be9 100755 --- a/source3/script/tests/test_net_rpc_oldjoin.sh +++ b/source3/script/tests/test_net_rpc_oldjoin.sh @@ -22,8 +22,29 @@ export UID_WRAPPER_ROOT OPTIONS="--configfile $SMB_CONF_PATH --option=netbiosname=$maccount --option=security=domain --option=domainlogons=no --option=privatedir=$privatedir" +test_smbpasswd() +{ + account=$1 + + echo "set password with smbpasswd" + + cmd='UID_WRAPPER_INITIAL_RUID=0 UID_WRAPPER_INITIAL_EUID=0 $VALGRIND $BINDIR/smbpasswd -L -c $SMB_CONF_PATH -a -m "$account"' + eval echo "$cmd" + out=$(eval $cmd) + ret=$? + rm -f $tmpfile + + if [ $ret -ne 0 ]; then + echo "Failed to change user password $user" + return 1 + fi +} + + testit "mkdir -p $privatedir" mkdir -p $privatedir || failed=`expr $failed + 1` -testit "smbpasswd -a -m" $VALGRIND $BINDIR/smbpasswd -L -c $SMB_CONF_PATH -a -m "$maccount" || failed=`expr $failed + 1` +testit "smbpasswd -a -m" \ + test_smbpasswd $maccount \ + || failed=$(expr $failed + 1) testit "net_rpc_oldjoin" $VALGRIND $BINDIR/net rpc oldjoin -S $SERVER $OPTIONS || failed=`expr $failed + 1` testit "net_rpc_testjoin1" $VALGRIND $BINDIR/net rpc testjoin -S $SERVER $OPTIONS || failed=`expr $failed + 1` testit "net_rpc_changetrustpw" $VALGRIND $BINDIR/net rpc changetrustpw -S $SERVER $OPTIONS || failed=`expr $failed + 1` diff --git a/testprogs/blackbox/test_password_settings.sh b/testprogs/blackbox/test_password_settings.sh index 93e03770ed2..600bf0d0751 100755 --- a/testprogs/blackbox/test_password_settings.sh +++ b/testprogs/blackbox/test_password_settings.sh @@ -52,6 +52,31 @@ do_kinit() { fi } +test_smbpasswd() +{ + user=$1 + newpass=$2 + + tmpfile=$PREFIX/smbpasswd_change_password_script + cat > $tmpfile < $PREFIX/tmpsmbpasswdscript < $tmpfile < ./tmpsmbpasswdscript <