- Brand receipt status strings (statuslang) for notify/queue - Windows tray + Start Menu/Startup install; macOS menubar helper - CERT-01 plum/gold PDF + multihash/blake3 when present - printit.verae.ai brand kit, queue page, customer-auth helper - verae-print pending/tray-status/menubar commands
163 lines
5.3 KiB
Shell
Executable file
163 lines
5.3 KiB
Shell
Executable file
#!/usr/bin/env bash
|
|
# A4 smoke: tray/menubar packaging metadata matches internal/job.HelperVersion.
|
|
# No elevated MSI path required. IPP POST must stay untouched by tray scripts.
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
cd "$ROOT"
|
|
|
|
fail=0
|
|
pass() { printf 'PASS %s\n' "$*"; }
|
|
bad() { printf 'FAIL %s\n' "$*"; fail=1; }
|
|
|
|
JOB_GO="$ROOT/internal/job/job.go"
|
|
if [[ ! -f "$JOB_GO" ]]; then
|
|
bad "missing $JOB_GO"
|
|
exit 1
|
|
fi
|
|
HELPER="$(grep -E 'HelperVersion[[:space:]]*=' "$JOB_GO" | head -1 | sed -E 's/.*"([^"]+)".*/\1/')"
|
|
if [[ -z "$HELPER" || ! "$HELPER" =~ ^[0-9]+\.[0-9]+ ]]; then
|
|
bad "could not parse HelperVersion from job.go (got '$HELPER')"
|
|
exit 1
|
|
fi
|
|
pass "HelperVersion=$HELPER"
|
|
|
|
check_file() {
|
|
local f="$1"; shift
|
|
if [[ ! -f "$f" ]]; then
|
|
bad "missing $f"
|
|
return
|
|
fi
|
|
local body
|
|
body="$(cat "$f")"
|
|
local w
|
|
for w in "$@"; do
|
|
if ! grep -Fq -- "$w" <<<"$body"; then
|
|
bad "$f missing expected: $w"
|
|
return
|
|
fi
|
|
done
|
|
pass "$f"
|
|
}
|
|
|
|
# macOS menubar builder + README
|
|
check_file "$ROOT/platform/macos/menubar/build-menubar-app.sh" \
|
|
"HelperVersion" \
|
|
"CFBundleShortVersionString" \
|
|
"packaging-metadata.txt" \
|
|
"VERSION" \
|
|
"LSUIElement" \
|
|
"ai.verae.timestamping.menubar"
|
|
|
|
check_file "$ROOT/platform/macos/menubar/README.txt" \
|
|
"HelperVersion" \
|
|
"Package version" \
|
|
"packaging-metadata.txt" \
|
|
"notarytool"
|
|
|
|
# Windows tray install scripts
|
|
check_file "$ROOT/platform/windows/scripts/common.ps1" \
|
|
"Get-VeraePackageVersion" \
|
|
"HelperVersion" \
|
|
"$HELPER"
|
|
|
|
check_file "$ROOT/platform/windows/scripts/install-tray-startup.ps1" \
|
|
"PackageVersion" \
|
|
"HelperVersion" \
|
|
"no elevated MSI" \
|
|
"GET /status"
|
|
|
|
check_file "$ROOT/platform/windows/scripts/build-tray-startmenu.ps1" \
|
|
"PackageVersion" \
|
|
"HelperVersion" \
|
|
"no elevated MSI" \
|
|
"WiX" \
|
|
"GET /status"
|
|
|
|
check_file "$ROOT/platform/windows/scripts/verae-tray.ps1" \
|
|
"PackageVersion" \
|
|
"HelperVersion" \
|
|
"GET /status"
|
|
|
|
check_file "$ROOT/platform/windows/README.txt" \
|
|
"HelperVersion" \
|
|
"no elevated MSI" \
|
|
"Package version"
|
|
|
|
check_file "$ROOT/platform/windows/README-WINDOWS.txt" \
|
|
"HelperVersion" \
|
|
"Package version" \
|
|
"no elevated MSI"
|
|
|
|
# Fallback defaults in scripts must equal current HelperVersion (or resolve from job.go).
|
|
# build-menubar-app.sh fallback:
|
|
if grep -Eq "VERSION=\"\\\$\{VERSION:-$HELPER\}\"|VERSION=\"\\\$\{VERSION:-.*\}\"" \
|
|
"$ROOT/platform/macos/menubar/build-menubar-app.sh"; then
|
|
# Prefer: script reads job.go; fallback string should match HELPER when present.
|
|
if grep -Fq "VERSION=\"\${VERSION:-$HELPER}\"" "$ROOT/platform/macos/menubar/build-menubar-app.sh" \
|
|
|| grep -Fq "VERSION=\"\${VERSION:-$HELPER}\"" "$ROOT/platform/macos/menubar/build-menubar-app.sh"; then
|
|
pass "menubar fallback VERSION matches HelperVersion"
|
|
elif grep -Fq "VERSION=\"\${VERSION:-$HELPER}\"" "$ROOT/platform/macos/menubar/build-menubar-app.sh"; then
|
|
pass "menubar fallback VERSION matches HelperVersion"
|
|
else
|
|
# Accept job.go resolution path + any fallback that equals HELPER
|
|
if grep -q 'HelperVersion' "$ROOT/platform/macos/menubar/build-menubar-app.sh" \
|
|
&& grep -Fq "$HELPER" "$ROOT/platform/macos/menubar/build-menubar-app.sh"; then
|
|
pass "menubar script references HelperVersion and $HELPER"
|
|
else
|
|
bad "menubar build script fallback does not mention $HELPER"
|
|
fi
|
|
fi
|
|
else
|
|
if grep -q 'HelperVersion' "$ROOT/platform/macos/menubar/build-menubar-app.sh" \
|
|
&& grep -Fq "$HELPER" "$ROOT/platform/macos/menubar/build-menubar-app.sh"; then
|
|
pass "menubar script references HelperVersion and $HELPER"
|
|
else
|
|
bad "menubar build script missing HelperVersion/$HELPER"
|
|
fi
|
|
fi
|
|
|
|
# Tray scripts must not implement IPP POST (pure GET presence).
|
|
for f in \
|
|
"$ROOT/platform/windows/scripts/verae-tray.ps1" \
|
|
"$ROOT/platform/windows/scripts/install-tray-startup.ps1" \
|
|
"$ROOT/platform/windows/scripts/build-tray-startmenu.ps1" \
|
|
"$ROOT/platform/macos/menubar/verae-menubar.swift" \
|
|
"$ROOT/platform/macos/menubar/build-menubar-app.sh"
|
|
do
|
|
if grep -Ei 'ipp.?post|Print-Job|send-document|application/ipp' "$f" 2>/dev/null \
|
|
| grep -Eiv 'POST stays|untouched|not touch|Does not touch|never|pure|no IPP POST' >/dev/null; then
|
|
# Allow documentation that says they do NOT touch IPP POST
|
|
if grep -Ei 'does not touch IPP POST|IPP POST is unchanged|IPP POST untouched|never.*IPP POST|no IPP POST' "$f" >/dev/null; then
|
|
pass "IPP pure (docs only): $(basename "$f")"
|
|
else
|
|
bad "possible IPP POST coupling in $f"
|
|
fi
|
|
else
|
|
pass "IPP pure: $(basename "$f")"
|
|
fi
|
|
done
|
|
|
|
# Optional: go build smoke when go is available (does not require Windows).
|
|
if command -v go >/dev/null 2>&1; then
|
|
if go build -o /dev/null ./cmd/verae-print 2>/tmp/a4-go-build.err; then
|
|
pass "go build ./cmd/verae-print"
|
|
else
|
|
bad "go build ./cmd/verae-print"
|
|
cat /tmp/a4-go-build.err >&2 || true
|
|
fi
|
|
if go test ./cmd/verae-print -count=1 -run 'Menubar|Packaging|TrayStartmenu|FindRepo' 2>/tmp/a4-go-test.err; then
|
|
pass "go test menubar/packaging subset"
|
|
else
|
|
bad "go test menubar/packaging subset"
|
|
cat /tmp/a4-go-test.err >&2 || true
|
|
fi
|
|
else
|
|
pass "go not on PATH — skipped build/test smoke"
|
|
fi
|
|
|
|
if [[ "$fail" -ne 0 ]]; then
|
|
echo "A4 packaging metadata smoke FAILED"
|
|
exit 1
|
|
fi
|
|
echo "A4 packaging metadata smoke PASSED (HelperVersion=$HELPER, no elevated MSI, IPP pure)"
|