Commit Graph
49 Commits
Author SHA1 Message Date
Joachim Wiberg f98be8540f test/devmon.sh: new test
Issue #185

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-19 17:20:21 +01:00
Joachim Wiberg 2a7abf1db0 test: enable new depserv test
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-15 00:56:03 +01:00
Joachim Wiberg 726f7ba229 test: new regression test for bug #313
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-11 15:53:48 +01:00
Joachim Wiberg fb86042cb3 test: add crashing.sh, verify oncrash:script support
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-11-06 13:07:10 +01:00
Joachim Wiberg c9f1bff419 Refactor ready:script to support new notify framework
Follow-up to abcb3ce, calling the service ready:script when readiness
has been signaled to or detected by Finit.

Issue #300

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-10-16 22:11:12 +02:00
Joachim Wiberg ff08038bdc test: add notify.sh to distribution
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-10-16 20:13:04 +02:00
Joachim Wiberg 47d837bf6a test: new test, notify.sh, systemd and s6 readiness notification
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-10-16 20:06:26 +02:00
Joachim Wiberg 29dea38f50 test: fix path to setup-root.sh in distcheck mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-09-25 05:53:57 +02:00
Joachim Wiberg 165d0633f6 test: add support for make -j17 check massive parallel testing
This was a tough nut to crack.  Spent 3-4 calendar weeks (getting blurry
now) to try and figure it all out.  In the end, the following changes
were necessary:

 - Ensure setup-root.sh is guaranteed to run before any of the tests
 - Give all tests their unique /etc, /tmp, and /run inside the chroot.
   Turns out tmpfs+overlayfs can be used unprivileged inside an unshare
 - A static BusyBox binary with support for mount helpers so we can
   do the mkdir magic in skel/etc/fstab for the /etc overlay

The last item turned out to be a bit of a roller coaster ride of its
own.  First of all, the original binary we used was from the upstream
BusyBox project[1].  I was sure it couldn't be that hard to enable the
CONFIG_FEATURE_MOUNT_HELPERS ... oh boy was I wrong.  To make long and
tedious story short; two new projects on GitHub were created for this
task: 1) troglobit/misc[2] to house a mirror of https://musl.cc
toolchains and 2) troglobit/busybox-builder[3] to download, patch, and
build the thing using a .config from the myLinux[4] project.  Patching
this .config was necessary, however, since musl libc is strict POSIX
and does not have any of the BSD extensions, e.g. REG_STARTEND that is
in GLIBC regex(3).

[1]: https://busybox.net/downloads/binaries/1.31.0-defconfig-multiarch-musl/
[2]: https://github.com/troglobit/misc/releases/tag/11-20211120
[3]: https://github.com/troglobit/busybox-builder/releases/tag/1_35_0
[4]: https://github.com/troglobit/myLinux

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-09-25 04:38:24 +02:00
Joachim Wiberg 9f7ba1ba79 test: upgrade BusyBox binary to v1.35.0 w/ mount helpers
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-09-25 04:37:16 +02:00
Joachim Wiberg 621eb21b42 test: regression test for issue #275
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-06-19 15:43:46 +02:00
Joachim Wiberg 75c5c85f07 test: new regression test for initctl restart self
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-05-30 06:59:14 +02:00
Joachim Wiberg 4aae3403f5 test: new test, verify default runlevel from command line
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-05-08 09:57:18 +02:00
Joachim Wiberg 837bca3947 test: new test, verify sysv services are restarted properly
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-05-06 07:57:08 +02:00
Joachim Wiberg d70d86e9fe test: new test, verify behavior of global environment variables
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-05-02 00:03:07 +02:00
Joachim Wiberg 561387ce57 test: new test, verify pre:post: scripts with optional env:file
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-04-30 08:46:05 +02:00
Joachim Wiberg cec2d5a4db test: add missing sbin/task.sh to skeleton dist.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-04-22 18:21:19 +02:00
Joachim Wiberg 539d215d0e test: add missing finit.d to skeleton rootfs
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-04-22 17:51:04 +02:00
Joachim Wiberg 05e6b3e752 test: new test, verify task behavior with conditions
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-04-21 20:52:34 +02:00
Joachim Wiberg 209e140ddd test: let Finit's bootmisc plugin create the /var/run symlink
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-04-10 22:46:15 +02:00
Joachim Wiberg 377c8bce8c test: fix dist and tenv-root/ regression from refactor
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-04-09 17:52:48 +02:00
Joachim Wiberg 7f8a96a73e test: refactor test framework to use a rootfs skeleton
Instead of having to create files, and copying them in place for each
test, we move all static test files to a skeleton rootfs.  This makes
it a lot easier to get an overview of how things and how they work.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-04-08 07:22:33 +02:00
Joachim Wiberg b4af86255d test: rename fserv -> serv, more features to be added
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-04-03 11:55:11 +02:00
Joachim Wiberg ec17f0aa23 test: add new test to dist, fixes CI build
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-04-02 12:14:32 +02:00
Joachim Wiberg 6baf2990e8 test: new test to verify support for forking services
Issue #223

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-04-02 12:08:10 +02:00
Joachim Wiberg 6416e2a1a4 test: minor refactor in build system
Add Makefile.am in tenv and common for EXTRA_DIST.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-04-02 12:07:34 +02:00
Joachim Wiberg 6d14ff84d3 test: add missing script helpers to dist archive
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-03-27 15:41:24 +02:00
Joachim Wiberg 4755e5206b test: new test, verify SysV start/stop daemon support
Install start-stop-daemon in test root.  Add S01-service.sh, which uses
start-stop-daemon to start service.sh.  Modify service.sh to respect
signals, and not exit immediately when sleep exits due to SIGTERM.
Remove PID file in signal callback and make sure to exit OK

