mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
30 lines
420 B
Bash
Executable File
30 lines
420 B
Bash
Executable File
#!/bin/sh
|
|
# Verify selecting alternate runlevel from cmdline
|
|
set -eu
|
|
|
|
TEST_DIR=$(dirname "$0")
|
|
|
|
# shellcheck disable=SC2034
|
|
FINIT_RUNLEVEL=9
|
|
|
|
test_setup()
|
|
{
|
|
say "Test start $(date)"
|
|
}
|
|
|
|
test_teardown()
|
|
{
|
|
say "Test done $(date)"
|
|
}
|
|
|
|
# shellcheck source=/dev/null
|
|
. "$TEST_DIR/tenv/lib.sh"
|
|
|
|
say 'Check runlevel'
|
|
lvl=$(texec sh -c "initctl runlevel | awk '{print \$2;}'")
|
|
if [ "$lvl" -eq "9" ]; then
|
|
return 0
|
|
fi
|
|
|
|
return 1
|