diff options
author | Andreas Schneider <asn@samba.org> | 2023-01-23 10:21:33 +0100 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2023-02-10 10:52:15 +0000 |
commit | fd2cb3197ba016bd0e703b9bee07697f0e8de32e (patch) | |
tree | 0dc0ba449f56892f9572199343ded39c8eddfc1c | |
parent | 550faa99fc81520ada220fe1fd972984522c14f2 (diff) | |
download | samba-fd2cb3197ba016bd0e703b9bee07697f0e8de32e.tar.gz |
s3:tests: Add support for SMBD_DONT_LOG_STDOUT=1 in test_chdir_cache.sh
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15291
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit fd7187daed85f4ea51762c029ae8ef3fa893b2fb)
-rwxr-xr-x | source3/script/tests/test_chdir_cache.sh | 16 | ||||
-rwxr-xr-x | source3/selftest/tests.py | 4 |
2 files changed, 16 insertions, 4 deletions
diff --git a/source3/script/tests/test_chdir_cache.sh b/source3/script/tests/test_chdir_cache.sh index c649d2b07b3..11967180d35 100755 --- a/source3/script/tests/test_chdir_cache.sh +++ b/source3/script/tests/test_chdir_cache.sh @@ -9,7 +9,7 @@ if [ $# -lt 5 ]; then echo Usage: test_chdir_user.sh \ - --configfile=SERVERCONFFILE SMBCLIENT SMBCONTROL SERVER SHARE + --configfile=SERVERCONFFILE SMBCLIENT SMBCONTROL SERVER SHARE PREFIX TESTENV exit 1 fi @@ -23,6 +23,12 @@ SERVER=$1 shift 1 SHARE=$1 shift 1 +PREFIX=${1} +shift 1 +TESTENV=${1} +shift 1 + +PREFIX_ABS="$(readlink -f "${PREFIX}")" # Do not let deprecated option warnings muck this up SAMBA_DEPRECATED_SUPPRESS=1 @@ -30,8 +36,6 @@ export SAMBA_DEPRECATED_SUPPRESS conf_dir=$(dirname ${SERVERCONFFILE}) -log_file=${conf_dir}/../smbd_test.log - error_inject_conf=${conf_dir}/error_inject.conf rm -f ${error_inject_conf} @@ -52,6 +56,12 @@ ${SMBCLIENT} //${SERVER}/${SHARE} ${CONF} -U${USER}%${PASSWORD} \ <smbclient-stdin >smbclient-stdout 2>smbclient-stderr & CLIENT_PID=$! +log_file="${PREFIX_ABS}/${TESTENV}/smbd_test.log" +# Add support for "SMBD_DONT_LOG_STDOUT=1" +if [ -r "${PREFIX_ABS}/${TESTENV}/logs/log.smbd" ]; then + log_file="${PREFIX_ABS}/${TESTENV}/logs/log.smbd" +fi + # 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) diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index 8039b4a8171..93c45c9b2eb 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -1400,7 +1400,9 @@ plantestsuite("samba3.blackbox.chdir-cache", "simpleserver:local", os.path.join(bindir(), "smbclient"), os.path.join(bindir(), "smbcontrol"), '$SERVER_IP', - "error_inject"]) + "error_inject", + '$PREFIX', + 'simpleserver']) plantestsuite("samba3.blackbox.netfileenum", "simpleserver:local", [os.path.join(samba3srcdir, |