From 8daa83a594a2e98f39d764422bfbdbc62c9efd44 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 19:20:00 +0200 Subject: Adding upstream version 2:4.20.0+dfsg. Signed-off-by: Daniel Baumann --- source3/script/tests/test_deadtime.sh | 67 +++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100755 source3/script/tests/test_deadtime.sh (limited to 'source3/script/tests/test_deadtime.sh') diff --git a/source3/script/tests/test_deadtime.sh b/source3/script/tests/test_deadtime.sh new file mode 100755 index 0000000..3d6368e --- /dev/null +++ b/source3/script/tests/test_deadtime.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash +# +# Test deadtime parameter +# + +if [ $# -lt 1 ]; then + echo Usage: test_deadtime.sh IP + exit 1 +fi + +server=$1 + +incdir=$(dirname $0)/../../../testprogs/blackbox +. $incdir/subunit.sh +. $incdir/common_test_fns.inc + +failed=0 + +smbclient="$BINDIR/smbclient" +smbcontrol="$BINDIR/smbcontrol" + +global_inject_conf=$(dirname $SMB_CONF_PATH)/global_inject.conf + +echo "deadtime = 1" >$global_inject_conf +$smbcontrol smbd reload-config + +cd $SELFTEST_TMPDIR || exit 1 + +# Create the smbclient communication pipes. +rm -f smbclient-stdin smbclient-stdout smbclient-stderr +mkfifo smbclient-stdin smbclient-stdout smbclient-stderr + +export CLI_FORCE_INTERACTIVE=1 +export SAMBA_DEPRECATED_SUPPRESS=1 + +# This gets inherited by smbclient and is required to smbclient doesn't get +# killed by an unhandled SIGPIPE when writing an SMB2 KEEPALIVE packet to the +# connection fd that was already closed by the server. +trap "" SIGPIPE + +$smbclient //$server/tmp -U${USER}%${PASSWORD} \ + smbclient-stdout 2>smbclient-stderr & +client_pid=$! + +sleep 1 + +exec 100>smbclient-stdin 101$global_inject_conf +$smbcontrol smbd reload-config + +rm -f smbclient-stdin smbclient-stdout smbclient-stderr + +testok $0 $failed -- cgit v1.2.3