mirror of
https://github.com/troglobit/finit.git
synced 2026-10-17 10:49:34 +00:00
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:
1 parent
4f82cb8261
commit
4224c2e8fe
7 files changed
+98
-6
No files matched your search
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
if [ "$#" -lt 2 ]; then
|
||||
echo "Usage:"
|
||||
echo " $0 [target-pid] [command [arguments]]"
|
||||
exit 1
|
||||
fi
|
||||
target="$1"
|
||||
shift
|
||||
|
||||
TEST_DIR=$(dirname "$0")
|
||||
TESTS_ROOT="$(pwd)/${TEST_DIR}/test_root"
|
||||
|
||||
export PATH=/sbin:/bin
|
||||
nsenter \
|
||||
--preserve-credentials \
|
||||
--user \
|
||||
--mount \
|
||||
--uts \
|
||||
--ipc \
|
||||
--net \
|
||||
--pid \
|
||||
-w -t "$target" \
|
||||
chroot "$TESTS_ROOT" "$@"
|
||||
Reference in new issue
Block a user