Re: [vserver] testfs.sh-0.20 patches

From: Corey Wright <undefined_at_pobox.com>
Date: Fri 21 Aug 2009 - 06:07:39 BST
Message-Id: <20090821000739.a01ce7f1.undefined@pobox.com>

On Thu, 20 Aug 2009 15:18:51 +0200
Herbert Poetzl <herbert@13thfloor.at> wrote:

> On Wed, Aug 19, 2009 at 01:48:33PM -0500, Corey Wright wrote:
> > change expected result to fail (0 -> 1) as trying to execute chattr on a
> > barrier from context 2 is expected to fail.
> >
> > this test is problematic because some versions of chattr (e2fsprogs
> > 1.40.8-2ubuntu2 in ubuntu hardy) return success even though the barrier
> > is not visible to chattr (ie "chattr: No such file or directory while
> > trying to stat <barrier>"). so even though chattr failed to act on the
> > barrier (as it could not see it), it still reports success (ie exit
> > code 0).
> >
> > todo/suggestion: first stat the barrier and only try to chattr the
> > barrier if stat is successful (because if stat fails, then chattr will
> > definitely fail).
>
> should probably be the other way round, i.e.
> chattr && stat
> so that the chattr is executed in any case, and
> the effect on the directory can be checked in
> a second step ...

how about exec'ing chattr instead of eval'ing it (as chattr is too buggy to
test with) and instead test the xattrs (using showattr & lsattr as done
elsewhere in the code) after the attempted chattr to insure it didn't change
them?

(see comment/explanation at top of patch.)

corey

-- 
undefined@pobox.com

Received on Fri Aug 21 06:08:09 2009
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Fri 21 Aug 2009 - 06:08:11 BST by hypermail 2.1.8