diff options
author | Ralph Boehme <slow@samba.org> | 2018-11-23 14:36:56 +0100 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2018-11-27 07:13:13 +0100 |
commit | cfffa2e2428b42db65a4ece00602e0cef8ceb5a3 (patch) | |
tree | 160f9755cb1fc8df422f1297d9a6a7d03e9da6f6 /source3 | |
parent | cf95756235f718478e556ce1fbf7c032f9c9acfb (diff) | |
download | samba-cfffa2e2428b42db65a4ece00602e0cef8ceb5a3.tar.gz |
s3:selftest: add a VSS test reading a stream
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3')
-rwxr-xr-x | source3/script/tests/test_shadow_copy_torture.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/source3/script/tests/test_shadow_copy_torture.sh b/source3/script/tests/test_shadow_copy_torture.sh index d47cd512a20..3b05fc50f72 100755 --- a/source3/script/tests/test_shadow_copy_torture.sh +++ b/source3/script/tests/test_shadow_copy_torture.sh @@ -48,6 +48,13 @@ build_snapshots() build_files $snapdir/$SNAPSHOT } +build_stream_on_snapshot() +{ + file=$WORKDIR/.snapshots/$SNAPSHOT/foo + + setfattr -n 'user.DosStream.bar:$DATA' -v baz $file || return 1 +} + test_shadow_copy_write() { local msg @@ -68,9 +75,40 @@ test_shadow_copy_write() failed=`expr $failed + 1` } +test_shadow_copy_stream() +{ + local msg + + msg=$1 + + #delete snapshots from previous tests + find $WORKDIR -name ".snapshots" -exec rm -rf {} \; 1>/dev/null 2>&1 + build_snapshots + build_stream_on_snapshot || { + subunit_start_test msg + subunit_skip_test msg <<EOF +test_shadow_copy_stream needs an fs with xattrs +EOF + return 0 + } + + testit "reading stream of a shadow copy of a file" \ + $SMBTORTURE \ + -U$USERNAME%$PASSWORD \ + "//$SERVER/shadow_write" \ + --option="torture:twrp_file=foo" \ + --option="torture:twrp_stream=bar" \ + --option="torture:twrp_stream_size=3" \ + --option="torture:twrp_snapshot=$SNAPSHOT" \ + smb2.twrp.stream || \ + failed=`expr $failed + 1` +} + build_files $WORKDIR # test open for writing and write behaviour of snapshoted files test_shadow_copy_write "write behaviour of snapshoted files" +test_shadow_copy_stream "reading stream of snapshotted file" + exit $failed |