1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-07 17:18:11 +03:00
samba-mirror/source3/script/tests/test_substitutions.sh
Andreas Schneider 2be02fdd1e s3:tests: Add a subsitution test for %D %u %g
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12699

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-03-30 00:33:13 +02:00

38 lines
806 B
Bash
Executable File

#!/bin/sh
# Blackbox tests for substitutions
#
# Copyright (c) 2016 Andreas Schneider <asn@samba.org>
if [ $# -lt 4 ]; then
cat <<EOF
Usage: test_substitutions.sh SERVER USERNAME PASSWORD PREFIX
EOF
exit 1;
fi
SERVER=$1
USERNAME=$2
PASSWORD=$3
PREFIX=$4
shift 4
failed=0
samba_bindir="$BINDIR"
samba_srcdir="$SRCDIR"
smbclient="$samba_bindir/smbclient"
. $samba_srcdir/testprogs/blackbox/subunit.sh
. $samba_srcdir/testprogs/blackbox/common_test_fns.inc
SMB_UNC="//$SERVER/sub_dug"
test_smbclient "Test login to share with substitution (DUG)" \
"ls" "$SMB_UNC" "-U$USERNAME%$PASSWORD" || failed=$(expr $failed + 1)
SMB_UNC="//$SERVER/sub_dug2"
test_smbclient "Test login to share with substitution (Dug)" \
"ls" "$SMB_UNC" "-U$USERNAME%$PASSWORD" || failed=$(expr $failed + 1)
exit $failed