mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-07-04 16:23:04 +02:00
- Move all linux_configuration scripts into two semantic categories: - single_use/: scripts run once manually (fresh install, fixes, setup) - periodic_background/: scripts run by systemd timers or daemons - Preserve existing subdirectory structure within each category - Fix lib/common.sh source paths for new directory depths - Fix CONFIG_DIR depth in setup_periodic_system.sh and check_and_enable_services.sh - Update all references in tests, fresh-install/main.sh, nix modules, and docs - Fix check_polling_antipatterns.sh false positives (||, regex |, case patterns, jq strings) - Fix pre-existing mypy exclusion path and type annotations for moved tools/ directory - Rewrite check_polling_antipatterns.sh using awk (no bash regex loops); add require_serial: true
32 lines
1.1 KiB
Bash
Executable File
32 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# Regression checks for makepkg_capped wrapper.
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
|
|
REPO_DIR=$(cd -- "$SCRIPT_DIR/.." && pwd)
|
|
WRAPPER="$REPO_DIR/scripts/periodic_background/digital_wellbeing/pacman/makepkg_capped.sh"
|
|
|
|
fail() {
|
|
printf 'FAIL: %s\n' "$1" >&2
|
|
exit 1
|
|
}
|
|
|
|
printf 'Checking makepkg_capped exists...\n'
|
|
[[ -f "$WRAPPER" ]] || fail 'makepkg_capped.sh is missing'
|
|
|
|
printf 'Checking makepkg_capped syntax...\n'
|
|
bash -n "$WRAPPER"
|
|
|
|
printf 'Checking systemd scope limits are present...\n'
|
|
grep -Fq 'CPUQuota=' "$WRAPPER" || fail 'CPUQuota setting missing'
|
|
grep -Fq 'MemoryMax=' "$WRAPPER" || fail 'MemoryMax setting missing'
|
|
grep -Fq 'MemorySwapMax=0' "$WRAPPER" || fail 'MemorySwapMax=0 setting missing'
|
|
grep -Fq 'TasksMax=' "$WRAPPER" || fail 'TasksMax setting missing'
|
|
|
|
printf 'Checking graceful fallback path exists...\n'
|
|
grep -Fq 'run_makepkg_fallback' "$WRAPPER" || fail 'fallback function missing'
|
|
grep -Fq 'systemd-run --user --scope --quiet true' "$WRAPPER" || fail 'user-scope probe missing'
|
|
|
|
printf 'makepkg_capped regression checks passed.\n'
|