public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <eguan@redhat.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Trond Myklebust <trondmy@primarydata.com>,
	Jeff Layton <jlayton@poochiereds.net>,
	"J . Bruce Fields" <bfields@fieldses.org>,
	David Howells <dhowells@redhat.com>,
	Miklos Szeredi <miklos@szeredi.hu>,
	fstests <fstests@vger.kernel.org>,
	linux-unionfs@vger.kernel.org
Subject: Re: [PATCH v2 4/4] fstests: add generic test for file handles
Date: Thu, 20 Apr 2017 15:21:50 +0800	[thread overview]
Message-ID: <20170420072150.GY8951@eguan.usersys.redhat.com> (raw)
In-Reply-To: <CAOQ4uxjbQqOQecFkJQg9hzMAx2XxZiEHzuyaZRZAGs6_VEN8XQ@mail.gmail.com>

On Thu, Apr 20, 2017 at 09:34:48AM +0300, Amir Goldstein wrote:
..
> >> +# Check non-stale handles to linked files
> >> +rm -f $testdir/*
> >> +src/open_by_handle -c $testdir $numfiles
> >> +src/open_by_handle    $testdir $numfiles
> >> +
> >> +# Check non-stale handles to files that were hardlinked and original deleted
> >> +src/open_by_handle -l $testdir $numfiles
> >> +src/open_by_handle -u $testdir $numfiles
> >
> > This last test still depends on test files created in the second test
> > implicitly. Forgot to update this part?
> 
> Intentional.
> It's the intended usage to create a test set with -c
> (imagine this is going to done on lower layer)
> then link the test set with -l (imagine this on either lower or overlay)
> then unlink the test set with -u (imagine this on overlay).

Yeah, that makes more sense in an overlay-specific test & operating on
multiple layers. But I don't see the point in this generic test by doing
so, as all these operations are clearly done on the same layer. So I
think adding "rm -f" and "-c" run in this test won't change test
behavior, but could avoid the implicit dependency.

Anyway, at least this is worth some comments on the implicit dependency.

> 
> So as a rule of thumb, rm -f is only added as extra safety
> before a src/open_by_handle -c line
> 
> >
> > # Check non-stale handles to files that were hardlinked and original deleted
> > rm -f $testdir/*
> > src/open_by_handle -c $testdir $numfiles
> > src/open_by_handle -l $testdir $numfiles
> > src/open_by_handle -u $testdir $numfiles
> >
> >> +
> >> +echo "Silence is golden"
> >> +status=$?
> >
> > $? is always 0 after echo. And any test failure could break golden
> > image, I think status can be set to 0 unconditionally.
> >
> 
> Indeed. a combination of copy&paste from xfs/238 and me moving
> Silence is golden to end. Let me know if you want me to re-post for this

I can fix this status issue, but seems you need to re-post anyway to add
more comments or empty $testdir before each test :)

Thanks,
Eryu

  reply	other threads:[~2017-04-20  7:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19 16:29 [PATCH v2 0/4] fstests: generic test for NFS handles Amir Goldstein
2017-04-19 16:29 ` [PATCH v2 1/4] fstests: remove IRIX test program open_unlink Amir Goldstein
2017-04-19 16:29 ` [PATCH v2 2/4] src/open_by_handle: program to exercise open_by_handle_at() syscall Amir Goldstein
2017-04-22  7:55   ` Rock Lee
2017-04-19 16:29 ` [PATCH v2 3/4] src/open_by_handle: flexible usage options Amir Goldstein
2017-04-19 16:29 ` [PATCH v2 4/4] fstests: add generic test for file handles Amir Goldstein
2017-04-20  6:00   ` Eryu Guan
2017-04-20  6:34     ` Amir Goldstein
2017-04-20  7:21       ` Eryu Guan [this message]
2017-04-20  8:03         ` Amir Goldstein
2017-04-20  8:09   ` [PATCH v3 " Amir Goldstein

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=20170420072150.GY8951@eguan.usersys.redhat.com \
    --to=eguan@redhat.com \
    --cc=amir73il@gmail.com \
    --cc=bfields@fieldses.org \
    --cc=dhowells@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=jlayton@poochiereds.net \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=trondmy@primarydata.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