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>
This commit is contained in:
1 parent
55e7a5106b
commit
dbb99bdded
34 files changed
+1215
No files matched your search
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# Interactive shell in the client with a ready netssh config (fresh home).
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")"
|
||||
exec docker compose -f compose.yaml exec -it client bash -c '
|
||||
. /tests/lib.sh
|
||||
new_home
|
||||
base_config >"$XDG_CONFIG_HOME/netssh.yaml" <<EOF
|
||||
resolver:
|
||||
strategies: [management_subnet, primary_ip]
|
||||
management_subnets: [10.231.1.0/24]
|
||||
ssh:
|
||||
default_user: ops
|
||||
host_key_checking: accept-new
|
||||
rules:
|
||||
- match: {kind: vm, instance: fsn}
|
||||
proxy_jump: ops@10.231.0.30
|
||||
EOF
|
||||
echo "netssh is configured (HOME=$HOME). Try: netssh cache refresh && netssh"
|
||||
exec bash -i'
|
||||
Reference in new issue
Block a user