-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Go TLS tracing tests for binaries built with boringcrypto (#1461)
Summary: Add Go TLS tracing tests for binaries built with boringcrypto I will follow up with updating the docs.px.dev encryption library section of the [data source docs](https://docs.px.dev/about-pixie/data-sources/#encryption-libraries) to list boringcrypto as a supported TLS library. Relevant Issues: Fixes #597 Type of change: /kind test-infra Test Plan: New test coverage verifies boringcrypto TLS tracing is functional and verified that binaries used have boringcrypto enabled with `goversion -crypto` <details> <summary>goversion test output</summary> ``` # Build the boringcrypto binaries used the trace bpf tests ddelnano@vigenere:~/code/pixie (ddelnano/add-go-boringcrypto-tls-tracing-tests) $ bazel query //... | grep boringcrypto | grep binary | xargs -I{} bazel build {} Loading: 0 packages loaded Loading: 501 packages loaded INFO: Invocation ID: ebe2161e-6317-42d8-8c23-e83173c5ab64 INFO: Streaming build results to: https://bb.corp.pixielabs.ai/invocation/ebe2161e-6317-42d8-8c23-e83173c5ab64 INFO: Analyzed target //src/stirling/testing/demo_apps/go_grpc_tls_pl/client:golang_boringcrypto_grpc_tls_client_binary (0 packages loaded, 0 targets configured). INFO: Found 1 target... Target //src/stirling/testing/demo_apps/go_grpc_tls_pl/client:golang_boringcrypto_grpc_tls_client_binary up-to-date: bazel-bin/src/stirling/testing/demo_apps/go_grpc_tls_pl/client/golang_boringcrypto_grpc_tls_client_binary INFO: Elapsed time: 1.118s, Critical Path: 0.11s INFO: 1 process: 1 internal. INFO: Streaming build results to: https://bb.corp.pixielabs.ai/invocation/ebe2161e-6317-42d8-8c23-e83173c5ab64 INFO: Build completed successfully, 1 total action INFO: Invocation ID: bab5d6bb-5e75-48f3-91a7-5c7b7ab7fb25 INFO: Streaming build results to: https://bb.corp.pixielabs.ai/invocation/bab5d6bb-5e75-48f3-91a7-5c7b7ab7fb25 INFO: Analyzed target //src/stirling/testing/demo_apps/go_grpc_tls_pl/server:golang_boringcrypto_grpc_tls_server_binary (2 packages loaded, 6 targets configured). INFO: Found 1 target... Target //src/stirling/testing/demo_apps/go_grpc_tls_pl/server:golang_boringcrypto_grpc_tls_server_binary up-to-date: bazel-bin/src/stirling/testing/demo_apps/go_grpc_tls_pl/server/golang_boringcrypto_grpc_tls_server_binary INFO: Elapsed time: 0.932s, Critical Path: 0.04s INFO: 1 process: 1 internal. INFO: Streaming build results to: https://bb.corp.pixielabs.ai/invocation/bab5d6bb-5e75-48f3-91a7-5c7b7ab7fb25 INFO: Build completed successfully, 1 total action INFO: Invocation ID: ff5e37d4-0cdf-4f78-b582-affeef69dcc4 INFO: Streaming build results to: https://bb.corp.pixielabs.ai/invocation/ff5e37d4-0cdf-4f78-b582-affeef69dcc4 INFO: Analyzed target //src/stirling/testing/demo_apps/go_https/client:golang_boringcrypto_client_binary (1 packages loaded, 4 targets configured). INFO: Found 1 target... Target //src/stirling/testing/demo_apps/go_https/client:golang_boringcrypto_client_binary up-to-date: bazel-bin/src/stirling/testing/demo_apps/go_https/client/golang_boringcrypto_client_binary INFO: Elapsed time: 0.503s, Critical Path: 0.06s INFO: 1 process: 1 internal. INFO: Streaming build results to: https://bb.corp.pixielabs.ai/invocation/ff5e37d4-0cdf-4f78-b582-affeef69dcc4 INFO: Build completed successfully, 1 total action INFO: Invocation ID: e1938fea-1793-490b-befd-38f632f95c6c INFO: Streaming build results to: https://bb.corp.pixielabs.ai/invocation/e1938fea-1793-490b-befd-38f632f95c6c INFO: Analyzed target //src/stirling/testing/demo_apps/go_https/server:golang_boringcrypto_server_binary (1 packages loaded, 4 targets configured). INFO: Found 1 target... Target //src/stirling/testing/demo_apps/go_https/server:golang_boringcrypto_server_binary up-to-date: bazel-bin/src/stirling/testing/demo_apps/go_https/server/golang_boringcrypto_server_binary INFO: Elapsed time: 0.421s, Critical Path: 0.05s INFO: 1 process: 1 internal. INFO: Streaming build results to: https://bb.corp.pixielabs.ai/invocation/e1938fea-1793-490b-befd-38f632f95c6c INFO: Build completed successfully, 1 total action # Verify with goversion -crypto that boringcrypto is in use ddelnano@vigenere:~/code/pixie (ddelnano/add-go-boringcrypto-tls-tracing-tests) $ ~/go/bin/goversion -crypto bazel-bin/src/stirling/testing/demo_apps/go_grpc_tls_pl/client/golang_boringcrypto_grpc_tls_client_binary bazel-bin/src/stirling/testing/demo_apps/go_grpc_tls_pl/client/golang_boringcrypto_grpc_tls_client_binary go1.20.4 X:boringcrypto,nocoverageredesign (boring crypto) ddelnano@vigenere:~/code/pixie (ddelnano/add-go-boringcrypto-tls-tracing-tests) $ ~/go/bin/goversion -crypto bazel-bin/src/stirling/testing/demo_apps/go_grpc_tls_pl/server/golang_boringcrypto_grpc_tls_server_binary bazel-bin/src/stirling/testing/demo_apps/go_grpc_tls_pl/server/golang_boringcrypto_grpc_tls_server_binary go1.20.4 X:boringcrypto,nocoverageredesign (boring crypto) ddelnano@vigenere:~/code/pixie (ddelnano/add-go-boringcrypto-tls-tracing-tests) $ ~/go/bin/goversion -crypto bazel-bin/src/stirling/testing/demo_apps/go_https/client/golang_boringcrypto_client_binary bazel-bin/src/stirling/testing/demo_apps/go_https/client/golang_boringcrypto_client_binary go1.20.4 X:boringcrypto,nocoverageredesign (boring crypto) ddelnano@vigenere:~/code/pixie (ddelnano/add-go-boringcrypto-tls-tracing-tests) $ ~/go/bin/goversion -crypto bazel-bin/src/stirling/testing/demo_apps/go_https/server/golang_boringcrypto_server_binary bazel-bin/src/stirling/testing/demo_apps/go_https/server/golang_boringcrypto_server_binary go1.20.4 X:boringcrypto,nocoverageredesign (boring crypto) ``` </details> --------- Signed-off-by: Dom Del Nano <ddelnano@pixielabs.ai>
- Loading branch information
Showing
16 changed files
with
245 additions
and
25 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
46 changes: 46 additions & 0 deletions
46
...connectors/socket_tracer/testing/container_images/go_boringcrypto_grpc_client_container.h
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,46 @@ | ||
/* | ||
* Copyright 2018- The Pixie Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
|
||
#include "src/common/testing/test_environment.h" | ||
#include "src/common/testing/test_utils/container_runner.h" | ||
|
||
namespace px { | ||
namespace stirling { | ||
namespace testing { | ||
|
||
class GoBoringCryptoGRPCClientContainer : public ContainerRunner { | ||
public: | ||
GoBoringCryptoGRPCClientContainer() | ||
: ContainerRunner(::px::testing::BazelRunfilePath(kBazelImageTar), kContainerNamePrefix, | ||
kReadyMessage) {} | ||
|
||
private: | ||
static constexpr std::string_view kBazelImageTar = | ||
"src/stirling/testing/demo_apps/go_grpc_tls_pl/client/" | ||
"golang_boringcrypto_grpc_tls_client.tar"; | ||
static constexpr std::string_view kContainerNamePrefix = "grpc_client"; | ||
static constexpr std::string_view kReadyMessage = ""; | ||
}; | ||
|
||
} // namespace testing | ||
} // namespace stirling | ||
} // namespace px |
46 changes: 46 additions & 0 deletions
46
...connectors/socket_tracer/testing/container_images/go_boringcrypto_grpc_server_container.h
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,46 @@ | ||
/* | ||
* Copyright 2018- The Pixie Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
|
||
#include "src/common/testing/test_environment.h" | ||
#include "src/common/testing/test_utils/container_runner.h" | ||
|
||
namespace px { | ||
namespace stirling { | ||
namespace testing { | ||
|
||
class GoBoringCryptoGRPCServerContainer : public ContainerRunner { | ||
public: | ||
GoBoringCryptoGRPCServerContainer() | ||
: ContainerRunner(::px::testing::BazelRunfilePath(kBazelImageTar), kContainerNamePrefix, | ||
kReadyMessage) {} | ||
|
||
private: | ||
static constexpr std::string_view kBazelImageTar = | ||
"src/stirling/testing/demo_apps/go_grpc_tls_pl/server/" | ||
"golang_boringcrypto_grpc_tls_server.tar"; | ||
static constexpr std::string_view kContainerNamePrefix = "grpc_server"; | ||
static constexpr std::string_view kReadyMessage = "Starting HTTP/2 server"; | ||
}; | ||
|
||
} // namespace testing | ||
} // namespace stirling | ||
} // namespace px |
45 changes: 45 additions & 0 deletions
45
..._connectors/socket_tracer/testing/container_images/go_boringcrypto_tls_client_container.h
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,45 @@ | ||
/* | ||
* Copyright 2018- The Pixie Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
|
||
#include "src/common/testing/test_environment.h" | ||
#include "src/common/testing/test_utils/container_runner.h" | ||
|
||
namespace px { | ||
namespace stirling { | ||
namespace testing { | ||
|
||
class GoBoringCryptoTLSClientContainer : public ContainerRunner { | ||
public: | ||
GoBoringCryptoTLSClientContainer() | ||
: ContainerRunner(::px::testing::BazelRunfilePath(kBazelImageTar), kContainerNamePrefix, | ||
kReadyMessage) {} | ||
|
||
private: | ||
static constexpr std::string_view kBazelImageTar = | ||
"src/stirling/testing/demo_apps/go_https/client/golang_boringcrypto_https_client.tar"; | ||
static constexpr std::string_view kContainerNamePrefix = "https_client"; | ||
static constexpr std::string_view kReadyMessage = R"({"status":"ok"})"; | ||
}; | ||
|
||
} // namespace testing | ||
} // namespace stirling | ||
} // namespace px |
45 changes: 45 additions & 0 deletions
45
..._connectors/socket_tracer/testing/container_images/go_boringcrypto_tls_server_container.h
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,45 @@ | ||
/* | ||
* Copyright 2018- The Pixie Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
|
||
#include "src/common/testing/test_environment.h" | ||
#include "src/common/testing/test_utils/container_runner.h" | ||
|
||
namespace px { | ||
namespace stirling { | ||
namespace testing { | ||
|
||
class GoBoringCryptoTLSServerContainer : public ContainerRunner { | ||
public: | ||
GoBoringCryptoTLSServerContainer() | ||
: ContainerRunner(::px::testing::BazelRunfilePath(kBazelImageTar), kContainerNamePrefix, | ||
kReadyMessage) {} | ||
|
||
private: | ||
static constexpr std::string_view kBazelImageTar = | ||
"src/stirling/testing/demo_apps/go_https/server/golang_boringcrypto_https_server.tar"; | ||
static constexpr std::string_view kContainerNamePrefix = "https_server"; | ||
static constexpr std::string_view kReadyMessage = "Starting HTTPS service"; | ||
}; | ||
|
||
} // namespace testing | ||
} // namespace stirling | ||
} // namespace px |
Oops, something went wrong.