test: New test: test_start_stop_service

Add a new test that verifies that Finit will:
- Start a service that's been added to the config
- Stop the service once it's removed from the config

The second step is currently failing.

Signed-off-by: Jacques de Laval <jacques@de-laval.se>
This commit is contained in:
Jacques de Laval committed 2021-02-18 13:55:47 +01:00
1 parent 4f82cb8261
commit 4224c2e8fe
7 files changed
+98 -6

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
set -eu
TEST_DIR=$(dirname "$0")
TESTS_ROOT="$(pwd)/${TEST_DIR}/test_root"
>&2 echo "Hint: Execute '${TEST_DIR}/testenv_exec.sh \$(pgrep -P $$) /bin/sh; reset' to enter the test namespace"
# Not supported by Busybox unshare:
# --cgroup --time
export PATH=/sbin:/bin
exec unshare \
--user --map-root-user \
--fork --pid --mount-proc \
--mount \
--mount-proc \
--uts --ipc --net \
chroot "$TESTS_ROOT" /bin/chrootsetup.sh "$@"