Skip to content

Commit

Permalink
Test istio with system-internal-tls enabled (#14494)
Browse files Browse the repository at this point in the history
* Test istio with system-internal-tls enabled

* Rename test and fix lint warnings
  • Loading branch information
ReToCode authored Oct 18, 2023
1 parent 1940e5a commit 707d286
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/kind-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ jobs:
- kourier
- kourier-tls
- istio
- istio-tls
- istio-ambient
- contour
# Disabled due to consistent failures
Expand All @@ -118,6 +119,11 @@ jobs:
- ingress: istio
namespace-resources: virtualservices

- ingress: istio-tls
ingress-class: istio
namespace-resources: virtualservices
enable-tls: 1

- ingress: istio-ambient
namespace-resources: virtualservices
ingress-class: istio
Expand Down
15 changes: 8 additions & 7 deletions test/e2e/systeminternaltls/system_internal_tls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ import (
v1test "knative.dev/serving/test/v1"
)

// TestInternalEncrytion tests the TLS connections between system components.
func TestInternalEncryption(t *testing.T) {
// TestSystemInternalTLS tests the TLS connections between system components.
func TestSystemInternalTLS(t *testing.T) {
if !test.ServingFlags.EnableAlphaFeatures {
t.Skip("Alpha features not enabled")
}

if !(strings.Contains(test.ServingFlags.IngressClass, "kourier")) {
t.Skip("Skip this test for non-kourier ingress.")
if !(strings.Contains(test.ServingFlags.IngressClass, "kourier") ||
strings.Contains(test.ServingFlags.IngressClass, "istio")) {
t.Skip("Skip this test for non-kourier or non-istio ingress.")
}

t.Parallel()
Expand Down Expand Up @@ -126,15 +127,15 @@ func scanPodLogs(req *rest.Request, matcher func(string) bool) (matchCount int,

podLogs, err := req.Stream(context.Background())
if err != nil {
err = fmt.Errorf("Failed to stream activator logs: %w", err)
err = fmt.Errorf("failed to stream activator logs: %w", err)
return
}

buf := new(bytes.Buffer)
_, err = io.Copy(buf, podLogs)
podLogs.Close()
if err != nil {
err = fmt.Errorf("Failed to read activator logs from buffer: %w", err)
err = fmt.Errorf("failed to read activator logs from buffer: %w", err)
return
}

Expand All @@ -146,7 +147,7 @@ func scanPodLogs(req *rest.Request, matcher func(string) bool) (matchCount int,
}

if err = scanner.Err(); err != nil {
err = fmt.Errorf("Failed scanning activator logs: %w", err)
err = fmt.Errorf("failed scanning activator logs: %w", err)
return
}

Expand Down

0 comments on commit 707d286

Please sign in to comment.