2016-09-25 19:35:12 +02:00
#!/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
2017-03-15 12:37:08 +01:00
SMB_UNC = " // $SERVER /sub_dug "
2016-09-25 19:35:12 +02:00
2017-03-15 12:37:08 +01:00
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)" \
2016-09-25 19:35:12 +02:00
"ls" " $SMB_UNC " " -U $USERNAME % $PASSWORD " || failed = $( expr $failed + 1)
2020-08-17 13:39:58 +02:00
SMB_UNC = " // $SERVER /sub_valid_users "
test_smbclient "Test login to share with substitution for valid users" \
"ls" " $SMB_UNC " " -U $USERNAME % $PASSWORD " || failed = $( expr $failed + 1)
2020-10-19 16:20:04 +03:00
SMB_UNC = " // $SERVER /sub_valid_users_domain "
test_smbclient "Test login to share with substitution for valid user's domain" \
"ls" " $SMB_UNC " " -U $USERNAME % $PASSWORD " || failed = $( expr $failed + 1)
SMB_UNC = " // $SERVER /sub_valid_users_group "
test_smbclient "Test login to share with substitution for valid user's UNIX group" \
"ls" " $SMB_UNC " " -U $USERNAME % $PASSWORD " || failed = $( expr $failed + 1)
2016-09-25 19:35:12 +02:00
exit $failed