aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-11-24 19:35:01 -0300
committerEuAndreh <eu@euandre.org>2022-11-24 19:36:23 -0300
commit3e0a27f97e206f7c1ee08f4e0d583914fa37d80d (patch)
tree20e68ddb7d985f9a1d56472aa413a400ec1ff6a5
parentetc/guix/system.scm: Add working WIP version of local Postfix service (diff)
downloaddotfiles-3e0a27f97e206f7c1ee08f4e0d583914fa37d80d.tar.gz
dotfiles-3e0a27f97e206f7c1ee08f4e0d583914fa37d80d.tar.xz
opt/tests/assert-running-service.sh: Add to "check" target
-rw-r--r--Makefile8
-rwxr-xr-xopt/tests/assert-running-service.sh17
2 files changed, 19 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 304a780..f4e65fa 100644
--- a/Makefile
+++ b/Makefile
@@ -99,7 +99,7 @@ check-dirty-private:
fi
check-opt:
- find opt/tests/ -name '*.sh' -exec {} +
+ find opt/tests/ -name '*.sh' -exec sh {} +
check-pod:
podchecker bin/z
@@ -110,12 +110,8 @@ check-sync:
exit 1; \
fi
-check-services:
- # LANG=en_US.UTF-8 herd status poweralertd | awk 'NR == 2 { if ($0 != " It is started.") { print "poweralertd not running."; exit 1 } }'
-
check: check-shellcheck check-perlcritic check-fixme check-dirty-public \
- check-dirty-private check-opt check-pod check-sync \
- check-services \
+ check-dirty-private check-opt check-pod check-sync
cd $(PRIV_CONFIG) && $(MAKE) $@
clean:
diff --git a/opt/tests/assert-running-service.sh b/opt/tests/assert-running-service.sh
new file mode 100755
index 0000000..f4ac6b7
--- /dev/null
+++ b/opt/tests/assert-running-service.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -eu
+
+SERVICES='
+poweralertd
+clipmenu
+dunst
+mcron
+'
+
+for s in $SERVICES; do
+ LANG=en_US.UTF-8 herd status "$s" |
+ awk -vs="$s" 'NR == 2 && $3 != "started." {
+ printf "Home Shepherd service \"%s\" is not running.\n", s
+ exit 1
+ }'
+done