Re: [PATCH 00/13] cross rename v4

From: Theodore Ts'o
Date: Mon Feb 17 2014 - 13:04:34 EST


On Mon, Feb 17, 2014 at 07:19:11PM +1100, Dave Chinner wrote:
> [ FWIW, the normal way to write an xfstest like this is to write a
> small helper program that just does the renameat2() syscall (we
> often use xfs_io to provide this) and everything is just shell
> scripts to drive the helper program in the necessary way. We don't
> directly check that mode, size, destination of a file is correct -
> just stat(1) on the expected destinations is sufficient to capture
> this information. stdout is captured by the test harness and used to match
> against a golden output. If the match fails, the test fails.

The other reason why it's really nice to use a small helper program is
that it becomes much easier for file system developers to debug kernel
problems without having to create their own single-shot C programs.

It also becomes easier to debug a test failure by looking at the shell
script and manually running the commands one at a time, perhaps
changing some of the arguments after getting an xfstest failure from
inside a VM running a test kernel, since the VM very often won't even
have a C compiler.

It also becomes easier to add new test just simply by updating the
shell script, which is another win.

> And finally, it needs comments to explain what the test is actually
> testing - if you don't document what the test is supposed to be
> checking, how do we know that it is testing is actually correct?

Yes, please!

- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/