Fix smbclient test hang. This is caused by readline refusing to believe
authorjpeach <jpeach@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Fri, 16 Jun 2006 04:44:59 +0000 (04:44 +0000)
committerjpeach <jpeach@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Fri, 16 Jun 2006 04:44:59 +0000 (04:44 +0000)
the end of file it receives when reading from a pipe after we force
interactive mode.

git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_3_0@16289 0c0555d6-39d7-0310-84fc-f1cc0bd64818

source/script/tests/test_smbclient_s3.sh

index 98b165e7358ae7776684fc38ec98d3b96271c3ef..d95657467d79e4882a11d2abd21a614ce6726646 100755 (executable)
@@ -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
 }