From 4356e4537965971e34d0bc9cc5801a27c597a587 Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Tue, 4 Feb 2014 11:52:37 +1100 Subject: [PATCH] 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 Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- common/punch | 7 ++++--- tests/generic/255.out | 8 ++------ tests/generic/316.out | 8 ++------ tests/xfs/252.out | 8 ++------ 4 files changed, 10 insertions(+), 21 deletions(-) diff --git a/common/punch b/common/punch index 4ed84067..49715a74 100644 --- a/common/punch +++ b/common/punch @@ -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 diff --git a/tests/generic/255.out b/tests/generic/255.out index cb9fdcaa..217ef3ed 100644 --- a/tests/generic/255.out +++ b/tests/generic/255.out @@ -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 diff --git a/tests/generic/316.out b/tests/generic/316.out index 222e6015..383f0d16 100644 --- a/tests/generic/316.out +++ b/tests/generic/316.out @@ -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 diff --git a/tests/xfs/252.out b/tests/xfs/252.out index 539c8a44..47d9a4c9 100644 --- a/tests/xfs/252.out +++ b/tests/xfs/252.out @@ -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 -- 2.47.3