Skip to content

e2e-tests (4/4): Add e2e testdata fixtures for all resources types#410

Draft
nikatza wants to merge 4 commits into
refactor-tests-3from
refactor-tests-4
Draft

e2e-tests (4/4): Add e2e testdata fixtures for all resources types#410
nikatza wants to merge 4 commits into
refactor-tests-3from
refactor-tests-4

Conversation

@nikatza

@nikatza nikatza commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

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 messages
  • dns.txt - DNS server configuration
  • ntp.txt - NTP server and authentication
  • lldp.txt - Link Layer Discovery Protocol
  • snmp.txt - SNMP server and community configuration
  • syslog.txt - Syslog server configuration

Network Resources:

  • vrf.txt - Virtual Routing and Forwarding instances
  • routedvlan.txt - L3 VLAN interfaces
  • subinterface.txt - 802.1Q subinterfaces

Routing Resources:

  • routingpolicy_prefixset.txt - Route filtering and policy
  • bgp_bgppeer.txt - Border Gateway Protocol
  • ospf.txt - Open Shortest Path First
  • pim.txt - Protocol Independent Multicast
  • isis.txt - Intermediate System to Intermediate System

EVPN/VXLAN Resources:

  • nve.txt - Network Virtualization Edge (VXLAN)
  • evpninstance.txt - EVPN instance configuration
  • vpcdomain.txt - Virtual Port Channel domain

Security & Services:

  • acl.txt - ACL rules and entries
  • dhcprelay.txt - DHCP relay configuration
  • managementaccess.txt - Management interface ACLs

OpenConfig Provider Test (1 test)

  • interface.txt - Demonstrates multi-provider support using OpenConfig models

Test Format

All tests use the txtar format. Each .txt file contains:

  • Kubernetes resource manifests (Device, Interface, VRF, etc.)
  • Expected gNMI configuration updates
  • Test metadata (provider, description)

@nikatza nikatza changed the base branch from main to refactor-tests-3 June 16, 2026 22:22
@nikatza nikatza changed the title e2e-tess (4/4): Add envtest mode for fast in-process e2e testing e2e-tests (4/4): Add envtest mode for fast in-process e2e testing Jun 16, 2026
@nikatza nikatza changed the title e2e-tests (4/4): Add envtest mode for fast in-process e2e testing e2e-tests (4/4): Add e2e testdata fixtures Jun 17, 2026
@nikatza nikatza changed the title e2e-tests (4/4): Add e2e testdata fixtures e2e-tests (4/4): Add e2e testdata fixtures for all resources types Jun 17, 2026
@nikatza nikatza force-pushed the refactor-tests-4 branch from 343add4 to 44ae09a Compare June 17, 2026 23:40
@nikatza nikatza force-pushed the refactor-tests-3 branch 2 times, most recently from 823e208 to f735c68 Compare June 17, 2026 23:45
@nikatza nikatza force-pushed the refactor-tests-4 branch 2 times, most recently from 5e9891b to 864aebb Compare June 18, 2026 07:59
@nikatza nikatza force-pushed the refactor-tests-3 branch 2 times, most recently from 51d400f to ace1a56 Compare June 18, 2026 08:15
@nikatza nikatza force-pushed the refactor-tests-4 branch from 864aebb to b97c1c6 Compare June 18, 2026 08:15
nikatza added 4 commits June 18, 2026 10:27
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant