summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2022-04-22 15:34:08 +0200
committerJule Anger <janger@samba.org>2023-01-03 18:21:10 +0000
commit4f9430f1260b9bd72a4d8f6a0030f6d139331449 (patch)
tree9527fcc63f54f692308714a01225fdb21b32eea9
parent810ae90aa6c34694c692015bb9f47f56ada811d2 (diff)
downloadsamba-4f9430f1260b9bd72a4d8f6a0030f6d139331449.tar.gz
s3:tests: Reformat test_chdir_cache.sh
shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rwxr-xr-xsource3/script/tests/test_chdir_cache.sh38
1 files changed, 22 insertions, 16 deletions
diff --git a/source3/script/tests/test_chdir_cache.sh b/source3/script/tests/test_chdir_cache.sh
index 6287d17354a..ae244acdd58 100755
--- a/source3/script/tests/test_chdir_cache.sh
+++ b/source3/script/tests/test_chdir_cache.sh
@@ -8,16 +8,21 @@
# Copyright (C) 2021 Jeremy Allison
if [ $# -lt 5 ]; then
- echo Usage: test_chdir_user.sh \
- --configfile=SERVERCONFFILE SMBCLIENT SMBCONTROL SERVER SHARE
-exit 1
+ echo Usage: test_chdir_user.sh \
+ --configfile=SERVERCONFFILE SMBCLIENT SMBCONTROL SERVER SHARE
+ exit 1
fi
-CONF=$1; shift 1
-SMBCLIENT=$1; shift 1
-SMBCONTROL=$1; shift 1
-SERVER=$1; shift 1
-SHARE=$1; shift 1
+CONF=$1
+shift 1
+SMBCLIENT=$1
+shift 1
+SMBCONTROL=$1
+shift 1
+SERVER=$1
+shift 1
+SHARE=$1
+shift 1
# Do not let deprecated option warnings muck this up
SAMBA_DEPRECATED_SUPPRESS=1
@@ -28,7 +33,7 @@ conf_dir=$(dirname ${SERVERCONFFILE})
log_file=${conf_dir}/../smbd_test.log
error_inject_conf=${conf_dir}/error_inject.conf
-> ${error_inject_conf}
+>${error_inject_conf}
incdir=$(dirname $0)/../../../testprogs/blackbox
. $incdir/subunit.sh
@@ -40,15 +45,16 @@ cd $SELFTEST_TMPDIR || exit 1
rm -f smbclient-stdin smbclient-stdout smbclient-stderr
mkfifo smbclient-stdin smbclient-stdout smbclient-stderr
-CLI_FORCE_INTERACTIVE=1; export CLI_FORCE_INTERACTIVE
+CLI_FORCE_INTERACTIVE=1
+export CLI_FORCE_INTERACTIVE
${SMBCLIENT} //${SERVER}/${SHARE} ${CONF} -U${USER}%${PASSWORD} \
- < smbclient-stdin > smbclient-stdout 2>smbclient-stderr &
+ <smbclient-stdin >smbclient-stdout 2>smbclient-stderr &
CLIENT_PID=$!
# Count the number of chdir_current_service: vfs_ChDir.*failed: Permission denied
# errors that are already in the log (should be zero).
-num_errs=`grep "chdir_current_service: vfs_ChDir.*failed: Permission denied" ${log_file} | wc -l`
+num_errs=$(grep "chdir_current_service: vfs_ChDir.*failed: Permission denied" ${log_file} | wc -l)
sleep 1
@@ -73,7 +79,7 @@ echo "tcon ${SHARE}" >&100
head -n 4 <&101
# Ensure any chdir will give EACCESS.
-echo "error_inject:chdir = EACCES" > ${error_inject_conf}
+echo "error_inject:chdir = EACCES" >${error_inject_conf}
${SMBCONTROL} ${CONF} 0 reload-config
sleep 1
@@ -88,15 +94,15 @@ kill ${CLIENT_PID}
rm -f smbclient-stdin smbclient-stdout smbclient-stderr
# Remove the chdir inject.
-> ${error_inject_conf}
+>${error_inject_conf}
${SMBCONTROL} ${CONF} 0 reload-config
# Now look for chdir_current_service: vfs_ChDir.*failed: Permission denied
# in the smb log. There should be one more than before.
-num_errs1=`grep "chdir_current_service: vfs_ChDir.*failed: Permission denied" ${log_file} | wc -l`
+num_errs1=$(grep "chdir_current_service: vfs_ChDir.*failed: Permission denied" ${log_file} | wc -l)
testit "Verify we got at least one chdir error" \
- test $num_errs1 -gt $num_errs || failed=$(expr $failed + 1)
+ test $num_errs1 -gt $num_errs || failed=$(expr $failed + 1)
testok $0 $failed