mirror of
https://github.com/troglobit/finit.git
synced 2026-11-30 21:18:22 +00:00
test: Fix shellcheck warnings
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
This commit is contained in:
1 parent
5775a20eff
commit
5a4cb74493
4 files changed
+10
-9
No files matched your search
+2
-2
@@ -75,8 +75,8 @@ $(libs): $@
|
|||||||
$(libs64): $@
|
$(libs64): $@
|
||||||
cp $(shell ldd $(finit_bin) | cut -d' ' -f3 | grep $(notdir $@)) $@
|
cp $(shell ldd $(finit_bin) | cut -d' ' -f3 | grep $(notdir $@)) $@
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: test-check
|
||||||
lint:
|
test-check:
|
||||||
shellcheck $(shell find . -name '*.sh')
|
shellcheck $(shell find . -name '*.sh')
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|||||||
+3
-2
@@ -51,7 +51,7 @@ log "$color_reset" '--' ''
|
|||||||
# Setup
|
# Setup
|
||||||
./testenv_start.sh finit &
|
./testenv_start.sh finit &
|
||||||
finit_ppid=$!
|
finit_ppid=$!
|
||||||
for i in $(seq 1 50); do
|
for _ in $(seq 1 50); do
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
pgrep -P "$finit_ppid" > /dev/null || continue
|
pgrep -P "$finit_ppid" > /dev/null || continue
|
||||||
break
|
break
|
||||||
@@ -60,4 +60,5 @@ done
|
|||||||
texec cat /dev/tty0 &
|
texec cat /dev/tty0 &
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
. "$1"
|
# shellcheck source=/dev/null
|
||||||
|
. "$TEST"
|
||||||
@@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
while [ 1 ]; do
|
while true; do
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
@@ -11,8 +11,8 @@ say 'Reload Finit'
|
|||||||
texec kill -SIGHUP 1
|
texec kill -SIGHUP 1
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
service_pids=( $(texec pgrep -P 1) )
|
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 > /etc/finit.conf'
|
||||||
@@ -21,8 +21,8 @@ say 'Reload Finit'
|
|||||||
texec kill -SIGHUP 1
|
texec kill -SIGHUP 1
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
service_pids=( $(texec pgrep -P 1) )
|
service_pids=$(texec pgrep -P 1 | wc -l)
|
||||||
assert 'Zero services are running' ${#service_pids[@]} -eq 0
|
assert 'Zero services are running' "$service_pids" -eq 0
|
||||||
|
|
||||||
# Teardown
|
# Teardown
|
||||||
rm -f test_root/bin/service.sh
|
rm -f test_root/bin/service.sh
|
||||||
Reference in new issue
Block a user