mirror of
https://github.com/troglobit/finit.git
synced 2026-11-13 17:00:16 +00:00
test: Only grep for specific child
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
This commit is contained in:
1 parent
914955341d
commit
6f8c24a8d3
1 file changed
+3
-3
@@ -3,7 +3,7 @@
|
|||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
assert_num_children() {
|
assert_num_children() {
|
||||||
assert "$1 services are running" "$(texec pgrep -P 1 | wc -l)" -eq "$1"
|
assert "$1 services are running" "$(texec pgrep -P 1 "$2" | wc -l)" -eq "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
@@ -15,7 +15,7 @@ texec sh -c "echo 'service [2345] kill:20 log /bin/service.sh' > $FINIT_CONF"
|
|||||||
say 'Reload Finit'
|
say 'Reload Finit'
|
||||||
texec kill -SIGHUP 1
|
texec kill -SIGHUP 1
|
||||||
|
|
||||||
retry 'assert_num_children 1'
|
retry 'assert_num_children 1 service.sh'
|
||||||
|
|
||||||
say 'Remove the service'
|
say 'Remove the service'
|
||||||
texec sh -c "echo > $FINIT_CONF"
|
texec sh -c "echo > $FINIT_CONF"
|
||||||
@@ -23,7 +23,7 @@ texec sh -c "echo > $FINIT_CONF"
|
|||||||
say 'Reload Finit'
|
say 'Reload Finit'
|
||||||
texec kill -SIGHUP 1
|
texec kill -SIGHUP 1
|
||||||
|
|
||||||
retry 'assert_num_children 0'
|
retry 'assert_num_children 0 service.sh'
|
||||||
|
|
||||||
# Teardown
|
# Teardown
|
||||||
rm -f test_root/bin/service.sh
|
rm -f test_root/bin/service.sh
|
||||||
Reference in new issue
Block a user