Add infrastructure for running regression tests whose test subjects must
execute under the Linux ABI.
Keep the test sources and the reusable Linux-side runtime under
sys/tests/linux. Add tests/sys/linux as the build-system integration
point and register it in the system test hierarchy, installing the tests
under /usr/tests/sys/linux.
Linux test programs are built as static, freestanding ELF binaries. They
do not depend on a Linux base system, libc, an ELF interpreter, or any
files below compat.linux.emul_path. This allows the tests to run on
minimal test systems and in buildworld test sandboxes.
Provide a small reusable runtime for Linux-side test helpers:
- linux_crt0 supplies the ELF entry point, invokes a conventional main(), and terminates the process with the Linux exit_group system call.
- linux_syscalls provides the architecture-specific raw system call interface and a minimal set of syscall wrappers.
- amd64 and arm64 are supported, producing x86-64 and AArch64 Linux ELF executables respectively.
Linux kernel modules required by individual tests are declared through
the ATF require.kmods metadata. Kyua can therefore load linux64.ko before
executing a test, without requiring each test to implement module
management.
Add the first regression test for Linux controlling-terminal semantics.
The native ATF test creates a pseudo-terminal, establishes it as the
controlling terminal of a new session, and executes a static Linux
helper. The helper closes the last descriptors referencing the slave
and then attempts to reopen /dev/tty.
Linux keeps the session's controlling-terminal reference across the last
slave close, so reopening /dev/tty must succeed. This exercises the
devfs behavior fixed by D60701 ("devfs: Keep a Linux controlling
tty across the last slave close").
Also register /usr/tests/sys/linux in BSD.tests.dist so that make check
creates the directory in its temporary installation hierarchy.