]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:script: Improve test_chdir_cache.sh
authorAndreas Schneider <asn@samba.org>
Thu, 22 Dec 2022 09:36:02 +0000 (10:36 +0100)
committerJule Anger <janger@samba.org>
Tue, 3 Jan 2023 18:21:10 +0000 (18:21 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15268

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 0d1961267cd9e8f1158a407c5d135514c363f37e)

source3/script/tests/test_chdir_cache.sh

index ae244acdd58506ddcace5323e4154ff4900a65e3..c649d2b07b3fb278401300b04e3645eab3596c30 100755 (executable)
@@ -33,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}
+rm -f ${error_inject_conf}
 
 incdir=$(dirname $0)/../../../testprogs/blackbox
 . $incdir/subunit.sh
@@ -80,7 +80,9 @@ head -n 4 <&101
 
 # Ensure any chdir will give EACCESS.
 echo "error_inject:chdir = EACCES" >${error_inject_conf}
-${SMBCONTROL} ${CONF} 0 reload-config
+testit "reload config 1" \
+       "${SMBCONTROL}" "${CONF}" smbd reload-config ||
+       failed=$((failed + 1))
 
 sleep 1
 
@@ -94,8 +96,10 @@ kill ${CLIENT_PID}
 rm -f smbclient-stdin smbclient-stdout smbclient-stderr
 
 # Remove the chdir inject.
->${error_inject_conf}
-${SMBCONTROL} ${CONF} 0 reload-config
+rm -f ${error_inject_conf}
+testit "reload config 2" \
+       "${SMBCONTROL}" "${CONF}" smbd reload-config ||
+       failed=$((failed + 1))
 
 # Now look for chdir_current_service: vfs_ChDir.*failed: Permission denied
 # in the smb log. There should be one more than before.