11 Commits

Author SHA1 Message Date
Andrew G. Morgan
53b369b8ea Make the kdebug test use the terminal output.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2025-05-06 23:17:09 -07:00
Andrew G. Morgan
819f941bce Partially revive fully static binaries.
It looks like I broke the kdebug target build when I dropped fully
static building of capsh and friends. Discovered this, looking at
answering:

https://unix.stackexchange.com/questions/741532/launch-process-with-limited-capabilities-on-minimal-busybox-based-system

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2023-04-22 15:38:29 -07:00
David Seifert
45bf9259a0 Use POSIX grep
* GNU grep 3.8 considers `egrep` and `fgrep` obsolescent and throws warnings:

    ./mkcapshdoc.sh > capshdoc.c.cf
    fgrep: warning: fgrep is obsolescent; using /bin/grep -F
    fgrep: warning: fgrep is obsolescent; using /bin/grep -F
    fgrep: warning: fgrep is obsolescent; using /bin/grep -F
    fgrep: warning: fgrep is obsolescent; using /bin/grep -F
    [...]

  https://lists.gnu.org/archive/html/info-gnu/2022-09/msg00001.html

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2022-09-29 06:54:24 -07:00
Andrew G. Morgan
c9f6bdda4c kdebug shouldn't require sudotest to build uns_test binary.
Part of the reason for the QEMU kernel test is to fully test
the library against kernels without requiring sudo.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-09-12 18:50:55 -07:00
Andrew G. Morgan
280110a9ca Recover the kdebug make rules.
These were broken as a result of delaying building the test and sudotest
binaries until they were actually needed.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-09-11 19:07:40 -07:00
David Seifert
2762c2c1a8 Canonicalize build system
* Respect user's CFLAGS/CPPFLAGS/LDFLAGS
* Respect $(MAKE)
* Remove CPPFLAGS from link rules

Note: for in-tree built test binaries, where we build --static,
  we do not apply LDFLAGS: we want to limit external
  dependencies in general; and users' LDFLAGS have a strong
  tendency to conflict with --static for linking.

Work in collaboration with David Seifert (ie, he wrote most of it).

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-09-01 19:17:05 -07:00
Andrew G. Morgan
2c99ecd7ee Add kernel test to quicktest.sh
This resolves:

  https://bugzilla.kernel.org/show_bug.cgi?id=212737

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-06-19 17:36:46 -07:00
Andrew G. Morgan
b5dcf3aa87 Add some code to automatically exit the kernel test
I occasionally test libcap against a custom kernel using QEMU.
Now I have a simple exit binary for exiting with status.

From the top level, one can use:

  make ktest

However, for more control:

  cd kdebug
  make test

If you want to look around after the tests run:

  make shell

Exit the shell & QEMU with ctrl-D (or exit).

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2021-03-13 15:36:25 -08:00
Andrew G. Morgan
8361f2999a Make quicktest.sh work again with kernel test
It has been a while since I tried:

   make -C kdebug test

A few details for quicktest.sh's dependencies have changed, so
accommodate them.

Also support custom local experiments in the QEMU session.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2020-12-07 20:28:24 -08:00
Andrew G. Morgan
8c67abc3f5 Clean up ambient support and add a smoke test for them.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2016-02-07 20:22:35 -08:00
Andrew G. Morgan
dce069b617 Add something to run libcap's quicktest tests against development kernel.
The kdebug directory requires qemu to run and expects the kernel
to be compiled with the running architecture. My setup has the kernel
sources as a peer to the libcap directory so kdebug assumes that too.

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2016-02-06 19:42:27 -08:00