diff --git a/selftest/knownfail.d/samba3.blackbox.shadow_copy_torture b/selftest/knownfail.d/samba3.blackbox.shadow_copy_torture new file mode 100644 index 00000000000..aa68c3f3bbe --- /dev/null +++ b/selftest/knownfail.d/samba3.blackbox.shadow_copy_torture @@ -0,0 +1 @@ +^samba3.blackbox.shadow_copy_torture.fix inodes with hardlink\(fileserver\) diff --git a/source3/script/tests/test_shadow_copy_torture.sh b/source3/script/tests/test_shadow_copy_torture.sh index 68cd97e6364..e5dc0192e95 100755 --- a/source3/script/tests/test_shadow_copy_torture.sh +++ b/source3/script/tests/test_shadow_copy_torture.sh @@ -36,6 +36,9 @@ build_files() destdir=$1 echo "$content" > $destdir/foo + + mkdir -p $WORKDIR/subdir/ + touch $WORKDIR/subdir/hardlink } # build a snapshots directory @@ -48,6 +51,9 @@ build_snapshots() mkdir -p $snapdir/$SNAPSHOT build_files $snapdir/$SNAPSHOT + + mkdir -p $snapdir/$SNAPSHOT/subdir + ln "$WORKDIR"/subdir/hardlink "$snapdir"/$SNAPSHOT/subdir/hardlink } build_stream_on_snapshot() @@ -126,6 +132,24 @@ test_shadow_copy_openroot() failed=`expr $failed + 1` } +test_shadow_copy_fix_inodes() +{ + local msg + + msg=$1 + + #delete snapshots from previous tests + find $WORKDIR -name ".snapshots" -exec rm -rf {} \; 1>/dev/null 2>&1 + build_snapshots + + out=$($SMBCLIENT \ + -U $USERNAME%$PASSWORD \ + "//$SERVER/shadow_write" \ + -c "open $SNAPSHOT/subdir/hardlink") || failed=`expr $failed + 1` + echo $out + echo $out | grep "hardlink: for read/write fnum 1" || return 1 +} + build_files $WORKDIR # test open for writing and write behaviour of snapshoted files @@ -135,4 +159,6 @@ test_shadow_copy_stream "reading stream of snapshotted file" test_shadow_copy_openroot "opening root of shadow copy share" +testit "fix inodes with hardlink" test_shadow_copy_fix_inodes || failed=`expr $failed + 1` + exit $failed