summaryrefslogtreecommitdiff
path: root/tests/bin
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-07-15 15:39:10 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-07-15 15:39:10 +0200
commit0660f4ca87c4c978589f923e0e2d0eca856be6b4 (patch)
treea851aa6e7a770b3e9a6f93f58cdd0b26524aeb1f /tests/bin
parentbf973ddd2ec5b5555fd03e1aac6fe6e4d1e60642 (diff)
downloadalpine-conf-0660f4ca87c4c978589f923e0e2d0eca856be6b4.zip
tests: support 'status' in fake rc-service
so we can verify that service was started when it should and not started when it shouldn't.
Diffstat (limited to 'tests/bin')
-rwxr-xr-xtests/bin/rc-service9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/bin/rc-service b/tests/bin/rc-service
index f6b570e..ca3ad28 100755
--- a/tests/bin/rc-service
+++ b/tests/bin/rc-service
@@ -102,6 +102,15 @@ case "$action" in
restart)
$prog --ifstarted $svc stop && $prog $svc start
;;
+ status)
+ if [ -e "$ROOT"/run/started/$svc ]; then
+ msg " * status: started"
+ exit 0
+ else
+ msg " * status: stopped"
+ exit 3
+ fi
+ ;;
*) usage 1
esac