1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00
samba-mirror/source3/script/tests/test_printing_var_exp.sh
Jeremy Allison 12b8dbd0bb s3: tests: Change logfile for printing expansion tests.
logfile=/tmp/$USER_printing_var_exp.log -> logfile="${SELFTEST_TMPDIR}/${USER}_printing_var_exp.log"

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Mar 18 02:57:08 UTC 2021 on sn-devel-184
2021-03-18 02:57:08 +00:00

61 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
if [ $# -lt 4 ]; then
cat <<EOF
Usage: test_smbspool.sh SERVER SERVER_IP DOMAIN USERNAME PASSWORD
EOF
exit 1;
fi
SERVER="$1"
SERVER_IP="$2"
DOMAIN="$3"
USERNAME="$4"
PASSWORD="$5"
shift 5
ADDARGS="$@"
incdir=`dirname $0`/../../../testprogs/blackbox
. $incdir/subunit.sh
. $incdir/common_test_fns.inc
smbclient="$BINDIR/smbclient"
test_var_expansion() {
logfile="${SELFTEST_TMPDIR}/${USER}_printing_var_exp.log"
$smbclient -U $DOMAIN/$USERNAME%$PASSWORD \
//$SERVER_IP/print_var_exp \
-c "print $SRCDIR/testdata/printing/example.ps"
if [ $? -ne 0 ] ; then
rm -f "$logfile"
return 1
fi
cat "$logfile"
grep "Windows user: $USERNAME" "$logfile"
if [ $? -ne 0 ] ; then
rm -f "$logfile"
return 1
fi
grep "UNIX user: $USERNAME" "$logfile"
if [ $? -ne 0 ] ; then
rm -f "$logfile"
return 1
fi
grep "Domain: $DOMAIN" "$logfile"
if [ $? -ne 0 ] ; then
rm -f "$logfile"
return 1
fi
rm -f "$logfile"
return 0
}
testit "Test variable expansion for '%U', '%u' and '%D'" \
test_var_expansion \
|| failed=$(expr $failed + 1)
exit $failed