summaryrefslogtreecommitdiff
path: root/source3/script/tests/test_smbclient_s3.sh
diff options
context:
space:
mode:
Diffstat (limited to 'source3/script/tests/test_smbclient_s3.sh')
-rwxr-xr-xsource3/script/tests/test_smbclient_s3.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
index 98b165e735..d95657467d 100755
--- a/source3/script/tests/test_smbclient_s3.sh
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -40,17 +40,25 @@ test_noninteractive_no_prompt()
test_interactive_prompt_stdout()
{
prompt="smb"
+ tmpfile=/tmp/smbclient.in.$$
- echo du | \
- CLI_FORCE_INTERACTIVE=yes \
- $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp 2>/dev/null | \
+ cat > $tmpfile <<EOF
+du
+quit
+EOF
+
+ CLI_FORCE_INTERACTIVE=yes \
+ $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp \
+ < $tmpfile 2>/dev/null | \
grep $prompt
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
}