From: Ralph Boehme Date: Fri, 7 Jul 2017 11:12:19 +0000 (+0200) Subject: selftest: add a test for accessing previous version of directories with snapdirsevery... X-Git-Tag: samba-4.5.13~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2cae38b094e4b2e2dd5dbbb63a8f10245c1883c7;p=thirdparty%2Fsamba.git selftest: add a test for accessing previous version of directories with snapdirseverywhere Bug: https://bugzilla.samba.org/show_bug.cgi?id=12885 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Sat Jul 8 00:33:51 CEST 2017 on sn-devel-144 (cherry picked from commit cc9ba98c08665e0ed6927fd81fa43a7bb7842e45) --- diff --git a/source3/script/tests/test_shadow_copy.sh b/source3/script/tests/test_shadow_copy.sh index 783e7f324a6..eba873f6525 100755 --- a/source3/script/tests/test_shadow_copy.sh +++ b/source3/script/tests/test_shadow_copy.sh @@ -221,6 +221,26 @@ test_fetch_snap_file() -c "get ${SNAPSHOTS[$snapidx]}/$path $WORKDIR/foo" } +# Test fetching a previous version of a file +test_fetch_snap_dir() +{ + local share + local path + local snapidx + + share=$1 + path=$2 + snapidx=$3 + + # This first command is not strictly needed, but it causes the snapshots to + # appear in a network trace which helps debugging... + $SMBCLIENT -U$USERNAME%$PASSWORD "//$SERVER/$share" -I $SERVER_IP \ + -c "allinfo $path" + + $SMBCLIENT -U$USERNAME%$PASSWORD "//$SERVER/$share" -I $SERVER_IP \ + -c "ls ${SNAPSHOTS[$snapidx]}/$path/*" +} + test_shadow_copy_fixed() { local share #share to contact @@ -329,6 +349,9 @@ test_shadow_copy_everywhere() test_fetch_snap_file $share "bar/lfoo" 3 || \ failed=`expr $failed + 1` + testit "list a previous version directory" \ + test_fetch_snap_dir $share "bar" 6 || \ + failed=`expr $failed + 1` } test_shadow_copy_format()