summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2023-03-29 08:59:09 +0200
committerAndrew Bartlett <abartlet@samba.org>2023-04-05 01:06:29 +0000
commitd81acef3924ef1484e3e0467e6441f4792c84f3d (patch)
tree82eff30865bc93d2aaefb0a8a351978c704b4634 /source3
parent1104916d227550f7c445e61d8ee3b62983c052c4 (diff)
downloadsamba-d81acef3924ef1484e3e0467e6441f4792c84f3d.tar.gz
s3:tests: Add domain and UPN test for smbget
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15345 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3')
-rwxr-xr-xsource3/script/tests/test_smbget.sh50
1 files changed, 50 insertions, 0 deletions
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)