The test itself is basically a copy of the start-stop-service.sh test.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-03-24 22:11:24 +01:00
Jörgen Sigvardsson beec0ee590 Test case for initctl signal
This commit implements a test for the signal feature of initctl. The
existing service used in tests (`common/service.sh`) has been extended
with a signal trap handler. When SIGUSR1 is received, it will write the
string `'USR1'` to `/tmp/usr1.log`. The test will run `initctl signal
service.sh SIGUSR1` and assert that the contents of the file
`/tmp/usr1.log` really is `USR1`.
2022-02-15 12:43:07 +01:00
Joachim Wiberg c8e1bd0e9a test: add new kill test to dist
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-02-12 13:37:55 +01:00
Joachim Wiberg e9c8d3d740 test: verify finit restarts crashing services & registers new PID
We extend the service.sh to emulate a well behaving service that creates
and removes its own PID file.

The new test emulates a crash by sending SIGKILL to service.sh.  We then
verify that Finit restarts it, and eventually registers the new PID when
the services recreates the PID file.

Issue #226

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-02-12 13:30:05 +01:00
Joachim Wiberg 3b5cfc5ecf test: drop checksef.sh from EXTRA_DIST, generated now
Also, silence generation of checkself.sh

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-09 18:05:02 +02:00
Jacques de Laval 7c45fd451e test: Remove some redundant exports
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-27 18:27:02 +01:00
Jacques de Laval 7fe1189f7b test: Move test support files to separate dir and keep tests in /test
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-27 14:50:49 +01:00
Jacques de Laval 2f439194e5 test: Fix testenv-root lingering in build dir
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-26 15:35:07 +01:00
Jacques de Laval 6b7ae50fbb test: Let Make generate shellcheck test from the list of test sources
Not very readable yet, so it needs clean up!

Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-26 11:24:12 +01:00
Joachim Wiberg 92c6de2c09 test: tests use .sh extension, for .log/.trs transformation
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-26 10:13:44 +01:00
Jacques de Laval ea4fe2045d test: Add sane default for TESTENV_ROOT; enable easier independent test runs
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-25 17:38:56 +01:00
Jacques de Laval 48b732e53d test: Let Autoconf generate env vars for tests
This simplifies the setup script a lot, and also makes it easier to
run tests independently.

Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-25 17:37:24 +01:00
Jacques de Laval cde580ffce test: Unify setup-root.sh for make check and make distcheck
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-25 11:18:12 +01:00
Jacques de Laval 1efdbeda16 Merge branch 'wip-tests' into wip-tests-build-refactor
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-24 18:48:26 +01:00
Jacques de Laval a5ef5f3104 test: Fix make check
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-24 16:01:43 +01:00
Magnus Malm 76b2a846a2 test: Slightly improve names of test directories
Signed-off-by: Magnus Malm <magnusmalm@gmail.com>
2021-02-24 14:54:45 +01:00
Jacques de Laval 05901a90aa test: Fix distcheck
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-23 23:20:39 +01:00
Joachim Wiberg 47dcd1cb8a test: silence make in-out directory
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-23 15:45:21 +01:00
Magnus Malm 25ffc3192f test: Add two new tests
* test_start_stop_service

  Test that we can start/stop (via initctl) a service configured in
  finit.conf

* test_start_stop_service_sub_config

  Test that we can start/stop (via initctl) a service configured in
  finit.d/ files

Signed-off-by: Magnus Malm <magnusmalm@gmail.com>
2021-02-23 15:30:42 +01:00
Magnus Malm b364fd7d6a test: Add test for dynamically add/remove service in finit.d/ files
Signed-off-by: Magnus Malm <magnusmalm@gmail.com>
2021-02-23 11:24:54 +01:00
Magnus Malm eda9ae4c3e test: Rename start/stop service test to add/remove dynamic service
Signed-off-by: Magnus Malm <magnusmalm@gmail.com>
2021-02-23 11:19:57 +01:00
Jacques de Laval 11841ceb5d test: Clean up Automake integration of tests
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
2021-02-22 22:07:17 +01:00