Files
connector-macos/smoketest/scenarios/00-environment.sh
T
davidandClaude Opus 5.5 08e6b2ee4f Set up a Mac for a Federated Core, like CoreDesktop's configure
A macOS counterpart of CoreDesktop's configure, with the same drop-in
items in configure.d/:

- core: Mail, Calendar and Contacts through a configuration profile,
  Superpanel as an app, Nextcloud files through the Nextcloud app, and
  Element; with test-and-fix, password change and removal
- tailscale: join the Core's network through headscale
- backup: restic to Nextcloud through rclone, run by launchd through an
  app that can be given Full Disk Access
- storage: SMB shares mounted the way Finder does, again at login and
  on network changes
- agents, claude, opencode, hermes, sandbox: install the agents and run
  them in Anthropic's sandbox runtime (Seatbelt on macOS)
- ai-servers: LLM servers on this Mac or the network, for the agents

Apps and tools macOS lacks are offered for download, checked against
their makers' Team IDs and notarization, or published SHA-256 sums.
Everything runs on macOS' bash 3.2 with only built-in tools.

smoketest/ runs scenarios in fresh macOS VMs with Tart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:34:42 -07:00

38 lines
1.7 KiB
Bash

# shellcheck shell=bash
DESCRIPTION="The scripts parse with macOS' bash 3.2, and the macOS tools they use are there"
TIER=quick
# Patterns, expanded in CONNECTOR
SCRIPTS=("configure" "configure.d/*.sh" "configure.d/lib/*.sh" "system/backup" "system/backup-env.sh"
"system/storage-mount" "sandbox/agent" "smoketest/run" "smoketest/lib/runner.sh")
# Commands that macOS doesn't have, or that would start installing the
# Command Line Tools if called (python3), outside comments
uses_missing_tools() {
(cd "$CONNECTOR" && grep -nE '(^|[^#[:alnum:]_-])(python3|jq|gsed|gawk|timeout|realpath|mapfile|readarray|declare -A)([^[:alnum:]_-]|$)' \
configure configure.d/*.sh configure.d/lib/*.sh system/backup system/storage-mount sandbox/agent \
| grep -vE ':[[:space:]]*#')
}
scenario() {
local pattern file tool
check_eq "/bin/bash is 3.2" "3.2" "${BASH_VERSINFO[0]}.${BASH_VERSINFO[1]}"
for pattern in "${SCRIPTS[@]}"; do
# shellcheck disable=SC2231
for file in "$CONNECTOR"/$pattern; do
check "parses: ${file#"$CONNECTOR"/}" /bin/bash -n "$file"
done
done
check_not "no tools macOS doesn't have (python3, jq, timeout, mapfile...)" uses_missing_tools
for tool in osascript plutil xmllint security profiles dns-sd sips osacompile codesign \
pkgutil spctl hdiutil ditto installer launchctl shasum bunzip2 unzip nc md5 uuidgen \
openssl scutil curl diskutil base64; do
check "has $tool" command -v "$tool"
done
if command -v brew > /dev/null || [ -x /opt/homebrew/bin/brew ]; then
skip "This image has Homebrew, so the download paths for tools Homebrew already has aren't tested"
else
check "no Homebrew, as on a new Mac" true
fi
}