mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
test: reindent
Standard Emacs shell-mode 4-space indent. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+30
-30
@@ -16,15 +16,15 @@ TEST_DIR=$(dirname "$0")
|
||||
|
||||
test_setup()
|
||||
{
|
||||
say "Test start $(date)"
|
||||
say "Test start $(date)"
|
||||
}
|
||||
|
||||
test_teardown()
|
||||
{
|
||||
say "Test done $(date)"
|
||||
say "Running test teardown."
|
||||
say "Test done $(date)"
|
||||
say "Running test teardown."
|
||||
|
||||
run "rm -f $FINIT_CONF" "/tmp/post"
|
||||
run "rm -f $FINIT_CONF" "/tmp/post"
|
||||
}
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
@@ -35,36 +35,36 @@ test_teardown()
|
||||
|
||||
test_one()
|
||||
{
|
||||
cond=$1
|
||||
say "Verifying foo -> <$cond> bar ..."
|
||||
run "echo service log:stderr name:foo serv -np -i foo -f /tmp/arrakis > $FINIT_CONF"
|
||||
run "echo service log:stderr name:bar \<!$cond\> serv -np -i bar -F /tmp/arrakis >> $FINIT_CONF"
|
||||
run "cat $FINIT_CONF"
|
||||
cond=$1
|
||||
say "Verifying foo -> <$cond> bar ..."
|
||||
run "echo service log:stderr name:foo serv -np -i foo -f /tmp/arrakis > $FINIT_CONF"
|
||||
run "echo service log:stderr name:bar \<!$cond\> serv -np -i bar -F /tmp/arrakis >> $FINIT_CONF"
|
||||
run "cat $FINIT_CONF"
|
||||
|
||||
say 'Reload Finit'
|
||||
run "initctl reload"
|
||||
say 'Reload Finit'
|
||||
run "initctl reload"
|
||||
|
||||
run "initctl status"
|
||||
assert_status "foo" "running"
|
||||
assert_cond "$cond"
|
||||
assert_status "bar" "running"
|
||||
run "initctl status"
|
||||
assert_status "foo" "running"
|
||||
assert_cond "$cond"
|
||||
assert_status "bar" "running"
|
||||
|
||||
say "Verify bar is restarted when foo is ..."
|
||||
pid=$(texec initctl |grep bar | awk '{print $1;}')
|
||||
run "initctl restart foo"
|
||||
run "initctl status"
|
||||
assert "bar is restarted" "$(texec initctl |grep bar | awk '{print $1;}')" != "$pid"
|
||||
say "Verify bar is restarted when foo is ..."
|
||||
pid=$(texec initctl |grep bar | awk '{print $1;}')
|
||||
run "initctl restart foo"
|
||||
run "initctl status"
|
||||
assert "bar is restarted" "$(texec initctl |grep bar | awk '{print $1;}')" != "$pid"
|
||||
|
||||
# Wait for spice to be stolen by the Harkonnen
|
||||
sleep 3
|
||||
# bar should now have detected the loss of spice and be in restart
|
||||
run "initctl status"
|
||||
assert_status "bar" "restart"
|
||||
# verify bar is stopped->waiting and no longer in restart after stopping foo
|
||||
run "initctl stop foo"
|
||||
run "initctl status"
|
||||
run "initctl status bar"
|
||||
assert_status "bar" "waiting"
|
||||
# Wait for spice to be stolen by the Harkonnen
|
||||
sleep 3
|
||||
# bar should now have detected the loss of spice and be in restart
|
||||
run "initctl status"
|
||||
assert_status "bar" "restart"
|
||||
# verify bar is stopped->waiting and no longer in restart after stopping foo
|
||||
run "initctl stop foo"
|
||||
run "initctl status"
|
||||
run "initctl status bar"
|
||||
assert_status "bar" "waiting"
|
||||
}
|
||||
|
||||
sep
|
||||
|
||||
Reference in New Issue
Block a user