test: Fix shellcheck warnings

Signed-off-by: Jacques de Laval <jacques@de-laval.se>
This commit is contained in:
Jacques de Laval
2021-02-18 21:29:51 +01:00
parent 5775a20eff
commit 5a4cb74493
4 changed files with 10 additions and 9 deletions
+2 -2
View File
@@ -75,8 +75,8 @@ $(libs): $@
$(libs64): $@
cp $(shell ldd $(finit_bin) | cut -d' ' -f3 | grep $(notdir $@)) $@
.PHONY: lint
lint:
.PHONY: test-check
test-check:
shellcheck $(shell find . -name '*.sh')
.PHONY: clean
+3 -2
View File
@@ -51,7 +51,7 @@ log "$color_reset" '--' ''
# Setup
./testenv_start.sh finit &
finit_ppid=$!
for i in $(seq 1 50); do
for _ in $(seq 1 50); do
sleep 0.1
pgrep -P "$finit_ppid" > /dev/null || continue
break
@@ -60,4 +60,5 @@ done
texec cat /dev/tty0 &
sleep 1
. "$1"
# shellcheck source=/dev/null
. "$TEST"
+1 -1
View File
@@ -2,6 +2,6 @@
set -eu
while [ 1 ]; do
while true; do
sleep 5
done
+4 -4
View File
@@ -11,8 +11,8 @@ say 'Reload Finit'
texec kill -SIGHUP 1
sleep 1
service_pids=( $(texec pgrep -P 1) )
assert 'One service is running' ${#service_pids[@]} -eq 1
service_pids=$(texec pgrep -P 1 | wc -l)
assert 'One service is running' "$service_pids" -eq 1
say 'Remove the service'
texec sh -c 'echo > /etc/finit.conf'
@@ -21,8 +21,8 @@ say 'Reload Finit'
texec kill -SIGHUP 1
sleep 1
service_pids=( $(texec pgrep -P 1) )
assert 'Zero services are running' ${#service_pids[@]} -eq 0
service_pids=$(texec pgrep -P 1 | wc -l)
assert 'Zero services are running' "$service_pids" -eq 0
# Teardown
rm -f test_root/bin/service.sh