Skip to content

Add lab test harness for bulk brick lifecycle and NX-OS BGP cleanup - #587

Draft
elinalin wants to merge 4 commits into
ironcore-dev:mainfrom
elinalin:issue_460
Draft

elinalin wants to merge 4 commits into
ironcore-dev:mainfrom
elinalin:issue_460

Conversation

@elinalin

@elinalin elinalin commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add `delete` command to the lab test harness (`test/lab/main_test.go`) so test cases can delete Kubernetes resources and wait for finalizers to complete
  • Add `SSH_PORT`, `GNMI_PORT`, `GNMI_ADDR`, and `NAMESPACE` environment variable support to allow port-forwarding and namespace isolation when running against clabernetes
  • Add `ResolveAddr` helper to resolve hostnames to IPv4 (required by the Device address field)
  • Set NX-OS provider name on the Device created by the test harness
  • Delete pre-existing objects in `Create()` to recover cleanly from interrupted test runs
  • Increase reconciliation timeout from 10s to 60s for real-device testing
  • Add precondition check to BGP test cases: verify no `router bgp` config exists before the test begins
  • Add test case 4: NX-OS default BGP instance create and delete (`bgp_default.txt`, `bgp.txt`)
  • Add test case 5: NX-OS per-VRF BGP selective delete (`bgp_vrf.txt`, `bgp.txt`)
  • Add lab runbook for bulk brick lifecycle validation (`docs/developer-guide/bulk-brick-lifecycle-lab.md`)

Test results

Test case 4 (default BGP create + delete): PASS — global `router bgp` instance and `operator-managed--default` marker fully removed after deletion.

Test case 5 (per-VRF BGP selective delete): documents a known bug in `deleteBGP` introduced in `1c03adb8`. After deleting both VRF-scoped BGP bricks, `router bgp 65000` and ownership markers remain on the device. Root cause: a post-deletion `GetConfig` reads stale state due to NX-OS's gNMI consistency window and incorrectly concludes a managed domain still exists. This test case is intentionally included to reproduce the bug — it is expected to fail until the bug is fixed separately.

Test plan

  • Run `bgp_default.txt` (test case 4) against a real NX-OS device and confirm PASS
  • Run `bgp_vrf.txt` (test case 5) against a real NX-OS device — step 3 is expected to FAIL (known bug, tracked separately)

@hardikdr hardikdr added the area/switch-automation Automation processes for network switch management and operations. label Sep 22, 2026
@hardikdr hardikdr added this to Roadmap Sep 22, 2026
@elinalin
elinalin marked this pull request as draft September 22, 2026 09:10
Signed-off-by: I583364 <minmin.lin@sap.com>
- Support NAMESPACE env var so tests run in a dedicated namespace
  instead of always defaulting to "default"
- Delete pre-existing objects in Create() to recover from interrupted runs
- Increase timeout from 10s to 60s for real-device reconciliation
- Add precondition check to BGP test cases (verify clean state before test)
- Add bgp.txt combining test cases 4 and 5 into a single script

Signed-off-by: I583364 <minmin.lin@sap.com>
Signed-off-by: I583364 <minmin.lin@sap.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/switch-automation Automation processes for network switch management and operations.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants