diff options
author | Andreas Schneider <asn@samba.org> | 2023-03-31 09:36:46 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2023-04-05 01:06:29 +0000 |
commit | a2ba787780c215bd6e9358ec358adbf863eb5c77 (patch) | |
tree | 1e8ba2b4f8aebdb12f8ae6e857fac18b5d37c65e /source3 | |
parent | ada8cd6a6274f8266ee66e56d164d48f2e1bc41a (diff) | |
download | samba-a2ba787780c215bd6e9358ec358adbf863eb5c77.tar.gz |
s3:tests: Add encryption test for smbget
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3')
-rwxr-xr-x | source3/script/tests/test_smbget.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/source3/script/tests/test_smbget.sh b/source3/script/tests/test_smbget.sh index bb9fde3838c..9afbe240138 100755 --- a/source3/script/tests/test_smbget.sh +++ b/source3/script/tests/test_smbget.sh @@ -375,6 +375,35 @@ test_limit_rate() return 0 } +test_encrypt() +{ + clear_download_area + $SMBGET --verbose --encrypt -U$USERNAME%$PASSWORD smb://$SERVER_IP/smbget/testfile + if [ $? -ne 0 ]; then + echo 'ERROR: RC does not match, expected: 0' + return 1 + fi + cmp --silent $WORKDIR/testfile ./testfile + if [ $? -ne 0 ]; then + echo 'ERROR: file content does not match' + return 1 + fi + + clear_download_area + $SMBGET --verbose --client-protection=encrypt -U$USERNAME%$PASSWORD smb://$SERVER_IP/smbget/testfile + if [ $? -ne 0 ]; then + echo 'ERROR: RC does not match, expected: 0' + return 1 + fi + cmp --silent $WORKDIR/testfile ./testfile + if [ $? -ne 0 ]; then + echo 'ERROR: file content does not match' + return 1 + fi + + return 0 +} + create_test_data @@ -429,6 +458,9 @@ testit "msdfs.upn" test_msdfs_link_upn || testit "limit rate" test_limit_rate || failed=$((failed + 1)) +testit "encrypt" test_encrypt || + failed=$((failed + 1)) + clear_download_area popd # TMPDIR |