generic: inconsistent initial state for test_generic_punch
authorDave Chinner <dchinner@redhat.com>
Tue, 4 Feb 2014 00:52:37 +0000 (11:52 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 4 Feb 2014 00:52:37 +0000 (11:52 +1100)
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>
common/punch
tests/generic/255.out
tests/generic/316.out
tests/xfs/252.out

index 4ed8406787d5010754a02a088f8760e24c1c25f6..49715a741571cb2d2de4163a8483ead45e12d57d 100644 (file)
@@ -318,10 +318,11 @@ _test_generic_punch()
        filter_cmd=$5
        testfile=$6
 
        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"
        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
        $XFS_IO_PROG -f -c "truncate 20k" \
                -c "$zero_cmd 4k 8k" \
                -c "$map_cmd -v" $testfile | $filter_cmd
index cb9fdcaa70e768356d56db6a7a034759602e6718..217ef3ededbcc68cee7648b77a40153530778c14 100644 (file)
@@ -158,9 +158,7 @@ eecb7aa303d121835de05028751d301c
 0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
 *
        1. into a hole
 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. 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
 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. into allocated space
 0: [0..7]: extent
 1: [8..23]: hole
index 222e60151b101f4de1fd3af56b987b9f96a366b2..383f0d1623b354ec5b7ead0aaaa8fda80f990a96 100644 (file)
@@ -86,9 +86,7 @@ eecb7aa303d121835de05028751d301c
 0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
 *
        1. into a hole
 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. 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
 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. into allocated space
 0: [0..7]: extent
 1: [8..23]: hole
index 539c8a446a531eede3790f83dfb03458dd89bc90..47d9a4c96f21937609ad23c80bb1f442921281c3 100644 (file)
@@ -158,9 +158,7 @@ eecb7aa303d121835de05028751d301c
 0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
 *
        1. into a hole
 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
        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
 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
        2. into allocated space
 0: [0..7]: data
 1: [8..23]: hole