-
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.
test: add curl features check (#8194)
Add a test ensuring curl was built with the expected features. Description: Add a test ensuring curl was built with the expected features. Risk Level: Low. Testing: n/a. Docs Changes: n/a. Release Notes: n/a. Signed-off-by: Taras Roshko <[email protected]>
- Loading branch information
1 parent
66cc26a
commit d5515ae
Showing
2 changed files
with
49 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
licenses(["notice"]) # Apache 2 | ||
|
||
load( | ||
"//bazel:envoy_build_system.bzl", | ||
"envoy_cc_test", | ||
"envoy_package", | ||
) | ||
|
||
envoy_package() | ||
|
||
envoy_cc_test( | ||
name = "curl_test", | ||
srcs = ["curl_test.cc"], | ||
external_deps = [ | ||
"curl", | ||
], | ||
) |
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,32 @@ | ||
#include "curl/curl.h" | ||
#include "gtest/gtest.h" | ||
|
||
namespace Envoy { | ||
namespace Dependencies { | ||
|
||
TEST(CurlTest, BuiltWithExpectedFeatures) { | ||
// Ensure built with the expected features, flags from | ||
// https://curl.haxx.se/libcurl/c/curl_version_info.html. | ||
curl_version_info_data* info = curl_version_info(CURLVERSION_NOW); | ||
|
||
EXPECT_NE(0, info->features & CURL_VERSION_ASYNCHDNS); | ||
EXPECT_NE(0, info->ares_num); | ||
EXPECT_NE(0, info->features & CURL_VERSION_HTTP2); | ||
EXPECT_NE(0, info->features & CURL_VERSION_LIBZ); | ||
EXPECT_NE(0, info->features & CURL_VERSION_IPV6); | ||
EXPECT_NE(0, info->features & CURL_VERSION_UNIX_SOCKETS); | ||
|
||
EXPECT_EQ(0, info->features & CURL_VERSION_BROTLI); | ||
EXPECT_EQ(0, info->features & CURL_VERSION_GSSAPI); | ||
EXPECT_EQ(0, info->features & CURL_VERSION_GSSNEGOTIATE); | ||
EXPECT_EQ(0, info->features & CURL_VERSION_KERBEROS4); | ||
EXPECT_EQ(0, info->features & CURL_VERSION_KERBEROS5); | ||
EXPECT_EQ(0, info->features & CURL_VERSION_NTLM); | ||
EXPECT_EQ(0, info->features & CURL_VERSION_NTLM_WB); | ||
EXPECT_EQ(0, info->features & CURL_VERSION_SPNEGO); | ||
EXPECT_EQ(0, info->features & CURL_VERSION_SSL); | ||
EXPECT_EQ(0, info->features & CURL_VERSION_SSPI); | ||
} | ||
|
||
} // namespace Dependencies | ||
} // namespace Envoy |