summaryrefslogtreecommitdiff
path: root/source3/script
diff options
context:
space:
mode:
Diffstat (limited to 'source3/script')
-rwxr-xr-xsource3/script/tests/test_smbclient_s3.sh43
-rwxr-xr-xsource3/script/tests/tests_all.sh4
-rw-r--r--source3/script/tests/tests_smbclient_s3.sh2
3 files changed, 34 insertions, 15 deletions
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
index c10aed0ee6..1d55087c88 100755
--- a/source3/script/tests/test_smbclient_s3.sh
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -2,17 +2,19 @@
# this runs the file serving tests that are expected to pass with samba3
-if [ $# -lt 2 ]; then
+if [ $# -lt 4 ]; then
cat <<EOF
-Usage: test_smbclient_s3.sh SERVER SERVER_IP
+Usage: test_smbclient_s3.sh SERVER SERVER_IP USERNAME PASSWORD
EOF
exit 1;
fi
SERVER="$1"
SERVER_IP="$2"
+USERNAME="$3"
+PASSWORD="$4"
SMBCLIENT="$VALGRIND ${SMBCLIENT:-$BINDIR/smbclient} $CONFIGURATION"
-shift 2
+shift 4
ADDARGS="$*"
incdir=`dirname $0`
@@ -25,9 +27,18 @@ test_noninteractive_no_prompt()
{
prompt="smb"
- echo du | \
- $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I SERVER_IP $ADDARGS 2>&1 | \
- grep $prompt
+ cmd='echo du | $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP $ADDARGS 2>&1'
+ eval echo "$cmd"
+ out=`eval $cmd`
+
+ if [ $? != 0 ] ; then
+ echo "$out"
+ echo "command failed"
+ false
+ return
+ fi
+
+ echo "$out" | grep $prompt >/dev/null 2>&1
if [ $? = 0 ] ; then
# got a prompt .. fail
@@ -49,18 +60,26 @@ du
quit
EOF
- CLI_FORCE_INTERACTIVE=yes \
- $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP \
- $ADDARGS < $tmpfile 2>/dev/null | \
- grep $prompt
+ cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
+ eval echo "$cmd"
+ out=`eval $cmd`
+ ret=$?
+ rm -f $tmpfile
+
+ if [ $ret != 0 ] ; then
+ echo "$out"
+ echo "command failed"
+ false
+ return
+ fi
+
+ echo "$out" | grep $prompt >/dev/null 2>&1
if [ $? = 0 ] ; then
# got a prompt .. succeed
- rm -f $tmpfile
true
else
echo failed to match interactive prompt on stdout
- rm -f $tmpfile
false
fi
}
diff --git a/source3/script/tests/tests_all.sh b/source3/script/tests/tests_all.sh
index 2b46da0e77..11d315b198 100755
--- a/source3/script/tests/tests_all.sh
+++ b/source3/script/tests/tests_all.sh
@@ -20,13 +20,13 @@ smbtorture_s3_encrypted() {
smbclient_s3() {
echo "RUNNING TESTS smbclient_s3"
- $SCRIPTDIR/test_smbclient_s3.sh $SERVER $SERVER_IP \
+ $SCRIPTDIR/test_smbclient_s3.sh $SERVER $SERVER_IP $USERNAME $PASSWORD \
|| failed=`expr $failed + $?`
}
smbclient_s3_encrypted() {
echo "RUNNING TESTS smbclient_s3_encrypted"
- $SCRIPTDIR/test_smbclient_s3.sh $SERVER $SERVER_IP "-e" \
+ $SCRIPTDIR/test_smbclient_s3.sh $SERVER $SERVER_IP $USERNAME $PASSWORD "-e" \
|| failed=`expr $failed + $?`
}
diff --git a/source3/script/tests/tests_smbclient_s3.sh b/source3/script/tests/tests_smbclient_s3.sh
index d48a692d4b..40edf2296f 100644
--- a/source3/script/tests/tests_smbclient_s3.sh
+++ b/source3/script/tests/tests_smbclient_s3.sh
@@ -1 +1 @@
-. $SCRIPTDIR/test_smbclient_s3.sh $SERVER $SERVER_IP
+. $SCRIPTDIR/test_smbclient_s3.sh $SERVER $SERVER_IP $USERNAME $PASSWORD