linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfstests: generic/315: make sure the test file exists and is zero length
@ 2014-12-11  3:13 Theodore Ts'o
  2014-12-12  5:21 ` Dave Chinner
  0 siblings, 1 reply; 2+ messages in thread
From: Theodore Ts'o @ 2014-12-11  3:13 UTC (permalink / raw)
  To: Linux Filesystem Development List; +Cc: Theodore Ts'o

Before we determine how much space is available to be fallocated, and
before trying to fallocate the file, we need to make sure testfile.315
exists and is zero-length.  Otherwise the fallocate program will fail
the first time generic/315 is run on a freshly mkfs'ed file system:

generic/315 0s ...	[06:31:43] [06:31:44] [failed, exit status 1] - output mismatch (see /results/results-ext3conv/generic/315.out.bad)
    --- tests/generic/315.out	2014-10-31 10:13:04.000000000 -0400
    +++ /results/results-ext3conv/generic/315.out.bad	2014-11-24 06:31:44.111279060 -0500
    @@ -1,2 +1,6 @@
     QA output created by 315
     Slience is golden
    +ls: cannot access /vdd/testfile.315: No such file or directory
    +./tests/generic/315: line 69: [: : integer expression expected
    +File size is changed to ( Bytes)
    +(see /results/results-ext3conv/generic/315.full for details)
    ...
    (Run 'diff -u tests/generic/315.out /results/results-ext3conv/generic/315.out.bad'  to see the entire diff)

(You can also reproduce the above failure if you delete testfile.315
before running generic/315.)

This commit fixes this issue.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 tests/generic/315 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/generic/315 b/tests/generic/315
index 62fdc01..ad71fe6 100755
--- a/tests/generic/315
+++ b/tests/generic/315
@@ -54,6 +54,8 @@ rm -f $seqres.full
 
 echo "Slience is golden"
 
+cp /dev/null $TEST_DIR/testfile.$seq
+
 # Check the current avaliable disk space on $TEST_DIR.
 # 1024KiB at least
 avail_begin=`df -P $TEST_DIR | awk 'END {print $4}'`
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-12-12  5:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-11  3:13 [PATCH] xfstests: generic/315: make sure the test file exists and is zero length Theodore Ts'o
2014-12-12  5:21 ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).