From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 2/3] generic: add a basic O_TMPFILE test
Date: Thu, 13 Mar 2014 22:16:30 +1100 [thread overview]
Message-ID: <20140313111630.GI4263@dastard> (raw)
In-Reply-To: <20140313101433.445012299@bombadil.infradead.org>
On Thu, Mar 13, 2014 at 03:13:04AM -0700, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> tests/generic/004 | 70 +++++++++++++++++++++++++++++++++++++++++++++++++
> tests/generic/004.out | 6 +++++
> tests/generic/group | 1 +
> 3 files changed, 77 insertions(+)
> create mode 100755 tests/generic/004
> create mode 100644 tests/generic/004.out
>
> diff --git a/tests/generic/004 b/tests/generic/004
> new file mode 100755
> index 0000000..c653530
> --- /dev/null
> +++ b/tests/generic/004
> @@ -0,0 +1,70 @@
> +#! /bin/bash
> +# FS QA Test No. 004
> +#
> +# Test O_TMPFILE opens
it also tests linking a tmpfile...
> +testfile="${TEST_DIR}/tst-tmpfile-flink"
> +
> +# test creating a r/w tmpfile, do I/O and link it into the namespace
> +$XFS_IO_PROG -T \
> + -c "pwrite 0 4096" \
> + -c "pread 0 4096" \
> + -c "flink ${testfile}" \
> + ${TEST_DIR} | _filter_xfs_io
> +
> +if [ ! -f "${testfile}" ]; then
> + echo "failed to link testfile into place"
> + exit 1
> +fi
> +
> +rm -f ${tmpfile}
You could just replace the check for the $testfile existing and
then the removal with:
rm $testfile
because if it doesn't exist that will thrown an ENOENT error like:
rm: cannot remove "foo": No such file or directory
And that will fail the test. There's also no reason to exit if there
is an error, because the rest of the test does not depend on
$testfile being removed. The golden output comparison will then
cause the test to fail...
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2014-03-13 11:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-13 10:13 [PATCH 0/3] O_TMPFILE tests, v2 Christoph Hellwig
2014-03-13 10:13 ` [PATCH 1/3] common: add flink support to _require_xfs_io_command Christoph Hellwig
2014-03-13 11:10 ` Dave Chinner
2014-03-13 10:13 ` [PATCH 2/3] generic: add a basic O_TMPFILE test Christoph Hellwig
2014-03-13 11:16 ` Dave Chinner [this message]
2014-03-13 10:13 ` [PATCH 3/3] xfs: add a test for unlinked inodes due to O_TMPFILE Christoph Hellwig
2014-03-13 11:29 ` Dave Chinner
2014-04-03 11:07 ` Christoph Hellwig
2014-04-03 21:32 ` Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140313111630.GI4263@dastard \
--to=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).