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>
13 lines
661 B
Bash
13 lines
661 B
Bash
# Uninstall in dry-run mode lists everything netssh created.
|
|
config <<'EOF'
|
|
resolver: {strategies: [primary_ip]}
|
|
EOF
|
|
check "refresh" netssh cache refresh
|
|
check "hook install" netssh hook install --shell bash
|
|
expect_out "lists the profile" ".bashrc" netssh uninstall --dry-run
|
|
expect_out "lists the config" "netssh.yaml" netssh uninstall --dry-run
|
|
expect_out "lists the cache" ".cache/netssh" netssh uninstall --dry-run
|
|
out=$(netssh uninstall --dry-run --keep-config 2>&1)
|
|
[[ $out != *"netssh.yaml"* ]] && ok "--keep-config keeps the config" || bad "--keep-config keeps the config" "$out"
|
|
expect_out "nothing was removed" "netssh shell-init" cat "$HOME/.bashrc"
|