Skip to content

Commit

Permalink
test: add curl features check (#8194)
Browse files Browse the repository at this point in the history
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
troshko111 authored and lizan committed Sep 10, 2019
1 parent 66cc26a commit d5515ae
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/dependencies/BUILD
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",
],
)
32 changes: 32 additions & 0 deletions test/dependencies/curl_test.cc
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

0 comments on commit d5515ae

Please sign in to comment.