diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-07-15 15:39:10 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-07-15 15:39:10 +0200 |
commit | 0660f4ca87c4c978589f923e0e2d0eca856be6b4 (patch) | |
tree | a851aa6e7a770b3e9a6f93f58cdd0b26524aeb1f /tests/bin/rc-service | |
parent | bf973ddd2ec5b5555fd03e1aac6fe6e4d1e60642 (diff) | |
download | alpine-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/rc-service')
-rwxr-xr-x | tests/bin/rc-service | 9 |
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 |