Files
samios/tests/test_pacman_conf.sh
Sami Ahmed 658a8541e9
SamiOS CI / lint-and-test (push) Successful in 14s
v0.2.0: WSL desktop, branding, GRUB theme, CI, installer, fonts, voice architecture
Major update adding full desktop environment support, complete branding suite,
and project infrastructure:

Desktop (WSL):
- KDE Plasma + SDDM + Dolphin/Konsole/Kate/Firefox setup script
- Windows 11 dark/light color schemes
- PipeWire audio stack
- WSLg-compatible launch script
- SamiOS CLI tool (v0.2.0) with desktop command

Branding:
- Logos: face-on-pyramid with and without text (500px)
- Icons: square + launcher (256/512/1024px) + SVG vector
- Wallpapers: 1920x1080, 4K, clean variant (PIL-generated)
- GRUB theme: full cobalt blue (#1424CE) theme with pyramid background
- SDDM theme: SamiOS login screen configuration
- Branding README with palette, typography, usage guidelines

Fonts:
- Sami Grotesk (Helvetica-like) as default system/UI font
- Sami Sans as secondary
- Full Sami font family support (excluding 7777 personal branding)
- fontconfig rules mapping Helvetica/Arial → Sami Grotesk
- Font policy enforcement in samios CLI

Infrastructure:
- Automated installer (samios-installer.sh): partition, format, pacstrap, bootloader
- PKGBUILD for samios-branding package
- Test suite: shell tests for profiledef, packages, pacman.conf, CLI, font policy
- Makefile: test, lint, check, build, clean targets
- Gitea Actions CI workflow
- Voice integration architecture document (SamiType × SamiOS)
- Updated roadmap reflecting completed phases
2026-08-11 03:39:47 -07:00

51 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
# Test: pacman.conf validity
# Validates INI structure, required sections, and key options.
source "$(dirname "$0")/test_helper.sh"
suite "pacman.conf tests"
PACMANCONF="$PROFILE_DIR/pacman.conf"
assert_file_exists "pacman.conf exists" "$PACMANCONF"
assert "pacman.conf has valid structure (no unparseable lines)" \
bash -c '
while IFS= read -r line; do
# skip blank lines and comments
[[ -z "$line" || "$line" == \#* || "$line" == \;* ]] && continue
# section header [name]
if grep -qE "^\[.+\]$" <<< "$line"; then continue; fi
# key = value pair
if grep -qE "^[A-Za-z].*=.*$" <<< "$line"; then continue; fi
# bare pacman options (e.g. CheckSpace, NoProgressBar, Color)
if grep -qE "^[A-Z][A-Za-z]+$" <<< "$line"; then continue; fi
echo "unparseable line: $line"
exit 1
done < "'"$PACMANCONF"'"
'
assert_contains "pacman.conf has [options] section" "$PACMANCONF" "^\[options\]"
assert_contains "pacman.conf has [core] section" "$PACMANCONF" "^\[core\]"
assert_contains "pacman.conf has [extra] section" "$PACMANCONF" "^\[extra\]"
assert_contains "pacman.conf has Architecture setting" "$PACMANCONF" "^Architecture"
assert_contains "pacman.conf has SigLevel setting" "$PACMANCONF" "^SigLevel"
assert_contains "pacman.conf has HoldPkg setting" "$PACMANCONF" "^HoldPkg"
# Validate all section headers are well-formed [name]
assert "all section headers are well-formed" \
bash -c '
while IFS= read -r line; do
# match [something] — non-empty, no spaces in name
if [[ "$line" == \[* ]]; then
if ! grep -qE "^\[[a-zA-Z0-9_-]+\]$" <<< "$line"; then
echo "malformed section header: $line"
exit 1
fi
fi
done < "'"$PACMANCONF"'"
'
print_summary