-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into bump_v8_10.7.193.13
- Loading branch information
Showing
77 changed files
with
4,098 additions
and
419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
load( | ||
"//bazel:envoy_build_system.bzl", | ||
"envoy_cc_test", | ||
"envoy_contrib_package", | ||
) | ||
|
||
licenses(["notice"]) # Apache 2 | ||
|
||
envoy_contrib_package() | ||
|
||
envoy_cc_test( | ||
name = "config_test", | ||
srcs = ["config_test.cc"], | ||
deps = [ | ||
"//source/common/protobuf:utility_lib", | ||
"//test/test_common:status_utility_lib", | ||
"@envoy_api//contrib/envoy/extensions/network/connection_balance/dlb/v3alpha:pkg_cc_proto", | ||
"@envoy_api//envoy/config/core/v3:pkg_cc_proto", | ||
], | ||
) |
57 changes: 57 additions & 0 deletions
57
contrib/network/connection_balance/dlb/test/config_test.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#include "envoy/config/core/v3/extension.pb.h" | ||
|
||
#include "source/common/protobuf/utility.h" | ||
|
||
#include "test/test_common/status_utility.h" | ||
|
||
#include "contrib/envoy/extensions/network/connection_balance/dlb/v3alpha/dlb.pb.h" | ||
#include "gtest/gtest.h" | ||
|
||
namespace Envoy { | ||
namespace Extensions { | ||
namespace Dlb { | ||
|
||
class DlbConnectionBalanceFactoryTest : public testing::Test { | ||
protected: | ||
// Create a default DLB connection balance typed config. | ||
static void makeDlbConnectionBalanceConfig( | ||
envoy::config::core::v3::TypedExtensionConfig& typed_config, | ||
envoy::extensions::network::connection_balance::dlb::v3alpha::Dlb& dlb) { | ||
typed_config.mutable_typed_config()->PackFrom(dlb); | ||
typed_config.set_name("envoy.network.connection_balance.dlb"); | ||
} | ||
|
||
// Verify typed config is dlb, and unpack to dlb object. | ||
static void verifyDlbConnectionBalanceConfigAndUnpack( | ||
envoy::config::core::v3::TypedExtensionConfig& typed_config, | ||
envoy::extensions::network::connection_balance::dlb::v3alpha::Dlb& dlb) { | ||
EXPECT_EQ(typed_config.name(), "envoy.network.connection_balance.dlb"); | ||
EXPECT_EQ(typed_config.typed_config().type_url(), | ||
"type.googleapis.com/" | ||
"envoy.extensions.network.connection_balance.dlb.v3alpha.Dlb"); | ||
ASSERT_OK(MessageUtil::unpackToNoThrow(typed_config.typed_config(), dlb)); | ||
} | ||
}; | ||
|
||
TEST_F(DlbConnectionBalanceFactoryTest, MakeDefaultConfig) { | ||
envoy::config::core::v3::TypedExtensionConfig typed_config; | ||
envoy::extensions::network::connection_balance::dlb::v3alpha::Dlb dlb; | ||
makeDlbConnectionBalanceConfig(typed_config, dlb); | ||
verifyDlbConnectionBalanceConfigAndUnpack(typed_config, dlb); | ||
EXPECT_EQ(0, dlb.id()); | ||
} | ||
|
||
TEST_F(DlbConnectionBalanceFactoryTest, MakeCustomConfig) { | ||
envoy::config::core::v3::TypedExtensionConfig typed_config; | ||
|
||
envoy::extensions::network::connection_balance::dlb::v3alpha::Dlb dlb; | ||
dlb.set_id(10); | ||
|
||
makeDlbConnectionBalanceConfig(typed_config, dlb); | ||
verifyDlbConnectionBalanceConfigAndUnpack(typed_config, dlb); | ||
EXPECT_EQ(10, dlb.id()); | ||
} | ||
|
||
} // namespace Dlb | ||
} // namespace Extensions | ||
} // namespace Envoy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.