From e9f7e6e7832fce4d08d852f598f630514937a251 Mon Sep 17 00:00:00 2001 From: freddygv Date: Mon, 22 Jun 2020 12:18:13 -0600 Subject: [PATCH 1/3] Merge http2 integration test case into grpc case --- .../connect/envoy/case-grpc/verify.bats | 8 ++++ .../connect/envoy/case-http2/capture.sh | 4 -- .../connect/envoy/case-http2/s1.hcl | 22 ----------- .../connect/envoy/case-http2/s2.hcl | 14 ------- .../connect/envoy/case-http2/setup.sh | 6 --- .../connect/envoy/case-http2/verify.bats | 39 ------------------- 6 files changed, 8 insertions(+), 85 deletions(-) delete mode 100755 test/integration/connect/envoy/case-http2/capture.sh delete mode 100644 test/integration/connect/envoy/case-http2/s1.hcl delete mode 100644 test/integration/connect/envoy/case-http2/s2.hcl delete mode 100644 test/integration/connect/envoy/case-http2/setup.sh delete mode 100644 test/integration/connect/envoy/case-http2/verify.bats diff --git a/test/integration/connect/envoy/case-grpc/verify.bats b/test/integration/connect/envoy/case-grpc/verify.bats index 7d0e900c0e7e..5092bf34330f 100644 --- a/test/integration/connect/envoy/case-grpc/verify.bats +++ b/test/integration/connect/envoy/case-grpc/verify.bats @@ -10,6 +10,14 @@ load helpers retry_default curl -f -s localhost:19001/stats -o /dev/null } +@test "s1 proxy listener should be up and have right cert" { + assert_proxy_presents_cert_uri localhost:21000 s1 +} + +@test "s2 proxy listener should be up and have right cert" { + assert_proxy_presents_cert_uri localhost:21001 s2 +} + @test "s2 proxy should be healthy" { assert_service_has_healthy_instances s2 1 } diff --git a/test/integration/connect/envoy/case-http2/capture.sh b/test/integration/connect/envoy/case-http2/capture.sh deleted file mode 100755 index 1a11f7d5e014..000000000000 --- a/test/integration/connect/envoy/case-http2/capture.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -snapshot_envoy_admin localhost:19000 s1 primary || true -snapshot_envoy_admin localhost:19001 s2 primary || true diff --git a/test/integration/connect/envoy/case-http2/s1.hcl b/test/integration/connect/envoy/case-http2/s1.hcl deleted file mode 100644 index 660303e19892..000000000000 --- a/test/integration/connect/envoy/case-http2/s1.hcl +++ /dev/null @@ -1,22 +0,0 @@ -services { - name = "s1" - port = 8080 - connect { - sidecar_service { - proxy { - upstreams = [ - { - destination_name = "s2" - local_bind_port = 5000 - config { - protocol = "http2" - } - } - ] - config { - protocol = "http2" - } - } - } - } -} \ No newline at end of file diff --git a/test/integration/connect/envoy/case-http2/s2.hcl b/test/integration/connect/envoy/case-http2/s2.hcl deleted file mode 100644 index 0fb773a2d7b9..000000000000 --- a/test/integration/connect/envoy/case-http2/s2.hcl +++ /dev/null @@ -1,14 +0,0 @@ -services { - name = "s2" - # Advertise gRPC (http2) port - port = 8179 - connect { - sidecar_service { - proxy { - config { - protocol = "http2" - } - } - } - } -} \ No newline at end of file diff --git a/test/integration/connect/envoy/case-http2/setup.sh b/test/integration/connect/envoy/case-http2/setup.sh deleted file mode 100644 index 0655ef2a21b8..000000000000 --- a/test/integration/connect/envoy/case-http2/setup.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -eEuo pipefail - -gen_envoy_bootstrap s1 19000 primary -gen_envoy_bootstrap s2 19001 primary \ No newline at end of file diff --git a/test/integration/connect/envoy/case-http2/verify.bats b/test/integration/connect/envoy/case-http2/verify.bats deleted file mode 100644 index ee2b7f8a23a9..000000000000 --- a/test/integration/connect/envoy/case-http2/verify.bats +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bats - -load helpers - -@test "s1 proxy admin is up on :19000" { - retry_default curl -f -s localhost:19000/stats -o /dev/null -} - -@test "s2 proxy admin is up on :19001" { - retry_default curl -f -s localhost:19001/stats -o /dev/null -} - -@test "s1 proxy listener should be up and have right cert" { - assert_proxy_presents_cert_uri localhost:21000 s1 -} - -@test "s2 proxy listener should be up and have right cert" { - assert_proxy_presents_cert_uri localhost:21001 s2 -} - -@test "s2 proxy should be healthy" { - assert_service_has_healthy_instances s2 1 -} - -@test "s1 upstream should have healthy endpoints for s2" { - # protocol is configured in an upstream override so the cluster name is customized here - assert_upstream_has_endpoints_in_status 127.0.0.1:19000 49c19fe6~s2.default.primary HEALTHY 1 -} - -@test "s1 upstream should be able to connect to s2 via http2" { - # We use grpc here because it's the easiest way to test http2. The server - # needs to support h2c since the proxy doesn't talk TLS to the local app. - # Most http2 servers don't support that but gRPC does. We could use curl - run curl -f -s -X POST localhost:5000/PingServer.Ping/ - - echo "OUTPUT: $output" - - [ "$status" == 0 ] -} From b8a28e3f5b38d051b5872800e919cc7d746aef6b Mon Sep 17 00:00:00 2001 From: freddygv Date: Mon, 22 Jun 2020 12:37:22 -0600 Subject: [PATCH 2/3] Add comment about http2 being covered by grpc --- test/integration/connect/envoy/case-grpc/verify.bats | 1 + 1 file changed, 1 insertion(+) diff --git a/test/integration/connect/envoy/case-grpc/verify.bats b/test/integration/connect/envoy/case-grpc/verify.bats index 5092bf34330f..33d9db8ad8e3 100644 --- a/test/integration/connect/envoy/case-grpc/verify.bats +++ b/test/integration/connect/envoy/case-grpc/verify.bats @@ -28,6 +28,7 @@ load helpers } @test "s1 upstream should be able to connect to s2 via grpc" { + # This test also covers http2 since gRPC always uses http2 run fortio grpcping localhost:5000 echo "OUTPUT: $output" From 17e674a87884e5c05e24e2623919059c119e1ccb Mon Sep 17 00:00:00 2001 From: freddygv Date: Mon, 22 Jun 2020 12:46:06 -0600 Subject: [PATCH 3/3] Remove outdated case --- test/integration/connect/envoy/main_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/test/integration/connect/envoy/main_test.go b/test/integration/connect/envoy/main_test.go index e694b20f690b..9ada95da7d7f 100644 --- a/test/integration/connect/envoy/main_test.go +++ b/test/integration/connect/envoy/main_test.go @@ -28,7 +28,6 @@ func TestEnvoy(t *testing.T) { "case-gateway-without-services", "case-grpc", "case-http", - "case-http2", "case-http-badauthz", "case-ingress-gateway-http", "case-ingress-gateway-multiple-services",