From 0d60cd9ba4a5c18b01b6ef996434953071f0576e Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 1 Jul 2024 17:07:02 +0200 Subject: Pass Auth::TLS instance to serve and execute clients --- test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp') diff --git a/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp b/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp index 8daceb31..069421c9 100644 --- a/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp @@ -13,11 +13,13 @@ // limitations under the License. #include // std::equal_to +#include #include #include #include "catch2/catch_test_macros.hpp" #include "gsl/gsl" +#include "src/buildtool/auth/authentication.hpp" #include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_blob_container.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp" @@ -31,8 +33,13 @@ TEST_CASE("Bazel internals: CAS Client", "[execution_api]") { std::string instance_name{"remote-execution"}; std::string content("test"); + std::optional auth = {}; + if (Auth::Instance().GetAuthMethod() == AuthMethod::kTLS) { + auth = Auth::TLS::Instance(); + } + // Create CAS client - BazelCasClient cas_client(info->host, info->port); + BazelCasClient cas_client(info->host, info->port, auth ? &*auth : nullptr); SECTION("Valid digest and blob") { // digest of "test" -- cgit v1.2.3