diff options
-rw-r--r-- | selftest/knownfail.d/veto_files | 1 | ||||
-rwxr-xr-x | selftest/target/Samba3.pm | 4 | ||||
-rwxr-xr-x | source3/script/tests/test_veto_files.sh | 25 |
3 files changed, 30 insertions, 0 deletions
diff --git a/selftest/knownfail.d/veto_files b/selftest/knownfail.d/veto_files new file mode 100644 index 00000000000..be28da859b7 --- /dev/null +++ b/selftest/knownfail.d/veto_files @@ -0,0 +1 @@ +^samba3.blackbox.test_veto_files.list.files.fileserver diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index e0e3c026fa6..0556efd4741 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -1974,6 +1974,10 @@ sub setup_fileserver path = $veto_sharedir delete veto files = yes +[veto_files_nohidden] + path = $veto_sharedir + veto files = /.*/ + [veto_files] path = $veto_sharedir veto files = /veto_name*/ diff --git a/source3/script/tests/test_veto_files.sh b/source3/script/tests/test_veto_files.sh index e246e864b32..201883ee330 100755 --- a/source3/script/tests/test_veto_files.sh +++ b/source3/script/tests/test_veto_files.sh @@ -22,10 +22,14 @@ SHAREPATH=${5} SMBCLIENT=${6} shift 6 SMBCLIENT="$VALGRIND ${SMBCLIENT}" +# Used by test_smbclient() +# shellcheck disable=2034 +smbclient="$VALGRIND ${SMBCLIENT}" ADDARGS="$@" incdir=$(dirname "$0")/../../../testprogs/blackbox . "$incdir"/subunit.sh +. "${incdir}/common_test_fns.inc" failed=0 @@ -45,6 +49,8 @@ do_cleanup() rm -rf "$SHAREPATH/veto_name_dir\"mangle" rm -f "$SHAREPATH/veto_name_file" rm -f "$SHAREPATH/veto_name_file\"mangle" + rm -f "${SHAREPATH}/regular_file" + rm -f "${SHAREPATH}/.hidden_file" ) } @@ -185,6 +191,25 @@ test_create_veto_file() do_cleanup +echo "regular_file" > "${SHAREPATH}/regular_file" +echo "hidden_file" > "${SHAREPATH}/.hidden_file" + +test_smbclient "download regular file" \ + "get regular_file" "//${SERVER}/veto_files_nohidden" \ + -U"${USERNAME}%${PASSWORD}" || + failed=$((failed + 1)) +rm -f regular_file +test_smbclient_expect_failure "hidden file can't be downloaded" \ + "get .hidden_file" "//${SERVER}/veto_files_nohidden" \ + -U"${USERNAME}%${PASSWORD}" || + failed=$((failed + 1)) +test_smbclient "list files" \ + "ls" "//${SERVER}/veto_files_nohidden" \ + -U"${USERNAME}%${PASSWORD}" || + failed=$((failed + 1)) + +do_cleanup + # Using hash2, veto_name_file\"mangle == VHXE5P~M # Using hash2, veto_name_dir\"mangle == VF5SKC~B |