mirror of
https://github.com/troglobit/finit.git
synced 2026-11-01 13:10:32 +00:00
test: Use FINIT_CONF from autoconf instead of hardcoded /etc/finit.conf
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
This commit is contained in:
1 parent
765e1eb640
commit
407c524088
2 files changed
+5
-2
No files matched your search
@@ -47,6 +47,8 @@ shift
|
|||||||
|
|
||||||
trap teardown EXIT
|
trap teardown EXIT
|
||||||
|
|
||||||
|
FINIT_CONF=$(grep FINIT_CONF "$(dirname "$0")/../config.h" | cut -d' ' -f3 | cut -d'"' -f2)
|
||||||
|
|
||||||
log "$color_reset" 'Test start' ''
|
log "$color_reset" 'Test start' ''
|
||||||
log "$color_reset" '--' ''
|
log "$color_reset" '--' ''
|
||||||
|
|
||||||
@@ -57,6 +59,7 @@ log "$color_reset" '--' ''
|
|||||||
>&2 echo Filesystem:
|
>&2 echo Filesystem:
|
||||||
>&2 ./testenv_start.sh find / -path /sys -prune -o -print -path /proc -prune -o -print
|
>&2 ./testenv_start.sh find / -path /sys -prune -o -print -path /proc -prune -o -print
|
||||||
>&2 echo --
|
>&2 echo --
|
||||||
|
>&2 echo "FINIT_CONF='$FINIT_CONF"
|
||||||
|
|
||||||
# Setup
|
# Setup
|
||||||
./testenv_start.sh finit &
|
./testenv_start.sh finit &
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ set -eu
|
|||||||
# Test
|
# Test
|
||||||
say 'Set up a service'
|
say 'Set up a service'
|
||||||
cp "$TEST_DIR"/service.sh test_root/bin
|
cp "$TEST_DIR"/service.sh test_root/bin
|
||||||
texec sh -c 'echo "service [2345] kill:20 log /bin/service.sh" > /etc/finit.conf'
|
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
|
||||||
@@ -15,7 +15,7 @@ service_pids=$(texec pgrep -P 1 | wc -l)
|
|||||||
assert 'One service is running' "$service_pids" -eq 1
|
assert 'One service is running' "$service_pids" -eq 1
|
||||||
|
|
||||||
say 'Remove the service'
|
say 'Remove the service'
|
||||||
texec sh -c 'echo > /etc/finit.conf'
|
texec sh -c "echo > $FINIT_CONF"
|
||||||
|
|
||||||
say 'Reload Finit'
|
say 'Reload Finit'
|
||||||
texec kill -SIGHUP 1
|
texec kill -SIGHUP 1
|
||||||
|
|||||||
Reference in new issue
Block a user