Files
ssh-netbox-wrapper/testenv/tests/run.sh
T
Sebastian UnterschützandClaude Opus 5.5 dbb99bdded test: add a local Docker test environment for all features
testenv/ starts two real NetBox 4.7 instances (v2 and v1 token), SSH
targets on public, mgmt, and prod networks, a jump host, an IPv6-only
host, a static host, and a client with ssh, sftp, scp, tmux, zellij,
bash, zsh, and fish. A seed script fills NetBox through the REST API.

141 end-to-end checks cover cache and refresh filters, connecting,
all resolver strategies, multiple instances, shortcuts and rewrites,
SSH options and rules, static hosts, sftp/scp incl. IPv6 and jump
hosts, tunnels, local notes and NetBox comments, completion and shell
hooks, the TUI (driven through tmux), the configurator, and uninstall.

Local only: testenv/up.sh, test.sh, shell.sh, down.sh. Not part of
CI/CD.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 12:30:24 +01:00

27 lines
667 B
Bash
Executable File

#!/usr/bin/env bash
# Runs every tests/NN-*.sh (or those matching $1) in a fresh netssh home and
# prints a summary. Exit code 1 if any check failed.
set -u
export RESULTS=/tmp/netssh-results
: >"$RESULTS"
filter=${1:-}
for file in /tests/[0-9][0-9]-*.sh; do
name=$(basename "$file" .sh)
[[ -n $filter && $name != *"$filter"* ]] && continue
echo "== $name"
(
export CURRENT=$name
. /tests/lib.sh
new_home
. "$file"
)
done
passed=$(grep -c '^ok ' "$RESULTS" || true)
failed=$(grep -c '^FAIL ' "$RESULTS" || true)
echo
echo "passed: $passed, failed: $failed"
if [ "$failed" -gt 0 ]; then
grep '^FAIL ' "$RESULTS" | sed 's/^/ /'
exit 1
fi