• Willy Tarreau's avatar
    selftests/nolibc: implement a few tests for various syscalls · b4844fa0
    Willy Tarreau authored
    This adds 63 tests covering about 34 syscalls. Both successes and
    failures are tested. Two tests fail when run as unprivileged user
    (link_dir which returns EACCESS instead of EPERM, and chroot which
    returns EPERM). One test (execve("/")) expects to fail on EACCESS,
    but needs to have valid arguments otherwise the kernel will log a
    message. And a few tests require /proc to be mounted.
    
    The code is not pretty since all tests are one-liners, sometimes
    resulting in long lines, especially when using compount statements to
    preset a line, but it's convenient and doesn't obfuscate the code,
    which is important to understand what failed.
    Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
    Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
    b4844fa0
nolibc-test.c 17.6 KB