e2e-tests (4/4): Add e2e testdata fixtures for all resources types#410
Draft
nikatza wants to merge 10 commits into
Draft
e2e-tests (4/4): Add e2e testdata fixtures for all resources types#410nikatza wants to merge 10 commits into
nikatza wants to merge 10 commits into
Conversation
envtest mode for fast in-process e2e testingenvtest mode for fast in-process e2e testing
envtest mode for fast in-process e2e testing
nikatza
force-pushed
the
refactor-tests-4
branch
from
June 17, 2026 23:40
343add4 to
44ae09a
Compare
nikatza
force-pushed
the
refactor-tests-3
branch
2 times, most recently
from
June 17, 2026 23:45
823e208 to
f735c68
Compare
nikatza
force-pushed
the
refactor-tests-4
branch
2 times, most recently
from
June 18, 2026 07:59
5e9891b to
864aebb
Compare
nikatza
force-pushed
the
refactor-tests-3
branch
2 times, most recently
from
June 18, 2026 08:15
51d400f to
ace1a56
Compare
nikatza
force-pushed
the
refactor-tests-4
branch
from
June 18, 2026 08:15
864aebb to
b97c1c6
Compare
Repackage the existing gNMI server to let us run it as an in-process library for fast envtest mode or as a deployed pod in a Kubernetes cluster for full end-to-end testing. Signed-off-by: Pujol <enric.pujol@sap.com>
Add common test infrastructure that both cluster and envtest modes will use. This includes helper functions for running kubectl commands and comparing JSON outputs, a provider registry that maps test directories to their provider types, resource cleanup logic that respects Kubernetes finalizers, and centralized timeout constants so all tests behave consistently. Signed-off-by: Pujol <enric.pujol@sap.com>
Add cluster mode for running gNMI controller tests against a Kind cluster. Tests are isolated via //go:build cluster tag and run with: make test-e2e-cluster PROVIDER=cisco-nxos-gnmi New files: - cluster_suite_test.go: Ginkgo suite with SynchronizedBeforeSuite for parallel execution - cluster_test.go: Manager setup tests and reconciliation tests - testutil/cluster.go: ClusterEnvironment helper for kubectl operations - testdata/cisco-nxos-gnmi/interfaces.txt: Test fixture for Interface reconciliation Makefile additions: - test-e2e-cluster: Run cluster tests with -tags=cluster - test-e2e-envtest: (placeholder) Run envtest tests with -tags=envtest - PROVIDER variable for selecting test provider Signed-off-by: Pujol <enric.pujol@sap.com>
…velop - Add install-ginkgo target for ginkgo CLI - Add PROVIDER variable for provider selection - Add GINKGO_PROCS variable for parallel test execution - Add test-e2e-cluster target for cluster-based e2e tests - Update deploy/undeploy to use config/develop instead of config/default Signed-off-by: Pujol <enric.pujol@sap.com>
Add envtest mode for fast in-process e2e testing. This alternative testing mode runs the same test cases as cluster mode but executes them in-process using controller-runtime's envtest framework. Run with: make test-e2e-envtest PROVIDER=cisco-nxos-gnmi New files: - envtest_suite_test.go: Ginkgo suite with //go:build envtest tag - envtest_test.go: Provider-based test runner - testutil/envtest.go: EnvtestEnvironment with in-process gNMI server Signed-off-by: Pujol <enric.pujol@sap.com>
Add test-e2e-envtest target that runs e2e tests in envtest mode (no cluster required). Uses setup-envtest to provide kubebuilder assets. Signed-off-by: Pujol <enric.pujol@sap.com>
Add txtar-format test fixtures for all supported resource types. Signed-off-by: Pujol <enric.pujol@sap.com>
Commands executed via exec.CommandContext with CombinedOutput can hang when stdin is not explicitly set to nil. This was causing UndeployManager to block indefinitely during test cleanup. Changes: - Set cmd.Stdin = nil on all exec.Command calls to prevent stdin inheritance - Change UndeployManager to use kubectl delete -k directly instead of make undeploy to avoid shell pipeline stdin issues Signed-off-by: Pujol <enric.pujol@sap.com>
Documents the e2e test infrastructure including: - Envtest vs Cluster mode comparison - Test commands and environment variables - Testdata format and test flow - Architecture and gnmi-test-server behavior Signed-off-by: Pujol <enric.pujol@sap.com>
- test-e2e-envtest.yml: Fast in-process tests, no cluster required - test-e2e-cluster.yml: Full cluster tests with Kind, 8 parallel processes Signed-off-by: Pujol <enric.pujol@sap.com>
nikatza
force-pushed
the
refactor-tests-4
branch
from
June 18, 2026 08:54
b97c1c6 to
37fea8a
Compare
nikatza
force-pushed
the
refactor-tests-3
branch
from
June 18, 2026 08:54
ace1a56 to
bce5bb0
Compare
nikatza
force-pushed
the
refactor-tests-3
branch
5 times, most recently
from
July 16, 2026 13:11
558876d to
268ae9b
Compare
nikatza
force-pushed
the
refactor-tests-3
branch
7 times, most recently
from
July 16, 2026 17:14
6a91fa7 to
c06cf19
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds testdata fixtures for all 23 resource types, enabling comprehensive e2e testing of the network operator. Each test validates that the operator correctly translates Kubernetes resources into the appropriate device configuration via gNMI.
What's New
NX-OS Resource Tests (21 tests)
Each test is a separate txtar file:
Basic Configuration Resources:
banner.txt- System banner messagesdns.txt- DNS server configurationntp.txt- NTP server and authenticationlldp.txt- Link Layer Discovery Protocolsnmp.txt- SNMP server and community configurationsyslog.txt- Syslog server configurationNetwork Resources:
vrf.txt- Virtual Routing and Forwarding instancesroutedvlan.txt- L3 VLAN interfacessubinterface.txt- 802.1Q subinterfacesRouting Resources:
routingpolicy_prefixset.txt- Route filtering and policybgp_bgppeer.txt- Border Gateway Protocolospf.txt- Open Shortest Path Firstpim.txt- Protocol Independent Multicastisis.txt- Intermediate System to Intermediate SystemEVPN/VXLAN Resources:
nve.txt- Network Virtualization Edge (VXLAN)evpninstance.txt- EVPN instance configurationvpcdomain.txt- Virtual Port Channel domainSecurity & Services:
acl.txt- ACL rules and entriesdhcprelay.txt- DHCP relay configurationmanagementaccess.txt- Management interface ACLsOpenConfig Provider Test (1 test)
interface.txt- Demonstrates multi-provider support using OpenConfig modelsTest Format
All tests use the txtar format. Each
.txtfile contains: