test: minor refactor, relocate "Test start ..." message to setup.sh

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2025-07-06 13:31:29 +02:00
parent d5a47e2d8b
commit ce7d4cebab
31 changed files with 21 additions and 127 deletions
@@ -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"
-2
View File
@@ -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"
-5
View File
@@ -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)"
-5
View File
@@ -7,11 +7,6 @@ set -eu
TEST_DIR=$(dirname "$0")
test_setup()
{
say "Test start $(date)"
}
test_teardown()
{
say "Test done $(date)"
-5
View File
@@ -5,11 +5,6 @@ set -eu
TEST_DIR=$(dirname "$0")
test_setup()
{
say "Test start $(date)"
}
test_teardown()
{
say "Test done $(date)"
-5
View File
@@ -14,11 +14,6 @@ set -eu
TEST_DIR=$(dirname "$0")
test_setup()
{
say "Test start $(date)"
}
test_teardown()
{
say "Test done $(date)"
-5
View File
@@ -7,11 +7,6 @@ set -eu
TEST_DIR=$(dirname "$0")
test_setup()
{
say "Test start $(date)"
}
test_teardown()
{
say "Test done $(date)"
-1
View File
@@ -8,7 +8,6 @@ TEST_DIR=$(dirname "$0")
test_setup()
{
say "Test start $(date)"
run "mkdir -p /etc/default"
}
-5
View File
@@ -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)"
-5
View File
@@ -7,11 +7,6 @@ set -eu
TEST_DIR=$(dirname "$0")
test_setup()
{
say "Test start $(date)"
}
test_teardown()
{
say "Test done $(date)"
+2
View File
@@ -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
-1
View File
@@ -8,7 +8,6 @@ TEST_DIR=$(dirname "$0")
test_setup()
{
say "Test start $(date)"
run "mkdir -p /etc/default"
}
-5
View File
@@ -5,11 +5,6 @@ set -eu
TEST_DIR=$(dirname "$0")
test_setup()
{
say "Test start $(date)"
}
test_teardown()
{
say "Test done $(date)"
-5
View File
@@ -9,11 +9,6 @@ set -eu
TEST_DIR=$(dirname "$0")
test_setup()
{
say "Test start $(date)"
}
test_teardown()
{
say "Test done $(date)"
-1
View File
@@ -8,7 +8,6 @@ TEST_DIR=$(dirname "$0")
test_setup()
{
say "Test start $(date)"
run "mkdir -p /etc/default"
}
+5 -11
View File
@@ -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"
-5
View File
@@ -4,11 +4,6 @@ set -eu
TEST_DIR=$(dirname "$0")
test_setup()
{
say "Test start $(date)"
}
test_teardown()
{
say "Test done $(date)"
-1
View File
@@ -6,7 +6,6 @@ TEST_DIR=$(dirname "$0")
test_setup()
{
say "Test start $(date)"
run "mkdir -p /etc/default"
}
-1
View File
@@ -9,7 +9,6 @@ TEST_DIR=$(dirname "$0")
test_setup()
{
say "Test start $(date)"
run "mkdir -p /etc/default"
export TEST_TIMEOUT=5
}
+3 -8
View File
@@ -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:"
+1 -7
View File
@@ -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)"
+5 -11
View File
@@ -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"
-2
View File
@@ -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"
-1
View File
@@ -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"
-1
View File
@@ -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"
-5
View File
@@ -3,11 +3,6 @@ set -eu
TEST_DIR=$(dirname "$0")
test_setup()
{
say "Test start $(date)"
}
test_teardown()
{
say "Test done $(date)"
-2
View File
@@ -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"
-2
View File
@@ -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"
-5
View File
@@ -4,11 +4,6 @@ set -e
TEST_DIR=$(dirname "$0")
test_setup()
{
say "Test start $(date)"
}
test_teardown()
{
say "Test done $(date)"
+5 -12
View File
@@ -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"
-1
View File
@@ -20,7 +20,6 @@ service log:stdout notify:s6 <service/B/ready> name:C serv -np -i C -N %n
service log:stdout notify:none <pid/A> name:D type:forking serv -i D -- D needs A (forking)
task <service/C/ready,service/D/ready> name:allup initctl cond set allup -- Everything is up
EOF
say "Test start $(date)"
}
test_teardown()