From: Jeremy Allison Date: Tue, 5 May 2020 00:57:29 +0000 (-0700) Subject: s3: torture: Add samba3.blackbox.NT1.shadow_copy_torture. X-Git-Tag: ldb-2.2.0~648 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=35be625b09fd7ac2d325aca290c29d40c53a4ca3;p=thirdparty%2Fsamba.git s3: torture: Add samba3.blackbox.NT1.shadow_copy_torture. Runs the SMB1 root @GMT-pathname open test. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/script/tests/test_smb1_shadow_copy_torture.sh b/source3/script/tests/test_smb1_shadow_copy_torture.sh new file mode 100755 index 00000000000..cae9c023f82 --- /dev/null +++ b/source3/script/tests/test_smb1_shadow_copy_torture.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# +# Blackbox test for shadow_copy2 VFS - SMB1 only. +# + +if [ $# -lt 7 ]; then +cat < $destdir/foo +} + +# build a snapshots directory +build_snapshots() +{ + local snapdir + + snapdir=$WORKDIR/.snapshots + + mkdir -p $snapdir + mkdir $snapdir/$SNAPSHOT + + build_files $snapdir/$SNAPSHOT +} + +test_shadow_copy_openroot() +{ + local msg + + msg=$1 + + #delete snapshots from previous tests + find $WORKDIR -name ".snapshots" -exec rm -rf {} \; 1>/dev/null 2>&1 + build_snapshots + + testit "opening shadow copy root of share over SMB1" \ + $SMBTORTURE \ + -U$USERNAME%$PASSWORD \ + "//$SERVER/shadow_write" \ + --option="torture:twrp_snapshot=$SNAPSHOT" \ + base.smb1-twrp-openroot || \ + failed=`expr $failed + 1` +} + +build_files $WORKDIR + +# test open for writing and write behaviour of snapshoted files +test_shadow_copy_openroot "opening root of shadow copy share" + +exit $failed diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index 45b8dca56c2..73bb1a36cd8 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -418,6 +418,9 @@ for env in ["fileserver"]: plantestsuite("samba3.blackbox.sacl_get_set", env, [os.path.join(samba3srcdir, "script/tests/test_sacl_set_get.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', smbtorture3, net, 'tmp']) + plantestsuite("samba3.blackbox.NT1.shadow_copy_torture", env + "_smb1_done", + [os.path.join(samba3srcdir, "script/tests/test_smb1_shadow_copy_torture.sh"), + '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/shadow', smbtorture4]) # # tar command tests