[LTP] [PATCH v2] syscalls: add syscall syncfs test

Steve Muckle
2019-02-19T23:15:40Z

On 02/18/2019 03:57 AM, Cyril Hrubis wrote:
>> For tests in testcases/kernel/syscalls, should the tests typically
>> directly call the syscall? I'd think this is preferable to the use of C
>> library wrappers as these tests (by their location in the tree) seem to
>> be focused on the syscall functionality in the kernel.
>
> My take on this is that for a functional testing we really have to test
> the kernel together with the library that wraps the syscalls because
> otherwise bugs are bound to happen such as these:
>
> https://sourceware.org/bugzilla/show_bug.cgi?id=23069
> https://sourceware.org/bugzilla/show_bug.cgi?id=23579
>
> And I always cared about syscalls being correct on the C library level.
>
> I guess that for most of the syscalls that are just thin wrappers it
> does not matter since these just prepare the parameters and jump to the
> kernel, but in certain cases libc does quite a lot of work which is
> sometimes complex code I do not want to replicate that unless really
> needed. And with that I think that it's actually much easier to go with
> the libc API whenever possible rather than reviewing the libc code each
> time we write a testcase.
>
> Does that sound reasonable to you?

Sure. My concern is being able to test syscalls in Android where the C
library may not have some wrappers. So far these have all been cases
where one can just replace the library call with the direct syscall, as
a number of recent patches have done. If I run into a case where more
substantial library support is needed maybe we'll just have to focus on
getting that into bionic or look at other options.

thanks,
steve