tests/16-render.sh runs tmux, zellij, and the TUI in xterm on Xvfb, takes screenshots, and reads them back with tesseract: remote prompts in all panes, borders and titles with the hosts, [SYNC] appearing and disappearing, panes side by side, broadcast output in every pane and input in one pane only without it, windows split by panes_per_window, the status bar, and TUI marks. Screenshots stay in testenv/.artifacts. OCR reads three preprocessing variants (plain, stretched for dim gray, brightest channel for colored text) and normalizes characters that DejaVu Sans Mono makes ambiguous (1/l, C/(). The screenshots showed tmux cutting the session name in the status bar to "[netssh-pv"; netssh multi now widens status-left-length for its own session. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
1.1 KiB
Bash
Executable File
27 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Start the netssh test environment: generate the test key, build the images
|
|
# (netssh from the current source), start everything, and seed NetBox.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
compose=(docker compose -f compose.yaml)
|
|
|
|
mkdir -p .keys .state .artifacts
|
|
chmod a+rwx .state .artifacts # written by the container user (screenshots in .artifacts)
|
|
if [ ! -f .keys/id_ed25519 ]; then
|
|
ssh-keygen -q -t ed25519 -N '' -C netssh-test -f .keys/id_ed25519
|
|
cp .keys/id_ed25519.pub .keys/authorized_keys
|
|
fi
|
|
# Throwaway test key: readable by the container user; tests copy it with 0600.
|
|
chmod 644 .keys/id_ed25519 .keys/authorized_keys
|
|
|
|
"${compose[@]}" build
|
|
"${compose[@]}" up -d --wait --wait-timeout 600 \
|
|
postgres redis netbox-fsn netbox-lab bastion fsn1-pve1 fsn1-pve2 fsn1-pve3 \
|
|
web1 web2 lab-db1 lab-web1 legacy-box v6-host client
|
|
"${compose[@]}" run --rm seed
|
|
echo
|
|
echo "Test environment is up."
|
|
echo " Tests: testenv/test.sh [FILTER]"
|
|
echo " Shell: testenv/shell.sh"
|
|
echo " NetBox UI: http://127.0.0.1:18000 (fsn), http://127.0.0.1:18001 (lab) — admin / admin"
|