mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
32 lines
798 B
Bash
Executable File
32 lines
798 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Verifies basic runparts behavior: to run all scripts in a directory at
|
|
# the end of system bootstrap, right before calling /etc/rc.local:
|
|
#
|
|
# - only executable scripts should be called
|
|
# - always in alphabetical order
|
|
# - 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 source=/dev/null
|
|
. "$TEST_DIR/lib/setup.sh"
|
|
|
|
while true; do
|
|
lvl=$(texec initctl runlevel)
|
|
say "Current runlevel $lvl"
|
|
if [ "$lvl" = "N 2" ]; then
|
|
break;
|
|
fi
|
|
sleep 1
|
|
done
|
|
|
|
sleep 1
|
|
texec diff -u /usr/share/runparts/ref.log /tmp/runparts.log
|
|
texec cmp /usr/share/runparts/ref.log /tmp/runparts.log || fail "runparts in wrong order"
|