Skip to content

Commit

Permalink
test(unit): show that timeouts are applied even when there is no policy
Browse files Browse the repository at this point in the history
Signed-off-by: Lukasz Dziedziak <[email protected]>
  • Loading branch information
lukidzi committed Nov 14, 2024
1 parent 6b40eee commit 2e44ed0
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
connectTimeout: 5s
name: localhost:8080
typedExtensionProtocolOptions:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
'@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
commonHttpProtocolOptions:
idleTimeout: 3600s
maxConnectionDuration: 5s
maxStreamDuration: 0s
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
address:
socketAddress:
address: 127.0.0.1
portValue: 80
enableReusePort: false
filterChains:
- filters:
- name: envoy.filters.network.http_connection_manager
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
commonHttpProtocolOptions:
idleTimeout: 0s
httpFilters:
- name: envoy.filters.http.router
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
requestHeadersTimeout: 0s
routeConfig:
name: inbound:backend
requestHeadersToRemove:
- x-kuma-tags
validateClusters: false
virtualHosts:
- domains:
- '*'
name: backend
routes:
- match:
prefix: /
route:
cluster: backend
idleTimeout: 5s
timeout: 15s
statPrefix: inbound_127_0_0_1_80
name: inbound:127.0.0.1:80
trafficDirection: INBOUND
24 changes: 24 additions & 0 deletions pkg/plugins/policies/meshtimeout/plugin/v1alpha1/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,30 @@ var _ = Describe("MeshTimeout", func() {
expectedClusters: []string{"basic_inbound_cluster.golden.yaml"},
expectedListeners: []string{"basic_inbound_listener.golden.yaml"},
}),
Entry("basic inbound route without defaults", sidecarTestCase{
resources: []core_xds.Resource{
{
Name: "inbound",
Origin: generator.OriginInbound,
Resource: httpInboundListenerWith(),
},
{
Name: "inbound",
Origin: generator.OriginInbound,
Resource: test_xds.ClusterWithName(fmt.Sprintf("localhost:%d", builders.FirstInboundServicePort)),
},
},
fromRules: core_rules.FromRules{
Rules: map[core_rules.InboundListener]core_rules.Rules{
{
Address: "127.0.0.1",
Port: 80,
}: []*core_rules.Rule{},
},
},
expectedClusters: []string{"basic_without_defaults_inbound_cluster.golden.yaml"},
expectedListeners: []string{"basic_without_defaults_inbound_listener.golden.yaml"},
}),
Entry("outbound with defaults when http conf missing", sidecarTestCase{
resources: []core_xds.Resource{
{
Expand Down

0 comments on commit 2e44ed0

Please sign in to comment.