Docker-Testumgebung + 3 Bugfixes #36

Merged
Sebi merged 2 commits from test/docker-env into main 2026-11-14 12:36:15 +00:00
Owner

Testumgebung testenv/ (nur lokal, nicht in CI/CD)

Zwei echte NetBox-4.7-Instanzen (fsn mit v2-Token, lab mit v1-Token), SSH-Ziele in public/mgmt/prod-Netzen, Bastion als Jump-Host, IPv6-only-Host, statischer Host, Client mit ssh/sftp/scp, tmux, zellij, bash/zsh/fish. Seed füllt NetBox per REST-API.

testenv/up.sh     # ~6 min beim ersten Start
testenv/test.sh   # 141 End-to-End-Checks
testenv/shell.sh  # interaktive Shell mit fertiger Config
testenv/down.sh

Abgedeckt: Cache/Refresh-Filter, Verbinden, alle Resolver-Strategien, mehrere Instanzen, Shortcuts/Rewrites, SSH-Optionen/Rules/Host-Key-Checking, statische Hosts, sftp/scp inkl. IPv6 und Jump, Tunnel, Notizen lokal + NetBox-Kommentare, Completion + Hooks für bash/zsh/fish, TUI (über tmux gesteuert), Configurator, Uninstall (dry-run). Von Grund auf zweimal hintereinander grün.

Bugfixes (von der Testumgebung gefunden)

  • interface_name-Strategie nutzte Filter, die NetBox ignoriert → lieferte immer die erste IP des Hosts statt der des Interfaces. Jetzt interface/vminterface; fehlendes Interface fällt zur nächsten Strategie durch.
  • sftp/scp mit instanz/host:pfad wurden als lokale Pfade behandelt (auch das README-Beispiel ging nicht). Jetzt remote, wenn das Präfix eine konfigurierte Instanz ist.
  • Shell-Aliase von Hosts mit Instanz-Präfix ignorierten verankerte Rewrite-Regeln.

go test ./... grün, neue Unit-Tests für alle drei Fixes.

🤖 Generated with Claude Code

## Testumgebung `testenv/` (nur lokal, nicht in CI/CD) Zwei echte NetBox-4.7-Instanzen (fsn mit v2-Token, lab mit v1-Token), SSH-Ziele in public/mgmt/prod-Netzen, Bastion als Jump-Host, IPv6-only-Host, statischer Host, Client mit ssh/sftp/scp, tmux, zellij, bash/zsh/fish. Seed füllt NetBox per REST-API. ```sh testenv/up.sh # ~6 min beim ersten Start testenv/test.sh # 141 End-to-End-Checks testenv/shell.sh # interaktive Shell mit fertiger Config testenv/down.sh ``` Abgedeckt: Cache/Refresh-Filter, Verbinden, alle Resolver-Strategien, mehrere Instanzen, Shortcuts/Rewrites, SSH-Optionen/Rules/Host-Key-Checking, statische Hosts, sftp/scp inkl. IPv6 und Jump, Tunnel, Notizen lokal + NetBox-Kommentare, Completion + Hooks für bash/zsh/fish, TUI (über tmux gesteuert), Configurator, Uninstall (dry-run). Von Grund auf zweimal hintereinander grün. ## Bugfixes (von der Testumgebung gefunden) - **`interface_name`-Strategie** nutzte Filter, die NetBox ignoriert → lieferte immer die erste IP des Hosts statt der des Interfaces. Jetzt `interface`/`vminterface`; fehlendes Interface fällt zur nächsten Strategie durch. - **sftp/scp mit `instanz/host:pfad`** wurden als lokale Pfade behandelt (auch das README-Beispiel ging nicht). Jetzt remote, wenn das Präfix eine konfigurierte Instanz ist. - **Shell-Aliase** von Hosts mit Instanz-Präfix ignorierten verankerte Rewrite-Regeln. `go test ./...` grün, neue Unit-Tests für alle drei Fixes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sebi added 2 commits 2026-11-14 11:30:53 +00:00
Found by the new Docker test environment against a real NetBox 4.7:

- The interface_name strategy filtered IP addresses with interface_name
  and vminterface_name, which NetBox ignores, so it returned the first
  address of the host instead of the named interface's. Use the real
  filters interface and vminterface; a missing interface (HTTP 400)
  falls through to the next strategy.
- sftp and scp took instance-qualified hosts (prod/web01:/path) for
  local paths, because a "/" comes before the ":". Such arguments are
  remote when the prefix is a configured NetBox instance.
- Shell aliases of instance-qualified hosts ran the shortcut rules on
  "instance/host", so anchored rewrite rules never matched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
Sebi merged commit a8bf2b4141 into main 2026-11-14 12:36:15 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Sebi/ssh-netbox-wrapper#36