s3-selftest: Add a substituions testcase
[Samba.git] / source3 / script / tests / test_substitutions.sh
blob0852ad969f02ae7b8f6c83aab996f92e72be3f55
1 #!/bin/sh
2 # Blackbox tests for substitutions
4 # Copyright (c) 2016 Andreas Schneider <asn@samba.org>
6 if [ $# -lt 4 ]; then
7 cat <<EOF
8 Usage: test_substitutions.sh SERVER USERNAME PASSWORD PREFIX
9 EOF
10 exit 1;
13 SERVER=$1
14 USERNAME=$2
15 PASSWORD=$3
16 PREFIX=$4
17 shift 4
18 failed=0
20 samba_bindir="$BINDIR"
21 samba_srcdir="$SRCDIR"
22 smbclient="$samba_bindir/smbclient"
24 . $samba_srcdir/testprogs/blackbox/subunit.sh
25 . $samba_srcdir/testprogs/blackbox/common_test_fns.inc
27 SMB_UNC="//$SERVER/subDUG"
29 test_smbclient "Test login to share with substitution" \
30 "ls" "$SMB_UNC" "-U$USERNAME%$PASSWORD" || failed=$(expr $failed + 1)
32 exit $failed