# with 2 second delays on pread/pwrite.
if [ $# -lt 6 ]; then
- echo Usage: $0 SERVERCONFFILE SMBCLIENT SMBCONTROL IP aio_delay_inject_sharename PREFIX
- exit 1
+ echo Usage: $0 SERVERCONFFILE SMBCLIENT SMBCONTROL IP aio_delay_inject_sharename PREFIX
+ exit 1
fi
CONFIGURATION=$1
# Create the smbclient communication pipes.
mkfifo $FIFO_STDIN $FIFO_STDOUT $FIFO_STDERR
if [ $? -ne 0 ]; then
- echo "Failed to create fifos"
- exit 1
+ echo "Failed to create fifos"
+ exit 1
fi
# Create a large-ish testfile
head -c 100MB /dev/zero >$TESTFILE
-CLI_FORCE_INTERACTIVE=1; export CLI_FORCE_INTERACTIVE
+CLI_FORCE_INTERACTIVE=1
+export CLI_FORCE_INTERACTIVE
${smbclient} //${SERVER}/${SHARE} ${CONFIGURATION} -U${USER}%${PASSWORD} \
- < $FIFO_STDIN > $FIFO_STDOUT 2>$FIFO_STDERR &
+ <$FIFO_STDIN >$FIFO_STDOUT 2>$FIFO_STDERR &
CLIENT_PID=$!
count=0
while [ 1 ]; do
- if [ $count -ge 20 ]; then
- echo "Failed to start smbclient"
- exit 1
- fi
- kill -0 $CLIENT_PID
- if [ $? -eq 0 ]; then
- break
- fi
- sleep 0.5
- count=$((count + 1))
+ if [ $count -ge 20 ]; then
+ echo "Failed to start smbclient"
+ exit 1
+ fi
+ kill -0 $CLIENT_PID
+ if [ $? -eq 0 ]; then
+ break
+ fi
+ sleep 0.5
+ count=$((count + 1))
done
-exec 100>$FIFO_STDIN 101<$FIFO_STDOUT 102<$FIFO_STDERR
+exec 100>$FIFO_STDIN 101<$FIFO_STDOUT 102<$FIFO_STDERR
# consume the smbclient startup messages
head -n 1 <&101
# Close the aio_delay_inject share whilst we have outstanding writes.
testit "smbcontrol" ${SMBCONTROL} ${CONFIGURATION} smbd close-share ${SHARE} ||
- failed=$(expr $failed + 1)
+ failed=$(expr $failed + 1)
sleep 0.5
# BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301
#
COUNT=$(head -n 2 <&102 |
- grep -e NT_STATUS_NETWORK_NAME_DELETED -e NT_STATUS_INVALID_HANDLE |
- wc -l)
+ grep -e NT_STATUS_NETWORK_NAME_DELETED -e NT_STATUS_INVALID_HANDLE |
+ wc -l)
testit "Verify close-share did cancel the file put" \
- test $COUNT -ge 1 || failed=$(expr $failed + 1)
+ test $COUNT -ge 1 || failed=$(expr $failed + 1)
kill ${CLIENT_PID}
# Remove the testfile from the server
test_smbclient "remove_testfile" \
- 'del testfile; quit' //${SERVER}/${SHARE} -U${USER}%${PASSWORD} \
- || failed=$(expr $failed + 1)
+ 'del testfile; quit' //${SERVER}/${SHARE} -U${USER}%${PASSWORD} ||
+ failed=$(expr $failed + 1)
testok $0 $failed