1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-06 13:18:07 +03:00
samba-mirror/source3/script/tests/test_durable_handle_reconnect.sh
Stefan Metzmacher 14875448ca s3:tests: let test_durable_handle_reconnect.sh run smb2.durable-v2-regressions.durable_v2_reconnect_bug15624
This demonstrates the dead lock after a durable reconnect failed
because the stat info changed, the file can't be accessed anymore
as we leak the incomplete share mode entry in a still running
process.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15624

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2024-09-19 18:27:33 +00:00

55 lines
1.5 KiB
Bash
Executable File

#!/bin/sh
#
# Test Durable Handle reconnect with injected delay in the disconnect.
#
# Copyright (C) 2018 Ralph Boehme
. $(dirname $0)/../../../testprogs/blackbox/subunit.sh
failed=0
cd $SELFTEST_TMPDIR || exit 1
delay_inject_conf=$(dirname $SMB_CONF_PATH)/delay_inject.conf
echo 'delay_inject:fntimes = 5000' >$delay_inject_conf
testit "durable_v2_delay.durable_v2_reconnect_delay" $VALGRIND \
$BINDIR/smbtorture //$SERVER_IP/delay_inject \
-U$USERNAME%$PASSWORD \
smb2.durable-v2-delay.durable_v2_reconnect_delay ||
failed=$(expr $failed + 1)
SMBD_LOG_FILES="$SMBD_TEST_LOG"
if [ $SMBD_DONT_LOG_STDOUT -eq 1 ]; then
_SMBD_LOG_FILE=$(dirname $SMBD_TEST_LOG)/logs/log.smbd
SMBD_LOG_FILES="$SMBD_LOG_FILES $_SMBD_LOG_FILE"
fi
testit "durable_v2_delay.durable_v2_reconnect_delay_msec" $VALGRIND \
$BINDIR/smbtorture //$SERVER_IP/durable \
-U$USERNAME%$PASSWORD \
smb2.durable-v2-delay.durable_v2_reconnect_delay_msec ||
failed=$(expr $failed + 1)
rm $delay_inject_conf
error_inject_conf=$(dirname $SMB_CONF_PATH)/error_inject.conf
cat > $error_inject_conf << _EOF
kernel share modes = no
kernel oplocks = no
posix locking = no
error_inject:durable_reconnect = st_ex_nlink
_EOF
testit "durable-v2-regressions.durable_v2_reconnect_bug15624" \
$VALGRIND $BINDIR/smbtorture //$SERVER_IP/error_inject \
-U$USERNAME%$PASSWORD \
--option=torture:bug15624=yes \
smb2.durable-v2-regressions.durable_v2_reconnect_bug15624 ||
failed=$(expr $failed + 1)
rm $error_inject_conf
testok $0 $failed