mirror of
https://github.com/troglobit/finit.git
synced 2026-10-25 12:04:36 +00:00
test: new test, verify default runlevel from command line
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
73423699fd
commit
4aae3403f5
2 files changed
+31
No files matched your search
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/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
|
||||
Reference in new issue
Block a user