Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ target

# Auto-generated Gateway API CRD bindings
crates/gateway-crds/src/*

# Cached Gateway API conformance test files
.cache/

# Temporary conformance job files
conformance/.job-temp.yaml
93 changes: 93 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,96 @@ cargo make gateway-api-sync
```

This downloads the CRD definitions to `.crds/v<version>/` and generates Rust bindings in `crates/gateway-crds/src/`.

## Conformance Testing

This project includes infrastructure for running the official [Gateway API conformance test suite](https://gateway-api.sigs.k8s.io/concepts/conformance/) to validate the implementation.

### Quick Start

```bash
# Run all conformance tests
cargo make conformance

# Run only specific tests
./scripts/conformance-tests.sh run --tests "HTTPRouteSimpleSameNamespace,GatewayWithAttachedRoutes"

# Run tests from a file
./scripts/conformance-tests.sh run --file conformance/passing-tests.txt
```

### Managing Tests

The `scripts/conformance-tests.sh` script helps manage which conformance tests to run:

```bash
# List all available tests (76 total)
./scripts/conformance-tests.sh list

# List tests grouped by category
./scripts/conformance-tests.sh list --categories

# Save test list to a file
./scripts/conformance-tests.sh list --output my-tests.txt

# Run specific tests
./scripts/conformance-tests.sh run --tests "HTTPRouteSimpleSameNamespace"

# Run tests from a file (one test name per line)
./scripts/conformance-tests.sh run --file conformance/passing-tests.txt

# Skip certain tests
./scripts/conformance-tests.sh run --skip "HTTPRouteTimeout,GRPCRouteWeight"
```

### Incremental Conformance Workflow

Since this gateway implementation will initially pass only a subset of tests, use this workflow to track progress:

1. **View all available tests:**
```bash
./scripts/conformance-tests.sh list --categories
```

2. **Edit the passing tests file** to include tests you expect to pass:
```bash
# Edit conformance/passing-tests.txt
# Uncomment test names as you implement features
```

3. **Run only the passing tests** to verify no regressions:
```bash
./scripts/conformance-tests.sh run --file conformance/passing-tests.txt
```

4. **As you implement more features**, uncomment additional tests in `passing-tests.txt` and re-run.

### Test Categories

| Category | Description |
|----------|-------------|
| HTTPRoute | HTTP routing, matching, redirects, rewrites, headers |
| Gateway | Gateway lifecycle, listeners, TLS configuration |
| GRPCRoute | gRPC routing and matching |
| TLSRoute | TLS passthrough routing |
| UDPRoute | UDP routing |
| BackendTLSPolicy | Backend TLS configuration |

### Individual Conformance Commands

```bash
# Build the conformance test Docker image
cargo make conformance-build

# Load the image into kind cluster
cargo make conformance-load

# Run the conformance job
cargo make conformance-run

# View logs from the last run
cargo make conformance-logs

# Clean up conformance resources
cargo make conformance-cleanup
```
76 changes: 76 additions & 0 deletions conformance/all-tests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
BackendTLSPolicy
BackendTLSPolicyConflictResolution
BackendTLSPolicyInvalidCACertificateRef
BackendTLSPolicyInvalidKind
BackendTLSPolicyObservedGenerationBump
BackendTLSPolicySANValidation
GRPCExactMethodMatching
GRPCRouteHeaderMatching
GRPCRouteListenerHostnameMatching
GRPCRouteNamedRule
GRPCRouteWeight
GatewayClassObservedGenerationBump
GatewayHTTPListenerIsolation
GatewayInfrastructure
GatewayInvalidRouteKind
GatewayInvalidTLSConfiguration
GatewayModifyListeners
GatewayObservedGenerationBump
GatewayOptionalAddressValue
GatewaySecretInvalidReferenceGrant
GatewaySecretMissingReferenceGrant
GatewaySecretReferenceGrantAllInNamespace
GatewaySecretReferenceGrantSpecific
GatewayStaticAddresses
GatewayWithAttachedRoutes
GatewayWithAttachedRoutesWithPort8080
HTTPRouteBackendProtocolH2C
HTTPRouteBackendProtocolWebSocket
HTTPRouteBackendRequestHeaderModifier
HTTPRouteCORSAllowCredentialsBehavior
HTTPRouteCrossNamespace
HTTPRouteDisallowedKind
HTTPRouteExactPathMatching
HTTPRouteHTTPSListener
HTTPRouteHeaderMatching
HTTPRouteHostnameIntersection
HTTPRouteInvalidBackendRefUnknownKind
HTTPRouteInvalidCrossNamespaceBackendRef
HTTPRouteInvalidCrossNamespaceParentRef
HTTPRouteInvalidNonExistentBackendRef
HTTPRouteInvalidParentRefNotMatchingListenerPort
HTTPRouteInvalidParentRefNotMatchingSectionName
HTTPRouteInvalidParentRefSectionNameNotMatchingPort
HTTPRouteInvalidReferenceGrant
HTTPRouteListenerHostnameMatching
HTTPRouteListenerPortMatching
HTTPRouteMatching
HTTPRouteMatchingAcrossRoutes
HTTPRouteMethodMatching
HTTPRouteNamedRule
HTTPRouteObservedGenerationBump
HTTPRoutePartiallyInvalidViaInvalidReferenceGrant
HTTPRoutePathMatchOrder
HTTPRouteQueryParamMatching
HTTPRouteRedirectHostAndStatus
HTTPRouteRedirectPath
HTTPRouteRedirectPort
HTTPRouteRedirectPortAndScheme
HTTPRouteRedirectScheme
HTTPRouteReferenceGrant
HTTPRouteRequestHeaderModifier
HTTPRouteRequestHeaderModifierBackendWeights
HTTPRouteRequestMirror
HTTPRouteRequestMultipleMirrors
HTTPRouteRequestPercentageMirror
HTTPRouteResponseHeaderModifier
HTTPRouteRewriteHost
HTTPRouteRewritePath
HTTPRouteServiceTypes
HTTPRouteSimpleSameNamespace
HTTPRouteTimeoutBackendRequest
HTTPRouteTimeoutRequest
HTTPRouteWeight
TLSRouteInvalidReferenceGrant
TLSRouteSimpleSameNamespace
UDPRoute
5 changes: 5 additions & 0 deletions conformance/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ echo "Supported Features: ${SUPPORTED_FEATURES}"
echo "Conformance Profiles: ${CONFORMANCE_PROFILES:-none}"
echo "Exempt Features: ${EXEMPT_FEATURES:-none}"
echo "Skip Tests: ${SKIP_TESTS:-none}"
echo "Run Test: ${RUN_TEST:-all}"
echo "Cleanup Base Resources: ${CLEANUP_BASE_RESOURCES}"
echo "Show Debug: ${SHOW_DEBUG}"
echo "Report Output: ${REPORT_OUTPUT:-none}"
Expand Down Expand Up @@ -35,6 +36,10 @@ if [ -n "${SKIP_TESTS}" ]; then
ARGS="${ARGS} --skip-tests=${SKIP_TESTS}"
fi

if [ -n "${RUN_TEST}" ]; then
ARGS="${ARGS} --run-test=${RUN_TEST}"
fi

if [ "${CLEANUP_BASE_RESOURCES}" = "false" ]; then
ARGS="${ARGS} --cleanup-base-resources=false"
fi
Expand Down
20 changes: 20 additions & 0 deletions conformance/passing-tests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Gateway API Conformance Tests - Passing Tests
#
# This file lists the conformance tests that are currently passing.
# Add test names here (one per line) as you implement support for them.
#
# Usage:
# ./scripts/conformance-tests.sh run --file conformance/passing-tests.txt
#
# To see all available tests:
# ./scripts/conformance-tests.sh list
#
# To see tests grouped by category:
# ./scripts/conformance-tests.sh list --categories
#

# === Start with basic tests ===
# Uncomment tests as they start passing:

# HTTPRouteSimpleSameNamespace
# GatewayWithAttachedRoutes
Loading