Re: [PATCH v4] fstests: filter readonly mount error messages

Karel Zak
2017-11-27T10:54:30Z

On Sun, Nov 26, 2017 at 10:56:40AM +0200, Amir Goldstein wrote:
> >> Thinking out loud, does xfstest even need to use mount program from
> >> util-linux? Do we ever need anything other than the bare libc mount(2)?
> >> We need it for -o loop, but that is the exception to the rule.
> >
> > Well, I don't think that create a parallel universe is the best
> > solution.
> >
>
> I agree. However, xfstest uses 'mount' is a very particular way:
> - User has to provide both block device and mount point
> - xfstests already checks that those block device and mount point
> are not in use in /proc/mounts *before* calling 'mount'

OK, I see, than the wrapper is not so bad idea (if you're able to keep
it simple and stupid:-)

> So I prefer the 'machine output format' solution going forward, but
> since xfstests will need to continue supporting old util-linux installations
> it might be less clumsy to use a simple C wrapper to mount(2), then
> to carry these error format filters.
> xfstests can also check for availability of the new machine format in
> 'mount' and if it doesn't exist fall back to using its private mount helper.

If you want to implement the wrapper than it's probably better use it
in all cases and then you can remove all the backward compatibility
filters. In thins case it seems better to depend on the wrapper only.
So, the unified messages maintained by unit-linux mount(8) will be
unnecessary.

Karel

--
Karel Zak <kzak@redhat.com>