From d81acef3924ef1484e3e0467e6441f4792c84f3d Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 29 Mar 2023 08:59:09 +0200 Subject: s3:tests: Add domain and UPN test for smbget BUG: https://bugzilla.samba.org/show_bug.cgi?id=15345 Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- source3/script/tests/test_smbget.sh | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'source3') diff --git a/source3/script/tests/test_smbget.sh b/source3/script/tests/test_smbget.sh index 8f57f671fe9..cedb14fabfb 100755 --- a/source3/script/tests/test_smbget.sh +++ b/source3/script/tests/test_smbget.sh @@ -82,6 +82,50 @@ test_singlefile_U() return 0 } +test_singlefile_U_UPN() +{ + clear_download_area + + ${SMBGET} -v -U"${DC_USERNAME}@${REALM}%${DC_PASSWORD}" \ + "smb://${SERVER_IP}/smbget/testfile" + ret=${?} + if [ ${ret} -ne 0 ]; then + echo 'ERROR: RC does not match, expected: 0' + return 1 + fi + + cmp --silent "${WORKDIR}/testfile" ./testfile + ret=${?} + if [ ${ret} -ne 0 ]; then + echo 'ERROR: file content does not match' + return 1 + fi + + return 0 +} + +test_singlefile_U_domain() +{ + clear_download_area + + ${SMBGET} -v -U"${DOMAIN}/${DC_USERNAME}%${DC_PASSWORD}" \ + "smb://${SERVER_IP}/smbget/testfile" + ret=${?} + if [ ${ret} -ne 0 ]; then + echo 'ERROR: RC does not match, expected: 0' + return 1 + fi + + cmp --silent "${WORKDIR}/testfile" ./testfile + ret=${?} + if [ ${ret} -ne 0 ]; then + echo 'ERROR: file content does not match' + return 1 + fi + + return 0 +} + test_singlefile_smburl() { clear_download_area @@ -310,6 +354,12 @@ testit "download single file as guest" test_singlefile_guest || testit "download single file with -U" test_singlefile_U || failed=$(expr $failed + 1) +testit "download single file with -U and domain" test_singlefile_U_domain || + failed=$((failed + 1)) + +testit "download single file with -U and UPN" test_singlefile_U_UPN || + failed=$((failed + 1)) + testit "download single file with smb URL" test_singlefile_smburl || failed=$(expr $failed + 1) -- cgit v1.2.1