Test for hdio.c

Eugene Syromiatnikov esyr at redhat.com
Thu Mar 26 12:35:04 UTC 2020

On Thu, Mar 26, 2020 at 12:50:27PM +0530, Bran S wrote:
> On Thu, 26 Mar 2020 at 10:25, Eugene Syromiatnikov <esyr at redhat.com> wrote:
> >
> > On Wed, Mar 25, 2020 at 07:48:52PM +0530, Bran S wrote:
> > > The comprehensive test suite's project detail mentions that to write
> > > test scripts one would have to read through the syscall code.
> > > I would like to know which syscall testing would require me to do so.
> > > So that I can write test for that syscall and move on to write a
> > > proposal.
> >
> > Well, most of the time untested decoders have to be verified that they
> > actually decode everything correctly during the test implementation
> > (that's the purpose of the decoder test - to check that strace prints
> > what it is expected to print), so roughly every untested decoder requires
> > cross-checking with the kernel implementation, so, prctl, or UBI_*/PTP_*
> > ioctls could be examples of such decoders.
> Apart from decoders what are some other type of tests ?

Tests for various behavioural corner cases[1][2][3], or tests for strace's
functionality[4] (strace-D/strace-DD/strace-DDD is another example).
So, basically, the contents of the MISC_TESTS variable in tests/Makefile.am.

> Does the comprehensive test suite project only involve writing
> *decoder* tests or others too ?

Not really, it's just the most common kind of strace's tests, and taking
in account its relative simplicity, it's a good place to start.

> If so, then how should I go about finding the other types of tests, an
> example would be nice.

Just look around the tests directory contents.

> Asking so as to make an outline of working on them.

> Also I could not find directories ltp/testcases/kernel/syscalls, and
> sandbox/tests as mentioned on the idea list page[1]

See [5] and [6].

> Does the project have anything to do with these directories ?

Yes, to some extent.  The goal is slightly different, as strace project
is of little interest in testing the syscall behaviour itself, but
nonetheless it is sometimes the case that the required code is quite
common (especially when the syscall usage doesn't introduce adverse
side effects).

> [1] https://strace.io/wiki/GoogleSummerOfCode2020#Comprehensive_test_suite

[1] https://gitlab.com/strace/strace/commit/99d8edef0078
[2] https://gitlab.com/strace/strace/commit/a02a583b3fca
[3] https://gitlab.com/strace/strace/commit/4278e6613f48
[4] https://gitlab.com/strace/strace/commit/a3bef655cbb7
[5] https://github.com/linux-test-project/ltp/tree/master/testcases/kernel/syscalls
[6] https://github.com/gentoo/sandbox/tree/master/tests

More information about the Strace-devel mailing list