mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
generic: inconsistent initial state for test_generic_punch
The first test may start with the file from the previous test, and that is in an unknown state. Hence always remove the test file before the first test so that it doesn't have extents inside the test range as it is supposed to be testing into a hole. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
committed by
Dave Chinner
parent
9c5d298030
commit
4356e45379
+4
-3
@@ -318,10 +318,11 @@ _test_generic_punch()
|
||||
filter_cmd=$5
|
||||
testfile=$6
|
||||
|
||||
# initial test state must be defined, otherwise the first test can fail
|
||||
# due ot stale file state left from previous tests.
|
||||
rm -f $testfile
|
||||
|
||||
echo " 1. into a hole"
|
||||
if [ "$remove_testfile" ]; then
|
||||
rm -f $testfile
|
||||
fi
|
||||
$XFS_IO_PROG -f -c "truncate 20k" \
|
||||
-c "$zero_cmd 4k 8k" \
|
||||
-c "$map_cmd -v" $testfile | $filter_cmd
|
||||
|
||||
@@ -158,9 +158,7 @@ eecb7aa303d121835de05028751d301c
|
||||
0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
|
||||
*
|
||||
1. into a hole
|
||||
0: [0..7]: extent
|
||||
1: [8..39]: hole
|
||||
5a58e46082be047d0f13bee7974015b9
|
||||
daa100df6e6711906b61c9ab5aa16032
|
||||
2. into allocated space
|
||||
0: [0..7]: extent
|
||||
1: [8..23]: hole
|
||||
@@ -242,9 +240,7 @@ eecb7aa303d121835de05028751d301c
|
||||
0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
|
||||
*
|
||||
1. into a hole
|
||||
0: [0..7]: extent
|
||||
1: [8..39]: hole
|
||||
5a58e46082be047d0f13bee7974015b9
|
||||
daa100df6e6711906b61c9ab5aa16032
|
||||
2. into allocated space
|
||||
0: [0..7]: extent
|
||||
1: [8..23]: hole
|
||||
|
||||
@@ -86,9 +86,7 @@ eecb7aa303d121835de05028751d301c
|
||||
0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
|
||||
*
|
||||
1. into a hole
|
||||
0: [0..7]: extent
|
||||
1: [8..39]: hole
|
||||
5a58e46082be047d0f13bee7974015b9
|
||||
daa100df6e6711906b61c9ab5aa16032
|
||||
2. into allocated space
|
||||
0: [0..7]: extent
|
||||
1: [8..23]: hole
|
||||
@@ -135,9 +133,7 @@ eecb7aa303d121835de05028751d301c
|
||||
0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
|
||||
*
|
||||
1. into a hole
|
||||
0: [0..7]: extent
|
||||
1: [8..39]: hole
|
||||
5a58e46082be047d0f13bee7974015b9
|
||||
daa100df6e6711906b61c9ab5aa16032
|
||||
2. into allocated space
|
||||
0: [0..7]: extent
|
||||
1: [8..23]: hole
|
||||
|
||||
+2
-6
@@ -158,9 +158,7 @@ eecb7aa303d121835de05028751d301c
|
||||
0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
|
||||
*
|
||||
1. into a hole
|
||||
0: [0..7]: data
|
||||
1: [8..39]: hole
|
||||
5a58e46082be047d0f13bee7974015b9
|
||||
daa100df6e6711906b61c9ab5aa16032
|
||||
2. into allocated space
|
||||
0: [0..7]: data
|
||||
1: [8..23]: hole
|
||||
@@ -242,9 +240,7 @@ eecb7aa303d121835de05028751d301c
|
||||
0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
|
||||
*
|
||||
1. into a hole
|
||||
0: [0..7]: data
|
||||
1: [8..39]: hole
|
||||
5a58e46082be047d0f13bee7974015b9
|
||||
daa100df6e6711906b61c9ab5aa16032
|
||||
2. into allocated space
|
||||
0: [0..7]: data
|
||||
1: [8..23]: hole
|
||||
|
||||
Reference in New Issue
Block a user