diff --git a/test/add-remove-dynamic-service-sub-config.sh b/test/add-remove-dynamic-service-sub-config.sh index a0e3a709..958dd8fe 100755 --- a/test/add-remove-dynamic-service-sub-config.sh +++ b/test/add-remove-dynamic-service-sub-config.sh @@ -15,8 +15,6 @@ test_teardown() # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" -say "Test start $(date)" - say "Add a dynamic service in $FINIT_RCSD/service.conf" run "echo 'service [2345] kill:20 log service.sh -- Dyn serv' > $FINIT_RCSD/service.conf" diff --git a/test/add-remove-dynamic-service.sh b/test/add-remove-dynamic-service.sh index df6cb029..159a26bb 100755 --- a/test/add-remove-dynamic-service.sh +++ b/test/add-remove-dynamic-service.sh @@ -15,8 +15,6 @@ test_teardown() # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" -say "Test start $(date)" - say "Add a dynamic service in $FINIT_CONF" run "echo 'service [2345] kill:20 log service.sh -- Dyn service' > $FINIT_CONF" diff --git a/test/bootstrap-crash.sh b/test/bootstrap-crash.sh index e843e021..36c9897f 100755 --- a/test/bootstrap-crash.sh +++ b/test/bootstrap-crash.sh @@ -11,11 +11,6 @@ BOOTSTRAP="run [S] crasher.sh -- Party crasher" # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" -test_setup() -{ - say "Test start $(date)" -} - test_teardown() { say "Test done $(date)" diff --git a/test/cond-start-task.sh b/test/cond-start-task.sh index 3f472807..8a194020 100755 --- a/test/cond-start-task.sh +++ b/test/cond-start-task.sh @@ -7,11 +7,6 @@ set -eu TEST_DIR=$(dirname "$0") -test_setup() -{ - say "Test start $(date)" -} - test_teardown() { say "Test done $(date)" diff --git a/test/crashing.sh b/test/crashing.sh index 7f154583..e19cf59c 100755 --- a/test/crashing.sh +++ b/test/crashing.sh @@ -5,11 +5,6 @@ set -eu TEST_DIR=$(dirname "$0") -test_setup() -{ - say "Test start $(date)" -} - test_teardown() { say "Test done $(date)" diff --git a/test/depserv.sh b/test/depserv.sh index 17200893..20c3f61d 100755 --- a/test/depserv.sh +++ b/test/depserv.sh @@ -14,11 +14,6 @@ set -eu TEST_DIR=$(dirname "$0") -test_setup() -{ - say "Test start $(date)" -} - test_teardown() { say "Test done $(date)" diff --git a/test/devmon.sh b/test/devmon.sh index edd6e142..9261ee20 100755 --- a/test/devmon.sh +++ b/test/devmon.sh @@ -7,11 +7,6 @@ set -eu TEST_DIR=$(dirname "$0") -test_setup() -{ - say "Test start $(date)" -} - test_teardown() { say "Test done $(date)" diff --git a/test/failing-sysv.sh b/test/failing-sysv.sh index 377cf03a..11ea4f9f 100755 --- a/test/failing-sysv.sh +++ b/test/failing-sysv.sh @@ -8,7 +8,6 @@ TEST_DIR=$(dirname "$0") test_setup() { - say "Test start $(date)" run "mkdir -p /etc/default" } diff --git a/test/global-envs.sh b/test/global-envs.sh index e6ffbe80..548afb96 100755 --- a/test/global-envs.sh +++ b/test/global-envs.sh @@ -8,11 +8,6 @@ set COLORTERM=yes\n\ b aq=oroszoe\n\ baz=qux" -test_setup() -{ - say "Test start $(date)" -} - test_teardown() { say "Test done $(date)" diff --git a/test/initctl-status-subset.sh b/test/initctl-status-subset.sh index 863acb05..eba86f58 100755 --- a/test/initctl-status-subset.sh +++ b/test/initctl-status-subset.sh @@ -7,11 +7,6 @@ set -eu TEST_DIR=$(dirname "$0") -test_setup() -{ - say "Test start $(date)" -} - test_teardown() { say "Test done $(date)" diff --git a/test/lib/setup.sh b/test/lib/setup.sh index 98d652ad..33bed403 100755 --- a/test/lib/setup.sh +++ b/test/lib/setup.sh @@ -362,6 +362,8 @@ echo "Finit running as PID $finit_pid" #tty=/dev/$(texec cat /sys/class/tty/console/active) #texec cat "$tty" & +sep "Test start $(date)" + # Allow Finit to start up properly before launching the test i=0 set +u diff --git a/test/notify.sh b/test/notify.sh index 9baa37f4..0cbe6391 100755 --- a/test/notify.sh +++ b/test/notify.sh @@ -8,7 +8,6 @@ TEST_DIR=$(dirname "$0") test_setup() { - say "Test start $(date)" run "mkdir -p /etc/default" } diff --git a/test/pidfile.sh b/test/pidfile.sh index 737fc31f..a2eabdf1 100755 --- a/test/pidfile.sh +++ b/test/pidfile.sh @@ -5,11 +5,6 @@ set -eu TEST_DIR=$(dirname "$0") -test_setup() -{ - say "Test start $(date)" -} - test_teardown() { say "Test done $(date)" diff --git a/test/pre-post-serv.sh b/test/pre-post-serv.sh index 6355bea9..0b907465 100755 --- a/test/pre-post-serv.sh +++ b/test/pre-post-serv.sh @@ -9,11 +9,6 @@ set -eu TEST_DIR=$(dirname "$0") -test_setup() -{ - say "Test start $(date)" -} - test_teardown() { say "Test done $(date)" diff --git a/test/process-depends.sh b/test/process-depends.sh index cc3738a5..1eeebab3 100755 --- a/test/process-depends.sh +++ b/test/process-depends.sh @@ -8,7 +8,6 @@ TEST_DIR=$(dirname "$0") test_setup() { - say "Test start $(date)" run "mkdir -p /etc/default" } diff --git a/test/rclocal.sh b/test/rclocal.sh index e43bd221..d7bc6d3d 100755 --- a/test/rclocal.sh +++ b/test/rclocal.sh @@ -1,26 +1,20 @@ #!/bin/sh # Regression test for basic /etc/rc.local functionality -# shellcheck disable=SC2317 +# shellcheck disable=2317,2034 set -eu +RCLOCAL="echo 'KILROY WAS HERE' > /tmp/rclocal" TEST_DIR=$(dirname "$0") #DEBUG=1 -# shellcheck disable=SC2034 -RCLOCAL="echo 'KILROY WAS HERE' > /tmp/rclocal" - -# shellcheck source=/dev/null -. "$TEST_DIR/lib/setup.sh" - -test_setup() -{ - say "Test start $(date)" -} test_teardown() { say "Test done $(date)" } +# shellcheck source=/dev/null +. "$TEST_DIR/lib/setup.sh" + sleep 1 assert_file_contains /tmp/rclocal "KILROY WAS HERE" diff --git a/test/ready-serv.sh b/test/ready-serv.sh index dbadb626..ce91081f 100755 --- a/test/ready-serv.sh +++ b/test/ready-serv.sh @@ -4,11 +4,6 @@ set -eu TEST_DIR=$(dirname "$0") -test_setup() -{ - say "Test start $(date)" -} - test_teardown() { say "Test done $(date)" diff --git a/test/restart-self.sh b/test/restart-self.sh index 633d9a7f..d8ceb0d9 100755 --- a/test/restart-self.sh +++ b/test/restart-self.sh @@ -6,7 +6,6 @@ TEST_DIR=$(dirname "$0") test_setup() { - say "Test start $(date)" run "mkdir -p /etc/default" } diff --git a/test/run-restart-forever.sh b/test/run-restart-forever.sh index 90c95638..9fc28133 100755 --- a/test/run-restart-forever.sh +++ b/test/run-restart-forever.sh @@ -9,7 +9,6 @@ TEST_DIR=$(dirname "$0") test_setup() { - say "Test start $(date)" run "mkdir -p /etc/default" export TEST_TIMEOUT=5 } diff --git a/test/run-task-tricks.sh b/test/run-task-tricks.sh index 8b738803..f569cc32 100755 --- a/test/run-task-tricks.sh +++ b/test/run-task-tricks.sh @@ -21,19 +21,14 @@ run [4] name:four initctl restart service.sh -- Restart service" # shellcheck disable=SC2034 RCLOCAL="echo \"$0 ==============\" &1>2" -# shellcheck source=/dev/null -. "$TEST_DIR/lib/setup.sh" - -test_setup() -{ - say "Test start $(date)" - } - test_teardown() { say "Test done $(date)" } +# shellcheck source=/dev/null +. "$TEST_DIR/lib/setup.sh" + say "$FINIT_CONF:" run "cat $FINIT_CONF" say "/etc/rc.local:" diff --git a/test/runlevel.sh b/test/runlevel.sh index 4b3e33c9..22580aae 100755 --- a/test/runlevel.sh +++ b/test/runlevel.sh @@ -1,17 +1,11 @@ #!/bin/sh # Verify selecting alternate runlevel from cmdline +# shellcheck disable=SC2034 set -eu TEST_DIR=$(dirname "$0") - -# shellcheck disable=SC2034 FINIT_RUNLEVEL=9 -test_setup() -{ - say "Test start $(date)" -} - test_teardown() { say "Test done $(date)" diff --git a/test/runparts.sh b/test/runparts.sh index c88ed433..8bae27b7 100755 --- a/test/runparts.sh +++ b/test/runparts.sh @@ -8,26 +8,20 @@ # - SNNfoo should be called with a 'start' argument # - KNNfoo should be called with a 'stop' argument # +# shellcheck disable=SC2034 +BOOTSTRAP="runparts /etc/rc.d" TEST_DIR=$(dirname "$0") #DEBUG=1 -# shellcheck disable=SC2034 -BOOTSTRAP="runparts /etc/rc.d" - -# shellcheck source=/dev/null -. "$TEST_DIR/lib/setup.sh" - -test_setup() -{ - say "Test start $(date)" - } - test_teardown() { say "Test done $(date)" } +# shellcheck source=/dev/null +. "$TEST_DIR/lib/setup.sh" + while true; do lvl=$(texec initctl runlevel) say "Current runlevel $lvl" diff --git a/test/signal-service.sh b/test/signal-service.sh index 8b9be367..245ea8da 100755 --- a/test/signal-service.sh +++ b/test/signal-service.sh @@ -16,8 +16,6 @@ test_teardown() # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" -say "Test start $(date)" - say 'Ensure file system is cleared' run "rm -f /tmp/usr1.log" diff --git a/test/start-kill-service.sh b/test/start-kill-service.sh index 042e1c4d..4cad2b92 100755 --- a/test/start-kill-service.sh +++ b/test/start-kill-service.sh @@ -17,7 +17,6 @@ test_teardown() # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" -say "Test start $(date)" rm -f "$SYSROOT"/oldpid say "Add service stanza in $FINIT_CONF" diff --git a/test/start-kill-stop.sh b/test/start-kill-stop.sh index fc5aaafe..2e4f4507 100755 --- a/test/start-kill-stop.sh +++ b/test/start-kill-stop.sh @@ -24,7 +24,6 @@ test_teardown() say "Check deps ..." check_dep jq -say "Test start $(date)" rm -f "$SYSROOT"/oldpid say "Add service stanza in $FINIT_CONF" diff --git a/test/start-stop-serv.sh b/test/start-stop-serv.sh index de18387a..bc56cf4b 100755 --- a/test/start-stop-serv.sh +++ b/test/start-stop-serv.sh @@ -3,11 +3,6 @@ set -eu TEST_DIR=$(dirname "$0") -test_setup() -{ - say "Test start $(date)" -} - test_teardown() { say "Test done $(date)" diff --git a/test/start-stop-service-sub-config.sh b/test/start-stop-service-sub-config.sh index 65b8cc83..0271f6a4 100755 --- a/test/start-stop-service-sub-config.sh +++ b/test/start-stop-service-sub-config.sh @@ -15,8 +15,6 @@ test_teardown() # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" -say "Test start $(date)" - say "Add service stanza in $FINIT_RCSD/service.conf" run "echo 'service [2345] kill:20 log service.sh -- Subserv' > $FINIT_RCSD/service.conf" diff --git a/test/start-stop-service.sh b/test/start-stop-service.sh index dcc4131f..b854f40b 100755 --- a/test/start-stop-service.sh +++ b/test/start-stop-service.sh @@ -15,8 +15,6 @@ test_teardown() # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" -say "Test start $(date)" - say "Add service stanza in $FINIT_CONF" run "echo 'service [2345] kill:20 log service.sh -- Test service' > $FINIT_CONF" diff --git a/test/svc-env.sh b/test/svc-env.sh index 537342e5..49f8228d 100755 --- a/test/svc-env.sh +++ b/test/svc-env.sh @@ -4,11 +4,6 @@ set -e TEST_DIR=$(dirname "$0") -test_setup() -{ - say "Test start $(date)" -} - test_teardown() { say "Test done $(date)" diff --git a/test/sysvparts.sh b/test/sysvparts.sh index 31c94218..213d8670 100755 --- a/test/sysvparts.sh +++ b/test/sysvparts.sh @@ -8,27 +8,20 @@ # - SNNfoo should be called with a 'start' argument # - KNNfoo should be called with a 'stop' argument # - -TEST_DIR=$(dirname "$0") # shellcheck disable=2034 -DEBUG=1 -# shellcheck disable=SC2034 BOOTSTRAP="runparts sysv /etc/rcS.d" - -# shellcheck source=/dev/null -. "$TEST_DIR/lib/setup.sh" - -test_setup() -{ - say "Test start $(date)" - } +TEST_DIR=$(dirname "$0") +DEBUG=1 test_teardown() { say "Test done $(date)" } +# shellcheck source=/dev/null +. "$TEST_DIR/lib/setup.sh" + while true; do lvl=$(texec initctl runlevel) say "Current runlevel $lvl" diff --git a/test/unexpected-restart.sh b/test/unexpected-restart.sh index d415d8d6..51297aad 100755 --- a/test/unexpected-restart.sh +++ b/test/unexpected-restart.sh @@ -20,7 +20,6 @@ service log:stdout notify:s6 name:C serv -np -i C -N %n service log:stdout notify:none name:D type:forking serv -i D -- D needs A (forking) task name:allup initctl cond set allup -- Everything is up EOF - say "Test start $(date)" } test_teardown()