test: new, verify that a run task can call initctl

Follow-up to #362

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2023-09-10 13:30:57 +02:00
1 parent 4701edef4c
commit 443700a88e
3 files changed
+74 -5

No files matched your search

+13 -5
View File
@@ -52,6 +52,11 @@ assert_new_pid()
assert "Finit has registered new PID" "$(texec initctl |grep $1 | awk '{print $1;}')" -eq "$(texec cat $2)"
}
assert_pidiff()
{
assert "PID has changed (old PID $2)" "$(texec initctl |awk -v svc="$1" '$0 ~ svc {print $1}')" -ne "$2"
}
assert_restarts()
{
assert "Finit has registered restarts" "$(texec initctl status "$2" | awk '/Restarts/{print $3;}')" -ge "$1"
@@ -292,14 +297,17 @@ else
fi
set +u
rm -f "$SYSROOT$FINIT_CONF"
touch "$SYSROOT$FINIT_CONF"
if [ -n "$BOOTSTRAP" ]; then
say "Setting up bootstrap tasks ..."
echo "$BOOTSTRAP" > "$SYSROOT$FINIT_CONF"
say "Setting up bootstrap tasks ..."
echo "$BOOTSTRAP" >> "$SYSROOT$FINIT_CONF"
fi
if [ -n "$RCLOCAL" ]; then
say "Setting up /etc/rc.local ..."
echo "$RCLOCAL" > "$SYSROOT/etc/rc.local"
chmod +x "$SYSROOT/etc/rc.local"
say "Setting up /etc/rc.local ..."
echo "$RCLOCAL" > "$SYSROOT/etc/rc.local"
chmod +x "$SYSROOT/etc/rc.local"
fi
set -u