mirror of
https://github.com/troglobit/finit.git
synced 2026-10-26 12:14:37 +00:00
test: update test to use kill(1) replacement slay.sh
The slay script checks for common errors and gives some logs and status of Finit when something goes wrong. Helps detect issue #226 when the start-kill-service.sh test runs at 100000 laps. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
e01836c506
commit
094e00d405
2 files changed
+50
-4
No files matched your search
@@ -19,7 +19,9 @@ test_teardown() {
|
||||
|
||||
say "Test start $(date)"
|
||||
|
||||
cp "$TEST_DIR"/common/slay.sh "$TENV_ROOT"/test_assets/
|
||||
cp "$TEST_DIR"/common/service.sh "$TENV_ROOT"/test_assets/
|
||||
rm "$TENV_ROOT"/oldpid
|
||||
|
||||
say "Add service stanza in $FINIT_CONF"
|
||||
texec sh -c "echo 'service [2345] respawn log /test_assets/service.sh -- Test service' > $FINIT_CONF"
|
||||
@@ -37,10 +39,7 @@ laps=1000
|
||||
while [ $i -lt $laps ]; do
|
||||
i=$((i + 1))
|
||||
say "Lap $i/$laps, killing service ..." # we have this, no sleep needed
|
||||
# texec sh -c "echo \"PID is \$(initctl status service.sh |awk '/PID : /{ print \$3; }')\"; echo \"PID file says \$(cat /run/service.pid)\"; kill -9 \$(cat /run/service.pid)"
|
||||
#texec sh -c "initctl status service.sh"
|
||||
#texec sh -c "initctl signal service.sh KILL"
|
||||
texec sh -c "kill -9 \$(cat /run/service.pid)"
|
||||
texec sh -c "/test_assets/slay.sh service.sh"
|
||||
done
|
||||
|
||||
retry 'assert_new_pid service.sh /run/service.pid'
|
||||
|
||||
Reference in new issue
Block a user