fstests: move test group info to test files
[xfstests-dev.git] / tests / ext4 / 307
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FSQA Test No. 307
6 #
7 # Check data integrity during defrag compacting
8 #
9 . ./common/preamble
10 _begin_fstest auto ioctl rw defrag
11
12 # Import common functions.
13 . ./common/filter
14 . ./common/defrag
15 # Disable all sync operations to get higher load
16 FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0"
17 _workout()
18 {
19         echo ""
20         echo "Run fsstress"
21         out=$SCRATCH_MNT/fsstress.$$
22         args=`_scale_fsstress_args -p4 -n999 -f setattr=1 $FSSTRESS_AVOID -d $out`
23         echo "fsstress $args" >> $seqres.full
24         $FSSTRESS_PROG $args > /dev/null 2>&1
25         find $out -type f > $out.list
26         cat $out.list | xargs  md5sum > $out.md5sum
27         usage=`du -sch $out | tail -n1 | gawk '{ print $1 }'`
28         echo "Allocate donor file"
29         $XFS_IO_PROG -c "falloc 0 250M" -f $SCRATCH_MNT/donor | _filter_xfs_io
30         echo "Perform compacting"
31         cat $out.list | run_check $here/src/e4compact \
32                 -i -v -f $SCRATCH_MNT/donor  >> $seqres.full 2>&1
33         echo "Check data"
34         run_check md5sum -c $out.md5sum
35 }
36
37 # real QA test starts here
38 _supported_fs generic
39 _supported_fs ext4
40 _require_scratch
41 _require_defrag
42 _require_xfs_io_command "falloc"
43
44 _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1
45 _scratch_mount
46
47 _workout
48 status=0
49 exit