svn commit: samba r16289 - branches/SAMBA_3_0/source/script/tests
trunk/source/script/tests
jpeach at samba.org
jpeach at samba.org
Fri Jun 16 04:45:00 GMT 2006
Author: jpeach
Date: 2006-06-16 04:44:59 +0000 (Fri, 16 Jun 2006)
New Revision: 16289
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16289
Log:
Fix smbclient test hang. This is caused by readline refusing to believe
the end of file it receives when reading from a pipe after we force
interactive mode.
Modified:
branches/SAMBA_3_0/source/script/tests/test_smbclient_s3.sh
trunk/source/script/tests/test_smbclient_s3.sh
Changeset:
Modified: branches/SAMBA_3_0/source/script/tests/test_smbclient_s3.sh
===================================================================
--- branches/SAMBA_3_0/source/script/tests/test_smbclient_s3.sh 2006-06-16 02:23:23 UTC (rev 16288)
+++ branches/SAMBA_3_0/source/script/tests/test_smbclient_s3.sh 2006-06-16 04:44:59 UTC (rev 16289)
@@ -40,17 +40,25 @@
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
}
Modified: trunk/source/script/tests/test_smbclient_s3.sh
===================================================================
--- trunk/source/script/tests/test_smbclient_s3.sh 2006-06-16 02:23:23 UTC (rev 16288)
+++ trunk/source/script/tests/test_smbclient_s3.sh 2006-06-16 04:44:59 UTC (rev 16289)
@@ -40,17 +40,25 @@
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
}
More information about the samba-cvs
mailing list