]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:tests: Add domain and UPN test for smbget
authorAndreas Schneider <asn@samba.org>
Wed, 29 Mar 2023 06:59:09 +0000 (08:59 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 5 Apr 2023 01:06:29 +0000 (01:06 +0000)
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>
source3/script/tests/test_smbget.sh

index 8f57f671fe9054c6e7a9a8a6502d462883615869..cedb14fabfb814e485ec8ebfc78f273c7a617de5 100755 (executable)
@@ -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)