mirror of
https://github.com/troglobit/finit.git
synced 2026-10-28 12:30:44 +00:00
test: rename fserv -> serv, more features to be added
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
01a007b388
commit
b4af86255d
5 files changed
+15
-15
No files matched your search
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
TEST_DIR=$(dirname "$0")
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
. "$TEST_DIR/tenv/lib.sh"
|
||||
|
||||
test_teardown()
|
||||
{
|
||||
say "Test done $(date)"
|
||||
say "Running test teardown."
|
||||
|
||||
texec rm -f "$FINIT_CONF"
|
||||
texec rm -f /test_assets/serv
|
||||
}
|
||||
|
||||
say "Test start $(date)"
|
||||
|
||||
cp "$TENV_ROOT"/../common/serv "$TENV_ROOT"/test_assets/
|
||||
|
||||
say "Add service stanza in $FINIT_CONF"
|
||||
texec sh -c "echo 'service [2345] pid:!/run/serv.pid /test_assets/serv -- Forking service' > $FINIT_CONF"
|
||||
|
||||
say 'Reload Finit'
|
||||
#texec sh -c "initctl debug"
|
||||
texec sh -c "initctl reload"
|
||||
#texec sh -c "initctl status"
|
||||
#texec sh -c "ps"
|
||||
|
||||
# Wait for process to fork, create its PID file so Finit can register
|
||||
# its new PID -- this is the major difference from regular services.
|
||||
sleep 2
|
||||
|
||||
#texec sh -c "initctl status"
|
||||
#texec sh -c "ps"
|
||||
#texec sh -c "initctl status serv"
|
||||
|
||||
retry 'assert_num_children 1 serv'
|
||||
|
||||
say 'Stop the service'
|
||||
texec sh -c "initctl stop serv"
|
||||
|
||||
retry 'assert_num_children 0 serv'
|
||||
|
||||
say 'Start the service again'
|
||||
texec sh -c "initctl start serv"
|
||||
|
||||
retry 'assert_num_children 1 serv'
|
||||
Reference in new issue
Block a user