mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
test: minor refactor, relocate "Test start ..." message to setup.sh
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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)"
|
||||
|
||||
@@ -7,11 +7,6 @@ set -eu
|
||||
|
||||
TEST_DIR=$(dirname "$0")
|
||||
|
||||
test_setup()
|
||||
{
|
||||
say "Test start $(date)"
|
||||
}
|
||||
|
||||
test_teardown()
|
||||
{
|
||||
say "Test done $(date)"
|
||||
|
||||
@@ -5,11 +5,6 @@ set -eu
|
||||
|
||||
TEST_DIR=$(dirname "$0")
|
||||
|
||||
test_setup()
|
||||
{
|
||||
say "Test start $(date)"
|
||||
}
|
||||
|
||||
test_teardown()
|
||||
{
|
||||
say "Test done $(date)"
|
||||
|
||||
@@ -14,11 +14,6 @@ set -eu
|
||||
|
||||
TEST_DIR=$(dirname "$0")
|
||||
|
||||
test_setup()
|
||||
{
|
||||
say "Test start $(date)"
|
||||
}
|
||||
|
||||
test_teardown()
|
||||
{
|
||||
say "Test done $(date)"
|
||||
|
||||
@@ -7,11 +7,6 @@ set -eu
|
||||
|
||||
TEST_DIR=$(dirname "$0")
|
||||
|
||||
test_setup()
|
||||
{
|
||||
say "Test start $(date)"
|
||||
}
|
||||
|
||||
test_teardown()
|
||||
{
|
||||
say "Test done $(date)"
|
||||
|
||||
@@ -8,7 +8,6 @@ TEST_DIR=$(dirname "$0")
|
||||
|
||||
test_setup()
|
||||
{
|
||||
say "Test start $(date)"
|
||||
run "mkdir -p /etc/default"
|
||||
}
|
||||
|
||||
|
||||
@@ -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)"
|
||||
|
||||
@@ -7,11 +7,6 @@ set -eu
|
||||
|
||||
TEST_DIR=$(dirname "$0")
|
||||
|
||||
test_setup()
|
||||
{
|
||||
say "Test start $(date)"
|
||||
}
|
||||
|
||||
test_teardown()
|
||||
{
|
||||
say "Test done $(date)"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -8,7 +8,6 @@ TEST_DIR=$(dirname "$0")
|
||||
|
||||
test_setup()
|
||||
{
|
||||
say "Test start $(date)"
|
||||
run "mkdir -p /etc/default"
|
||||
}
|
||||
|
||||
|
||||
@@ -5,11 +5,6 @@ set -eu
|
||||
|
||||
TEST_DIR=$(dirname "$0")
|
||||
|
||||
test_setup()
|
||||
{
|
||||
say "Test start $(date)"
|
||||
}
|
||||
|
||||
test_teardown()
|
||||
{
|
||||
say "Test done $(date)"
|
||||
|
||||
@@ -9,11 +9,6 @@ set -eu
|
||||
|
||||
TEST_DIR=$(dirname "$0")
|
||||
|
||||
test_setup()
|
||||
{
|
||||
say "Test start $(date)"
|
||||
}
|
||||
|
||||
test_teardown()
|
||||
{
|
||||
say "Test done $(date)"
|
||||
|
||||
@@ -8,7 +8,6 @@ TEST_DIR=$(dirname "$0")
|
||||
|
||||
test_setup()
|
||||
{
|
||||
say "Test start $(date)"
|
||||
run "mkdir -p /etc/default"
|
||||
}
|
||||
|
||||
|
||||
+5
-11
@@ -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"
|
||||
|
||||
|
||||
@@ -4,11 +4,6 @@ set -eu
|
||||
|
||||
TEST_DIR=$(dirname "$0")
|
||||
|
||||
test_setup()
|
||||
{
|
||||
say "Test start $(date)"
|
||||
}
|
||||
|
||||
test_teardown()
|
||||
{
|
||||
say "Test done $(date)"
|
||||
|
||||
@@ -6,7 +6,6 @@ TEST_DIR=$(dirname "$0")
|
||||
|
||||
test_setup()
|
||||
{
|
||||
say "Test start $(date)"
|
||||
run "mkdir -p /etc/default"
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ TEST_DIR=$(dirname "$0")
|
||||
|
||||
test_setup()
|
||||
{
|
||||
say "Test start $(date)"
|
||||
run "mkdir -p /etc/default"
|
||||
export TEST_TIMEOUT=5
|
||||
}
|
||||
|
||||
@@ -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
@@ -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
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -3,11 +3,6 @@ set -eu
|
||||
|
||||
TEST_DIR=$(dirname "$0")
|
||||
|
||||
test_setup()
|
||||
{
|
||||
say "Test start $(date)"
|
||||
}
|
||||
|
||||
test_teardown()
|
||||
{
|
||||
say "Test done $(date)"
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -4,11 +4,6 @@ set -e
|
||||
|
||||
TEST_DIR=$(dirname "$0")
|
||||
|
||||
test_setup()
|
||||
{
|
||||
say "Test start $(date)"
|
||||
}
|
||||
|
||||
test_teardown()
|
||||
{
|
||||
say "Test done $(date)"
|
||||
|
||||
+5
-12
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user