From: Noel Power Date: Thu, 21 Nov 2019 12:31:31 +0000 (+0000) Subject: s3/script/tests: Use protocol param passed to selectively run tests X-Git-Tag: ldb-2.1.0~443 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=921f9f797f125d5e7cfe5505cd4287d23c2ae8f9;p=thirdparty%2Fsamba.git s3/script/tests: Use protocol param passed to selectively run tests samba3.blackbox.smbclient_s3 passes NT1 or SMB3 to run tests however the PROTOCOL param is not used consistently within the script which results in NT1 and SMB3 traffic being produced during testing. This obviously causes issues when running the tests in an test environment where SMB1 cannot be negiotiated. These changes fix this Signed-off-by: Noel Power Reviewed-by: Ralph Boehme --- diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh index 0bae1d78fac..5df8a7cb550 100755 --- a/source3/script/tests/test_smbclient_s3.sh +++ b/source3/script/tests/test_smbclient_s3.sh @@ -331,7 +331,7 @@ test_msdfs_link() tmpfile=$PREFIX/smbclient.in.$$ prompt=" msdfs-target " - cmd='$SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/msdfs-share -I $SERVER_IP $ADDARGS -m nt1 -c dir 2>&1' + cmd='$SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/msdfs-share -I $SERVER_IP $ADDARGS -m $PROTOCOL -c dir 2>&1' out=`eval $cmd` ret=$? @@ -694,7 +694,9 @@ EOF test_bad_names() { # First with SMB1 - cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/badname-tmp -I $SERVER_IP $ADDARGS -mNT1 -c ls 2>&1' + +if [ $PROTOCOL = "NT1" ]; then + cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/badname-tmp -I $SERVER_IP $ADDARGS -m$PROTOCOL -c ls 2>&1' eval echo "$cmd" out=`eval $cmd` ret=$? @@ -752,9 +754,12 @@ test_bad_names() echo "failed listing \\badname-tmp - grep (5) failed with $ret" return 1 fi +fi + +if [ $PROTOCOL = "SMB3" ]; then # Now check again with -mSMB3 - cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/badname-tmp -I $SERVER_IP $ADDARGS -mSMB3 -c ls 2>&1' + cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/badname-tmp -I $SERVER_IP $ADDARGS -m$PROTOCOL -c ls 2>&1' eval echo "$cmd" out=`eval $cmd` ret=$? @@ -812,6 +817,7 @@ test_bad_names() echo "failed listing \\badname-tmp - SMB3 grep (5) failed with $ret" return 1 fi +fi } # Test accessing an share with a name that must be mangled - with acl_xattrs. @@ -862,8 +868,9 @@ del smbclient del scopy_file quit EOF +if [ $PROTOCOL = "SMB3" ]; then # First SMB3 - cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP $ADDARGS -mSMB3 < $tmpfile 2>&1' + cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP $ADDARGS -m$PROTOOCL < $tmpfile 2>&1' eval echo "$cmd" out=`eval $cmd` ret=$? @@ -883,12 +890,13 @@ EOF echo "failed md5sum (1)" return 1 fi - +fi # # Now do again using SMB1 # to force client-side fallback. # +if [ $PROTOCOL = "NT1" ]; then cat > $tmpfile <