Files
samios/tests/test_font_policy.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

58 lines
2.7 KiB
Bash
Executable File

#!/bin/bash
# Test: Font policy enforcement
# Validates that no packages, files, or scripts reference '7777' fonts
# as something to include — only to exclude.
source "$(dirname "$0")/test_helper.sh"
suite "Font policy tests"
PKGLIST="$PROFILE_DIR/packages.x86_64"
SAMIOS_CLI="$PROFILE_DIR/airootfs/usr/local/bin/samios"
SETUP_SCRIPT="$SCRIPTS_DIR/samios-desktop-setup.sh"
# ---------------------------------------------------------------------------
# packages.x86_64 must not contain any font package with '7777'
# ---------------------------------------------------------------------------
assert "no font package with '7777' in package list" \
bash -c '
if grep -iE "^[^#].*7777" "'"$PKGLIST"'"; then
exit 1
fi
'
# ---------------------------------------------------------------------------
# samios CLI fonts command must explicitly check for 7777
# ---------------------------------------------------------------------------
assert_contains "samios CLI fonts function checks for 7777" "$SAMIOS_CLI" "7777"
assert_contains "samios CLI warns about forbidden fonts" "$SAMIOS_CLI" "forbidden fonts"
# ---------------------------------------------------------------------------
# Desktop setup script must use ! -iname *7777* exclusion (not inclusion)
# ---------------------------------------------------------------------------
assert_contains "desktop setup excludes 7777 fonts in copy from Windows" "$SETUP_SCRIPT" '! -iname'
# Verify the exclusion appears in a find command context (copy, not removal)
assert "desktop setup script copies fonts but excludes 7777" \
bash -c '
grep -c "! -iname.*7777" "'"$SETUP_SCRIPT"'" | grep -q "[1-9]"
'
# ---------------------------------------------------------------------------
# Verify the desktop setup script has a verification check for no 7777 fonts
# ---------------------------------------------------------------------------
assert_contains "desktop setup verifies no 7777 fonts after copy" "$SETUP_SCRIPT" 'grep -i "7777"'
# ---------------------------------------------------------------------------
# Check that font-related exclusion logic appears in the samios CLI
# ---------------------------------------------------------------------------
assert "samios CLI font policy grep uses -i flag for case-insensitive match" \
bash -c 'grep -q "grep -i.*7777" "'"$SAMIOS_CLI"'" || grep -q "grep -iq.*7777" "'"$SAMIOS_CLI"'"'
# ---------------------------------------------------------------------------
# If packages.x86_64 has an excluded-fonts comment, it must mention 7777
# ---------------------------------------------------------------------------
assert_contains "package list documents font exclusion policy" "$PKGLIST" "7777"
print_summary