mirror of
https://github.com/theupriser/steamify-cachyos-dev.git
synced 2026-10-05 12:45:56 +02:00
test: golden status and plan output of the bash backend in a bubblewrap sandbox
This commit is contained in:
1 parent
2ac2b0d5ca
commit
2659009a49
45 files changed
+146
No files matched your search
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
# Fake systemctl: enabled units listed in $FIXTURE/enabled-units, active ones in $FIXTURE/active-units.
|
||||
# Queries answer from those lists; everything else is logged and succeeds.
|
||||
verb=""; units=()
|
||||
for argument in "$@"; do
|
||||
[[ "$argument" == -* ]] && continue
|
||||
if [[ -z "$verb" ]]; then verb="$argument"; else units+=("$argument"); fi
|
||||
done
|
||||
case "$verb" in
|
||||
is-enabled) for unit in "${units[@]}"; do grep -qx -- "$unit" "$FIXTURE/enabled-units" 2>/dev/null || { echo disabled; exit 1; }; done; echo enabled ;;
|
||||
is-active) for unit in "${units[@]}"; do grep -qx -- "$unit" "$FIXTURE/active-units" 2>/dev/null || { echo inactive; exit 3; }; done; echo active ;;
|
||||
*) echo "systemctl $*" >> "${GOLDEN_LOG:-/dev/null}"; exit 0 ;;
|
||||
esac
|
||||
Reference in new issue
Block a user