mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
test: Fix shellcheck warnings
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
This commit is contained in:
+2
-2
@@ -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
@@ -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"
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
set -eu
|
||||
|
||||
while [ 1 ]; do
|
||||
while true; do
|
||||
sleep 5
|
||||
done
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user