From 1022eea70123565232063b306cc650c0b7161980 Mon Sep 17 00:00:00 2001 From: Alyssa Wilk Date: Thu, 26 May 2022 11:37:08 -0400 Subject: [PATCH] test fixup Signed-off-by: Alyssa Wilk --- .../compressor_integration_tests.cc | 7 +------ .../http/jwt_authn/filter_integration_test.cc | 15 +++++---------- test/integration/protocol_integration_test.cc | 19 ++++++++----------- 3 files changed, 14 insertions(+), 27 deletions(-) diff --git a/test/extensions/filters/http/compressor/compressor_integration_tests.cc b/test/extensions/filters/http/compressor/compressor_integration_tests.cc index 9b5e33f4c347..982b94b47645 100644 --- a/test/extensions/filters/http/compressor/compressor_integration_tests.cc +++ b/test/extensions/filters/http/compressor/compressor_integration_tests.cc @@ -268,12 +268,7 @@ TEST_P(CompressorProxyingConnectIntegrationTest, ProxyConnect) { RELEASE_ASSERT(result, result.message()); ASSERT_TRUE(upstream_request_->waitForHeadersComplete()); EXPECT_EQ(upstream_request_->headers().get(Http::Headers::get().Method)[0]->value(), "CONNECT"); - if (upstreamProtocol() == Http::CodecType::HTTP1) { - EXPECT_TRUE(upstream_request_->headers().get(Http::Headers::get().Protocol).empty()); - } else { - EXPECT_EQ(upstream_request_->headers().get(Http::Headers::get().Protocol)[0]->value(), - "bytestream"); - } + EXPECT_TRUE(upstream_request_->headers().get(Http::Headers::get().Protocol).empty()); // Send response headers upstream_request_->encodeHeaders(default_response_headers_, false); diff --git a/test/extensions/filters/http/jwt_authn/filter_integration_test.cc b/test/extensions/filters/http/jwt_authn/filter_integration_test.cc index 21246374d0da..855a86f82c0d 100644 --- a/test/extensions/filters/http/jwt_authn/filter_integration_test.cc +++ b/test/extensions/filters/http/jwt_authn/filter_integration_test.cc @@ -303,16 +303,11 @@ TEST_P(LocalJwksIntegrationTest, ConnectRequestWithRegExMatch) { request_encoder_ = &encoder_decoder.first; auto response = std::move(encoder_decoder.second); - if (downstreamProtocol() == Http::CodecType::HTTP1) { - // Because CONNECT requests for HTTP/1 do not include a path, they will fail - // to find a route match and return a 404. - ASSERT_TRUE(response->waitForEndStream()); - ASSERT_TRUE(response->complete()); - EXPECT_EQ("404", response->headers().getStatusValue()); - } else { - ASSERT_TRUE(response->waitForReset()); - ASSERT_TRUE(codec_client_->waitForDisconnect()); - } + // Because CONNECT requests do not include a path, they will fail + // to find a route match and return a 404. + ASSERT_TRUE(response->waitForEndStream()); + ASSERT_TRUE(response->complete()); + EXPECT_EQ("404", response->headers().getStatusValue()); } // The test case with a fake upstream for remote Jwks server. diff --git a/test/integration/protocol_integration_test.cc b/test/integration/protocol_integration_test.cc index 5474ed514bb7..37ee63bf5804 100644 --- a/test/integration/protocol_integration_test.cc +++ b/test/integration/protocol_integration_test.cc @@ -2733,19 +2733,15 @@ TEST_P(DownstreamProtocolIntegrationTest, ConnectIsBlocked) { request_encoder_ = &encoder_decoder.first; auto response = std::move(encoder_decoder.second); - if (downstreamProtocol() == Http::CodecType::HTTP1) { - // Because CONNECT requests for HTTP/1 do not include a path, they will fail - // to find a route match and return a 404. - ASSERT_TRUE(response->waitForEndStream()); - EXPECT_EQ("404", response->headers().getStatusValue()); - EXPECT_TRUE(response->complete()); - } else { - ASSERT_TRUE(response->waitForReset()); - ASSERT_TRUE(codec_client_->waitForDisconnect()); - } + // Because CONNECT requests do not include a path, they will fail + // to find a route match and return a 404. + ASSERT_TRUE(response->waitForEndStream()); + EXPECT_EQ("404", response->headers().getStatusValue()); + EXPECT_TRUE(response->complete()); } TEST_P(DownstreamProtocolIntegrationTest, ExtendedConnectIsBlocked) { + config_helper_.addRuntimeOverride("envoy.reloadable_features.use_rfc_connect", "false"); if (downstreamProtocol() == Http::CodecType::HTTP1) { return; } @@ -2785,7 +2781,8 @@ TEST_P(DownstreamProtocolIntegrationTest, ConnectStreamRejection) { auto response = codec_client_->makeHeaderOnlyRequest( Http::TestRequestHeaderMapImpl{{":method", "CONNECT"}, {":authority", "sni.lyft.com"}}); - ASSERT_TRUE(response->waitForReset()); + ASSERT_TRUE(response->waitForEndStream()); + EXPECT_EQ("404", response->headers().getStatusValue()); EXPECT_FALSE(codec_client_->disconnected()); }