2018-10-24 01:46:11 +03:00
#!/bin/sh
if [ $# -lt 5 ] ; then
2022-04-22 16:34:09 +03:00
cat <<EOF
2018-10-24 01:46:11 +03:00
Usage: test_net_rpc_join_creds.sh DOMAIN USERNAME PASSWORD SERVER PREFIX
EOF
2022-04-22 16:34:09 +03:00
exit 1
2018-10-24 01:46:11 +03:00
fi
DOMAIN = " $1 "
USERNAME = " $2 "
PASSWORD = " $3 "
SERVER = " $4 "
PREFIX = " $5 "
shift 5
ADDARGS = " $* "
2022-04-22 16:34:09 +03:00
incdir = $( dirname $0 ) /../../../testprogs/blackbox
2018-10-24 01:46:11 +03:00
. $incdir /subunit.sh
mkdir -p $PREFIX /private
# Test using a credentials file.
credsfile = $PREFIX /creds.$$
2022-04-22 16:34:09 +03:00
printf '%s\n' " username= $USERNAME " " password= $PASSWORD " " domain= $DOMAIN " >" $credsfile "
testit "net_rpc_join_creds" $VALGRIND $BINDIR /net rpc join -S $SERVER --option= netbiosname = netrpcjointest --option= domainlogons = yes --option= privatedir = $PREFIX /private -A" $credsfile " $ADDARGS || failed = $( expr $failed + 1)
testit "net_rpc_testjoin_creds" $VALGRIND $BINDIR /net rpc testjoin -S $SERVER --option= netbiosname = netrpcjointest --option= domainlogons = yes --option= privatedir = $PREFIX /private $ADDARGS || failed = $( expr $failed + 1)
testit "net_rpc_changetrustpw_creds" $VALGRIND $BINDIR /net rpc changetrustpw -S $SERVER --option= netbiosname = netrpcjointest --option= domainlogons = yes --option= privatedir = $PREFIX /private $ADDARGS || failed = $( expr $failed + 1)
testit "net_rpc_testjoin2_creds" $VALGRIND $BINDIR /net rpc testjoin -S $SERVER --option= netbiosname = netrpcjointest --option= domainlogons = yes --option= privatedir = $PREFIX /private $ADDARGS || failed = $( expr $failed + 1)
2018-10-24 01:46:11 +03:00
rm -f $credsfile
testok $0 $failed