mirror of
https://github.com/troglobit/finit.git
synced 2026-10-24 11:54:36 +00:00
test: wait for Finit to reach runlevel 2 before starting tests
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
fb956fd2f5
commit
7a8d4e2c6b
1 file changed
+17
-5
+17
-5
@@ -168,12 +168,24 @@ log "$color_reset" 'Setup of test environment done, waiting for Finit ...' ''
|
|||||||
|
|
||||||
finit_pid=$(retry "pgrep -P $finit_ppid")
|
finit_pid=$(retry "pgrep -P $finit_ppid")
|
||||||
|
|
||||||
if type test_setup > /dev/null 2>&1 ; then
|
|
||||||
test_setup
|
|
||||||
fi
|
|
||||||
|
|
||||||
#tty=/dev/$(texec cat /sys/class/tty/console/active)
|
#tty=/dev/$(texec cat /sys/class/tty/console/active)
|
||||||
#texec cat "$tty" &
|
#texec cat "$tty" &
|
||||||
|
|
||||||
# Allow Finit to start up properly before launching the test
|
# Allow Finit to start up properly before launching the test
|
||||||
sleep 2
|
i=0
|
||||||
|
while [ $i -lt 10 ]; do
|
||||||
|
echo "Checking runlevel ..."
|
||||||
|
lvl=$(texec sh -c "initctl runlevel | awk '{print \$2;}'")
|
||||||
|
echo "Runlevel is $lvl"
|
||||||
|
if [ $lvl -eq 2 ]; then
|
||||||
|
say 'Reached runlevel 2, releasing test.'
|
||||||
|
break;
|
||||||
|
fi
|
||||||
|
echo "Waiting for Finit ..."
|
||||||
|
i=$((i + 1))
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
if type test_setup > /dev/null 2>&1 ; then
|
||||||
|
test_setup
|
||||||
|
fi
|
||||||
Reference in new issue
Block a user