diff --git a/WORKSPACE b/WORKSPACE index 5c88782a9a8..70a50944a32 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -210,32 +210,6 @@ load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") gazelle_dependencies(go_sdk = "go_sdk") -# Download alternative go toolchains after all other dependencies, so that they aren't used by external dependencies. -go_download_sdk( - name = "go_sdk_1_18", - version = "1.18.10", -) - -go_download_sdk( - name = "go_sdk_1_19", - version = "1.19.13", -) - -go_download_sdk( - name = "go_sdk_1_20", - version = "1.20.14", -) - -go_download_sdk( - name = "go_sdk_1_21", - version = "1.21.13", -) - -go_download_sdk( - name = "go_sdk_1_22", - version = "1.22.12", -) - go_download_sdk( name = "go_sdk_1_23", version = "1.23.10", diff --git a/bazel/container_images.bzl b/bazel/container_images.bzl index 435336460be..ab81087c1d6 100644 --- a/bazel/container_images.bzl +++ b/bazel/container_images.bzl @@ -287,3 +287,83 @@ def stirling_test_images(): repository = "mongo", digest = "sha256:19b2e5c91f92c7b18113a1501c5a5fe52b71a6c6d2a5232eeebb4f2abacae04a", ) + + # Tag: 1.0 + # Arch: linux/amd64 + _container_image( + name = "golang_1_18_https_server_with_buildinfo", + repository = "golang_1_18_https_server_with_buildinfo", + digest = "sha256:d4468289a2a4f2520effc48dd8894c998867b6638953302ef4156983dbf6e4e5", + ) + + # Tag: 1.0 + # Arch: linux/amd64 + _container_image( + name = "golang_1_19_https_server_with_buildinfo", + repository = "golang_1_19_https_server_with_buildinfo", + digest = "sha256:8a35dab46ccd9af53704f8c83a8d3b28bf142f8e038696b2ba30b7df1c46df73", + ) + + # Tag: 1.0 + # Arch: linux/amd64 + _container_image( + name = "golang_1_20_https_server_with_buildinfo", + repository = "golang_1_20_https_server_with_buildinfo", + digest = "sha256:c21f14e2213f4d9826926eeb3a0e7c7445789539561b43981bbca3efafcad8d7", + ) + + # Tag: 1.0 + # Arch: linux/amd64 + _container_image( + name = "golang_1_21_https_server_with_buildinfo", + repository = "golang_1_21_https_server_with_buildinfo", + digest = "sha256:abb4573171c0a46afd4c704d8bbd6d123f022c5ad0448869311b026d0586106b", + ) + + # Tag: 1.0 + # Arch: linux/amd64 + _container_image( + name = "golang_1_22_https_server_with_buildinfo", + repository = "golang_1_22_https_server_with_buildinfo", + digest = "sha256:0f14818a1046dfdb7d5ac27e173d99e071219897a1d9969c8d7604acbd0d9541", + ) + + # Tag: 1.0 + # Arch: linux/amd64 + _container_image( + name = "golang_1_18_grpc_server_with_buildinfo", + repository = "golang_1_18_grpc_server_with_buildinfo", + digest = "sha256:e59a94abb2c505f680829951161a0a0209de0d02307da951c5a76d7b84a72034", + ) + + # Tag: 1.0 + # Arch: linux/amd64 + _container_image( + name = "golang_1_19_grpc_server_with_buildinfo", + repository = "golang_1_19_grpc_server_with_buildinfo", + digest = "sha256:88b1ae2096af629152a645f77b9c47dcac45dde95fb78376c6fdf1f7183a652b", + ) + + # Tag: 1.0 + # Arch: linux/amd64 + _container_image( + name = "golang_1_20_grpc_server_with_buildinfo", + repository = "golang_1_20_grpc_server_with_buildinfo", + digest = "sha256:a35e24a44c53d6f984eb633bbb15e318374a61fa426ccc5e580d587ce7f6a788", + ) + + # Tag: 1.0 + # Arch: linux/amd64 + _container_image( + name = "golang_1_21_grpc_server_with_buildinfo", + repository = "golang_1_21_grpc_server_with_buildinfo", + digest = "sha256:998654168565a7d4ed1c73edbafc48042879ac26581972a8ba23fe5a39e520f2", + ) + + # Tag: 1.0 + # Arch: linux/amd64 + _container_image( + name = "golang_1_22_grpc_server_with_buildinfo", + repository = "golang_1_22_grpc_server_with_buildinfo", + digest = "sha256:67adba5e8513670fa37bd042862e7844f26239e8d2997ed8c3b0aa527bc04cc3", + ) diff --git a/bazel/pl_build_system.bzl b/bazel/pl_build_system.bzl index 9293d1dcdda..e695b1f91e8 100644 --- a/bazel/pl_build_system.bzl +++ b/bazel/pl_build_system.bzl @@ -24,7 +24,8 @@ load("@rules_python//python:defs.bzl", "py_test") load("//bazel:toolchain_transitions.bzl", "qemu_interactive_runner") pl_boringcrypto_go_sdk = ["1.23.9"] -pl_supported_go_sdk_versions = ["1.18", "1.19", "1.20", "1.21", "1.22", "1.23", "1.24"] +pl_go_test_versions = ["1.18", "1.19", "1.20", "1.21", "1.22"] +pl_supported_go_sdk_versions = ["1.23", "1.24"] # The last version in this list corresponds to the boringcrypto go sdk version. pl_all_supported_go_sdk_versions = pl_supported_go_sdk_versions + pl_boringcrypto_go_sdk diff --git a/src/stirling/bpf_tools/BUILD.bazel b/src/stirling/bpf_tools/BUILD.bazel index 70c8b966be1..3d23a39decb 100644 --- a/src/stirling/bpf_tools/BUILD.bazel +++ b/src/stirling/bpf_tools/BUILD.bazel @@ -127,7 +127,7 @@ pl_cc_bpf_test( ], deps = [ ":cc_library", - "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_19_grpc_client_container", - "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_19_grpc_server_container", + "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_24_grpc_client_container", + "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_24_grpc_server_container", ], ) diff --git a/src/stirling/bpf_tools/uprobe_extra_trigger_bpf_test.cc b/src/stirling/bpf_tools/uprobe_extra_trigger_bpf_test.cc index ae76c1254c5..1c3eb2be7a1 100644 --- a/src/stirling/bpf_tools/uprobe_extra_trigger_bpf_test.cc +++ b/src/stirling/bpf_tools/uprobe_extra_trigger_bpf_test.cc @@ -21,8 +21,8 @@ #include "src/common/testing/testing.h" #include "src/stirling/bpf_tools/bcc_wrapper.h" #include "src/stirling/bpf_tools/macros.h" -#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_grpc_client_container.h" -#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_grpc_server_container.h" +#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_24_grpc_client_container.h" +#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_24_grpc_server_container.h" namespace px { namespace stirling { @@ -55,10 +55,10 @@ TEST(BCCWrapper, DISABLED_UnexpectedExtraTrigger) { BCCWrapperImpl bcc_wrapper; ASSERT_OK(bcc_wrapper.InitBPFProgram(kBCCProgram)); - ::px::stirling::testing::Go1_19_GRPCServerContainer server1; - ::px::stirling::testing::Go1_19_GRPCServerContainer server2; - ::px::stirling::testing::Go1_19_GRPCClientContainer client1; - ::px::stirling::testing::Go1_19_GRPCClientContainer client2; + ::px::stirling::testing::Go1_24_GRPCServerContainer server1; + ::px::stirling::testing::Go1_24_GRPCServerContainer server2; + ::px::stirling::testing::Go1_24_GRPCClientContainer client1; + ::px::stirling::testing::Go1_24_GRPCClientContainer client2; // A Uprobe template for the GRPCServerContainer. // Binary path is set later. @@ -70,7 +70,7 @@ TEST(BCCWrapper, DISABLED_UnexpectedExtraTrigger) { }; // A templated path to the server. We will replace $0 with the pid of the server instance. - const std::string kServerPath = "/proc/$0/root/golang_1_19_grpc_tls_server_binary"; + const std::string kServerPath = "/proc/$0/root/golang_1_24_grpc_tls_server_binary"; // Run server 1 and attach uprobes to it. ASSERT_OK(server1.Run(std::chrono::seconds{60})); diff --git a/src/stirling/e2e_tests/BUILD.bazel b/src/stirling/e2e_tests/BUILD.bazel index eac123792ae..568d0776342 100644 --- a/src/stirling/e2e_tests/BUILD.bazel +++ b/src/stirling/e2e_tests/BUILD.bazel @@ -88,14 +88,14 @@ pl_sh_bpf_test( srcs = ["stirling_wrapper_bpf_test.sh"], args = [ "$(location //src/stirling/binaries:stirling_wrapper)", - "$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs)", - "$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_19_grpc_client)", + "$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_24_grpc_server_with_certs)", + "$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_24_grpc_client)", "-stirling_profiler_java_agent_libs %s" % agent_libs_arg, ], data = [ "//src/stirling/binaries:stirling_wrapper", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_19_grpc_client", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs", + "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_24_grpc_client", + "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_24_grpc_server_with_certs", ] + agent_libs, # TODO(PL-1462): Uprobe attaching sometimes fails. flaky = True, @@ -132,13 +132,13 @@ pl_sh_bpf_test( srcs = ["stirling_wrapper_container_bpf_test.sh"], args = [ "$(location //src/stirling/binaries:stirling_wrapper_image.tar)", - "$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs)", - "$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_19_grpc_client)", + "$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_24_grpc_server_with_certs)", + "$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_24_grpc_client)", ], data = [ "//src/stirling/binaries:stirling_wrapper_image.tar", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_19_grpc_client", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs", + "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_24_grpc_client", + "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_24_grpc_server_with_certs", ], flaky = True, tags = [ diff --git a/src/stirling/obj_tools/BUILD.bazel b/src/stirling/obj_tools/BUILD.bazel index 03e9bccb7f5..b27b7002ba8 100644 --- a/src/stirling/obj_tools/BUILD.bazel +++ b/src/stirling/obj_tools/BUILD.bazel @@ -52,8 +52,8 @@ pl_cc_test( "//src/stirling/obj_tools/testdata/cc:stripped_exe", "//src/stirling/obj_tools/testdata/cc:test_exe_debug_target", "//src/stirling/obj_tools/testdata/cc:test_exe_debuglink_target", - "//src/stirling/obj_tools/testdata/go:test_go_1_19_binary", - "//src/stirling/obj_tools/testdata/go:test_go_1_19_nm_output", + "//src/stirling/obj_tools/testdata/go:test_go_1_24_binary", + "//src/stirling/obj_tools/testdata/go:test_go_1_24_nm_output", ], deps = [ ":cc_library", @@ -89,7 +89,7 @@ pl_cc_test( data = [ "//src/stirling/obj_tools/testdata/cc:test_exe_fixture", "//src/stirling/obj_tools/testdata/go:test_binaries", - "//src/stirling/testing/demo_apps/go_grpc_tls_pl/server:golang_1_19_grpc_tls_server_binary", + "//src/stirling/testing/demo_apps/go_grpc_tls_pl/server:golang_1_24_grpc_tls_server_binary", ], deps = [ ":cc_library", @@ -137,8 +137,7 @@ pl_cc_test( "//src/stirling/obj_tools/testdata/go:test_binaries", "//src/stirling/obj_tools/testdata/go:test_buildinfo_with_mods", "//src/stirling/obj_tools/testdata/go:test_go_1_17_binary", - "//src/stirling/obj_tools/testdata/go:test_go_1_19_binary", - "//src/stirling/obj_tools/testdata/go:test_go_1_21_binary", + "//src/stirling/obj_tools/testdata/go:test_go_1_24_binary", ], deps = [ ":cc_library", @@ -185,7 +184,7 @@ pl_cc_binary( name = "dwarf_reader_benchmark", testonly = 1, srcs = ["dwarf_reader_benchmark.cc"], - data = ["//src/stirling/testing/demo_apps/go_grpc_tls_pl/server:golang_1_19_grpc_tls_server_binary"], + data = ["//src/stirling/testing/demo_apps/go_grpc_tls_pl/server:golang_1_24_grpc_tls_server_binary"], deps = [ ":cc_library", "//src/common/testing:cc_library", diff --git a/src/stirling/obj_tools/dwarf_reader_benchmark.cc b/src/stirling/obj_tools/dwarf_reader_benchmark.cc index 7e74d32f6bd..dcd987ae363 100644 --- a/src/stirling/obj_tools/dwarf_reader_benchmark.cc +++ b/src/stirling/obj_tools/dwarf_reader_benchmark.cc @@ -26,8 +26,8 @@ using px::stirling::obj_tools::DwarfReader; using px::testing::BazelRunfilePath; constexpr std::string_view kBinary = - "src/stirling/testing/demo_apps/go_grpc_tls_pl/server/golang_1_19_grpc_tls_server_binary_/" - "golang_1_19_grpc_tls_server_binary"; + "src/stirling/testing/demo_apps/go_grpc_tls_pl/server/golang_1_24_grpc_tls_server_binary_/" + "golang_1_24_grpc_tls_server_binary"; struct SymAddrs { // Members of net/http.http2serverConn. diff --git a/src/stirling/obj_tools/dwarf_reader_test.cc b/src/stirling/obj_tools/dwarf_reader_test.cc index 1b4a6fd3d89..6fd9f93dd16 100644 --- a/src/stirling/obj_tools/dwarf_reader_test.cc +++ b/src/stirling/obj_tools/dwarf_reader_test.cc @@ -24,34 +24,19 @@ #include "src/common/testing/testing.h" #include "src/stirling/utils/detect_application.h" -constexpr std::string_view kTestGo1_17Binary = - "src/stirling/obj_tools/testdata/go/test_go_1_17_binary"; -constexpr std::string_view kTestGo1_18Binary = - "src/stirling/obj_tools/testdata/go/test_go_1_18_binary"; -constexpr std::string_view kTestGo1_19Binary = - "src/stirling/obj_tools/testdata/go/test_go_1_19_binary"; -constexpr std::string_view kTestGo1_20Binary = - "src/stirling/obj_tools/testdata/go/test_go_1_20_binary"; -constexpr std::string_view kTestGo1_21Binary = - "src/stirling/obj_tools/testdata/go/test_go_1_21_binary"; -constexpr std::string_view kTestGo1_22Binary = - "src/stirling/obj_tools/testdata/go/test_go_1_22_binary"; constexpr std::string_view kTestGo1_23Binary = "src/stirling/obj_tools/testdata/go/test_go_1_23_binary"; +constexpr std::string_view kTestGo1_24Binary = + "src/stirling/obj_tools/testdata/go/test_go_1_23_binary"; constexpr std::string_view kGoGRPCServer = - "src/stirling/testing/demo_apps/go_grpc_tls_pl/server/golang_1_19_grpc_tls_server_binary"; + "src/stirling/testing/demo_apps/go_grpc_tls_pl/server/golang_1_24_grpc_tls_server_binary"; constexpr std::string_view kCppBinary = "src/stirling/obj_tools/testdata/cc/test_exe_/test_exe"; constexpr std::string_view kGoBinaryUnconventional = "src/stirling/obj_tools/testdata/go/sockshop_payments_service"; const auto kCPPBinaryPath = px::testing::BazelRunfilePath(kCppBinary); -const auto kGo1_17BinaryPath = px::testing::BazelRunfilePath(kTestGo1_17Binary); -const auto kGo1_18BinaryPath = px::testing::BazelRunfilePath(kTestGo1_18Binary); -const auto kGo1_19BinaryPath = px::testing::BazelRunfilePath(kTestGo1_19Binary); -const auto kGo1_20BinaryPath = px::testing::BazelRunfilePath(kTestGo1_20Binary); -const auto kGo1_21BinaryPath = px::testing::BazelRunfilePath(kTestGo1_21Binary); -const auto kGo1_22BinaryPath = px::testing::BazelRunfilePath(kTestGo1_22Binary); const auto kGo1_23BinaryPath = px::testing::BazelRunfilePath(kTestGo1_23Binary); +const auto kGo1_24BinaryPath = px::testing::BazelRunfilePath(kTestGo1_24Binary); const auto kGoServerBinaryPath = px::testing::BazelRunfilePath(kGoGRPCServer); const auto kGoBinaryUnconventionalPath = px::testing::BazelRunfilePath(kGoBinaryUnconventional); @@ -578,20 +563,10 @@ INSTANTIATE_TEST_SUITE_P(CppDwarfReaderParameterizedTest, CppDwarfReaderTest, DwarfReaderTestParam{kCPPBinaryPath, false})); INSTANTIATE_TEST_SUITE_P(GolangDwarfReaderParameterizedTest, GolangDwarfReaderTest, - ::testing::Values(DwarfReaderTestParam{kGo1_17BinaryPath, true}, - DwarfReaderTestParam{kGo1_17BinaryPath, false}, - DwarfReaderTestParam{kGo1_18BinaryPath, true}, - DwarfReaderTestParam{kGo1_18BinaryPath, false}, - DwarfReaderTestParam{kGo1_19BinaryPath, true}, - DwarfReaderTestParam{kGo1_19BinaryPath, false}, - DwarfReaderTestParam{kGo1_20BinaryPath, true}, - DwarfReaderTestParam{kGo1_20BinaryPath, false}, - DwarfReaderTestParam{kGo1_21BinaryPath, true}, - DwarfReaderTestParam{kGo1_21BinaryPath, false}, - DwarfReaderTestParam{kGo1_22BinaryPath, true}, - DwarfReaderTestParam{kGo1_22BinaryPath, false}, - DwarfReaderTestParam{kGo1_23BinaryPath, true}, - DwarfReaderTestParam{kGo1_23BinaryPath, false})); + ::testing::Values(DwarfReaderTestParam{kGo1_23BinaryPath, true}, + DwarfReaderTestParam{kGo1_23BinaryPath, false}, + DwarfReaderTestParam{kGo1_24BinaryPath, true}, + DwarfReaderTestParam{kGo1_24BinaryPath, false})); INSTANTIATE_TEST_SUITE_P(GolangDwarfReaderParameterizedIndexTest, GolangDwarfReaderIndexTest, ::testing::Values(true, false)); diff --git a/src/stirling/obj_tools/elf_reader_test.cc b/src/stirling/obj_tools/elf_reader_test.cc index 3703d1187ce..31c47c57146 100644 --- a/src/stirling/obj_tools/elf_reader_test.cc +++ b/src/stirling/obj_tools/elf_reader_test.cc @@ -303,9 +303,9 @@ TEST(ElfReaderTest, FuncByteCode) { TEST(ElfReaderTest, GolangAppRuntimeBuildVersion) { const std::string kPath = - px::testing::BazelRunfilePath("src/stirling/obj_tools/testdata/go/test_go_1_19_binary"); + px::testing::BazelRunfilePath("src/stirling/obj_tools/testdata/go/test_go_1_24_binary"); const std::string kGoBinNmOutput = - px::testing::BazelRunfilePath("src/stirling/obj_tools/testdata/go/test_go_1_19_nm_output"); + px::testing::BazelRunfilePath("src/stirling/obj_tools/testdata/go/test_go_1_24_nm_output"); ASSERT_OK_AND_ASSIGN(std::unique_ptr elf_reader, ElfReader::Create(kPath)); ASSERT_OK_AND_ASSIGN(ElfReader::SymbolInfo symbol, elf_reader->SearchTheOnlySymbol("runtime.buildVersion")); diff --git a/src/stirling/obj_tools/go_syms_test.cc b/src/stirling/obj_tools/go_syms_test.cc index e086033b850..bf119eee990 100644 --- a/src/stirling/obj_tools/go_syms_test.cc +++ b/src/stirling/obj_tools/go_syms_test.cc @@ -46,9 +46,9 @@ constexpr std::string_view kTestGoWithModulesBinaryPath = "src/stirling/obj_tools/testdata/go/test_buildinfo_with_mods"; constexpr std::string_view kTestGoBinaryPath = - "src/stirling/obj_tools/testdata/go/test_go_1_19_binary"; -constexpr std::string_view kTestGo1_21BinaryPath = - "src/stirling/obj_tools/testdata/go/test_go_1_21_binary"; + "src/stirling/obj_tools/testdata/go/test_go_1_24_binary"; +constexpr std::string_view kTestGo1_24BinaryPath = + "src/stirling/obj_tools/testdata/go/test_go_1_24_binary"; // The "endian agnostic" case refers to where the Go version data is varint encoded // directly within the buildinfo header. See the following reference for more details. @@ -58,7 +58,7 @@ TEST(ReadGoBuildInfoTest, BuildinfoEndianAgnostic) { ASSERT_OK_AND_ASSIGN(std::unique_ptr elf_reader, ElfReader::Create(kPath)); ASSERT_OK_AND_ASSIGN(auto pair, ReadGoBuildInfo(elf_reader.get())); auto version = pair.first; - EXPECT_THAT(version, StrEq("1.19.13")); + EXPECT_THAT(version, StrEq("1.24.4")); } TEST(ReadGoBuildInfoTest, BuildinfoLittleEndian) { @@ -222,7 +222,7 @@ INSTANTIATE_TEST_SUITE_P( ElfGolangItableTestSuite, ElfGolangItableTest, ::testing::Values( std::make_tuple( - kTestGo1_21BinaryPath, + kTestGo1_24BinaryPath, UnorderedElementsAre( Pair("fmt.State", UnorderedElementsAre(Field(&IntfImplTypeInfo::type_name, "*fmt.pp"))), @@ -238,23 +238,23 @@ INSTANTIATE_TEST_SUITE_P( Field(&IntfImplTypeInfo::type_name, "*errors.errorString"), Field(&IntfImplTypeInfo::type_name, "syscall.Errno"), Field(&IntfImplTypeInfo::type_name, "*io/fs.PathError"), + Field(&IntfImplTypeInfo::type_name, "*os.SyscallError"), Field(&IntfImplTypeInfo::type_name, "runtime.errorString"), + Field(&IntfImplTypeInfo::type_name, "runtime.plainError"), Field(&IntfImplTypeInfo::type_name, "internal/poll.errNetClosing"), Field(&IntfImplTypeInfo::type_name, "*internal/poll.DeadlineExceededError"), Field(&IntfImplTypeInfo::type_name, "*internal/bisect.parseError"))), Pair("io.Writer", UnorderedElementsAre(Field(&IntfImplTypeInfo::type_name, "*os.File"))), - Pair("sort.Interface", UnorderedElementsAre(Field(&IntfImplTypeInfo::type_name, - "*internal/fmtsort.SortedMap"))), Pair("reflect.Type", UnorderedElementsAre(Field(&IntfImplTypeInfo::type_name, "*reflect.rtype"))), Pair("math/rand.Source64", UnorderedElementsAre(Field(&IntfImplTypeInfo::type_name, - "*math/rand.fastSource"))), + "*math/rand.runtimeSource"))), Pair("math/rand.Source", UnorderedElementsAre(Field(&IntfImplTypeInfo::type_name, "*math/rand.lockedSource"), Field(&IntfImplTypeInfo::type_name, - "*math/rand.fastSource"))))), + "*math/rand.runtimeSource"))))), std::make_tuple( kTestGoBinaryPath, UnorderedElementsAre( @@ -263,20 +263,28 @@ INSTANTIATE_TEST_SUITE_P( Field(&IntfImplTypeInfo::type_name, "main.IntStruct"), Field(&IntfImplTypeInfo::type_name, "*errors.errorString"), Field(&IntfImplTypeInfo::type_name, "*io/fs.PathError"), + Field(&IntfImplTypeInfo::type_name, "*os.SyscallError"), + Field(&IntfImplTypeInfo::type_name, "runtime.errorString"), + Field(&IntfImplTypeInfo::type_name, "runtime.plainError"), + Field(&IntfImplTypeInfo::type_name, "syscall.Errno"), + Field(&IntfImplTypeInfo::type_name, "internal/poll.errNetClosing"), Field(&IntfImplTypeInfo::type_name, "*internal/poll.DeadlineExceededError"), - Field(&IntfImplTypeInfo::type_name, "internal/poll.errNetClosing"), - Field(&IntfImplTypeInfo::type_name, "runtime.errorString"), - Field(&IntfImplTypeInfo::type_name, "syscall.Errno"))), - Pair("sort.Interface", UnorderedElementsAre(Field(&IntfImplTypeInfo::type_name, - "*internal/fmtsort.SortedMap"))), + Field(&IntfImplTypeInfo::type_name, "*internal/bisect.parseError"))), Pair("math/rand.Source", UnorderedElementsAre(Field(&IntfImplTypeInfo::type_name, - "*math/rand.lockedSource"))), + "*math/rand.lockedSource"), + Field(&IntfImplTypeInfo::type_name, + "*math/rand.runtimeSource"))), + Pair("math/rand.Source64", UnorderedElementsAre(Field(&IntfImplTypeInfo::type_name, + "*math/rand.runtimeSource"))), + Pair("internal/bisect.Writer", + UnorderedElementsAre(Field(&IntfImplTypeInfo::type_name, + "*internal/godebug.runtimeStderr"))), Pair("io.Writer", UnorderedElementsAre(Field(&IntfImplTypeInfo::type_name, "*os.File"))), Pair("internal/reflectlite.Type", UnorderedElementsAre(Field(&IntfImplTypeInfo::type_name, - "*internal/reflectlite.rtype"))), + "internal/reflectlite.rtype"))), Pair("reflect.Type", UnorderedElementsAre(Field(&IntfImplTypeInfo::type_name, "*reflect.rtype"))), Pair("fmt.State", diff --git a/src/stirling/obj_tools/testdata/go/BUILD.bazel b/src/stirling/obj_tools/testdata/go/BUILD.bazel index 8ec81482acc..92d2299e515 100644 --- a/src/stirling/obj_tools/testdata/go/BUILD.bazel +++ b/src/stirling/obj_tools/testdata/go/BUILD.bazel @@ -48,10 +48,10 @@ pl_go_binary( ] genrule( - name = "test_go_1_19_nm_output_target", - srcs = [":test_go_1_19_binary"], - outs = ["test_go_1_19_nm_output"], - cmd = "$(NM) $(location :test_go_1_19_binary) > $(location test_go_1_19_nm_output)", + name = "test_go_1_24_nm_output_target", + srcs = [":test_go_1_24_binary"], + outs = ["test_go_1_24_nm_output"], + cmd = "$(NM) $(location :test_go_1_24_binary) > $(location test_go_1_24_nm_output)", toolchains = ["@bazel_tools//tools/cpp:current_cc_toolchain"], ) @@ -81,11 +81,7 @@ filegroup( # TODO(ddelnano): rules_go doesn't support populating .buildinfo with dependency information (https://github.com/bazel-contrib/rules_go/issues/3090). # Once this is supported, test_buildinfo_with_mods should be replaced with a bazel built binary. "test_buildinfo_with_mods", - ":test_go_1_18_binary", - ":test_go_1_19_binary", - ":test_go_1_20_binary", - ":test_go_1_21_binary", - ":test_go_1_22_binary", ":test_go_1_23_binary", + ":test_go_1_24_binary", ], ) diff --git a/src/stirling/source_connectors/dynamic_bpftrace/BUILD.bazel b/src/stirling/source_connectors/dynamic_bpftrace/BUILD.bazel index e124707f23f..5a45f5ad839 100644 --- a/src/stirling/source_connectors/dynamic_bpftrace/BUILD.bazel +++ b/src/stirling/source_connectors/dynamic_bpftrace/BUILD.bazel @@ -38,8 +38,8 @@ pl_cc_bpf_test( name = "dynamic_bpftrace_connector_bpf_test", srcs = ["dynamic_bpftrace_connector_bpf_test.cc"], data = [ - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_18_grpc_server_with_certs", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs", + "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_23_grpc_server_with_certs", + "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_24_grpc_server_with_certs", ], tags = [ "cpu:16", diff --git a/src/stirling/source_connectors/dynamic_bpftrace/dynamic_bpftrace_connector_bpf_test.cc b/src/stirling/source_connectors/dynamic_bpftrace/dynamic_bpftrace_connector_bpf_test.cc index a387ed668a1..31a978177c2 100644 --- a/src/stirling/source_connectors/dynamic_bpftrace/dynamic_bpftrace_connector_bpf_test.cc +++ b/src/stirling/source_connectors/dynamic_bpftrace/dynamic_bpftrace_connector_bpf_test.cc @@ -462,23 +462,23 @@ TEST(DynamicBPFTraceConnectorTest, BPFTraceCheckPrintfsError) { HasSubstr("All printf statements must have exactly the same format string"))); } -constexpr std::string_view kServerPath_1_18 = +constexpr std::string_view kServerPath_1_23 = "src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server/" - "golang_1_18_grpc_server"; -constexpr std::string_view kServerPath_1_19 = + "golang_1_23_grpc_server"; +constexpr std::string_view kServerPath_1_24 = "src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server/" - "golang_1_19_grpc_server"; + "golang_1_24_grpc_server"; TEST(DynamicBPFTraceConnectorTest, InsertUProbeTargetObjPaths) { - std::string go1_18_binary_path = px::testing::BazelRunfilePath(kServerPath_1_18).string(); - std::string go1_19_binary_path = px::testing::BazelRunfilePath(kServerPath_1_19).string(); + std::string go1_23_binary_path = px::testing::BazelRunfilePath(kServerPath_1_23).string(); + std::string go1_24_binary_path = px::testing::BazelRunfilePath(kServerPath_1_24).string(); - ASSERT_TRUE(fs::Exists(go1_18_binary_path)); - ASSERT_TRUE(fs::Exists(go1_19_binary_path)); + ASSERT_TRUE(fs::Exists(go1_23_binary_path)); + ASSERT_TRUE(fs::Exists(go1_24_binary_path)); DeploymentSpec spec; - spec.mutable_path_list()->add_paths(go1_18_binary_path); - spec.mutable_path_list()->add_paths(go1_19_binary_path); + spec.mutable_path_list()->add_paths(go1_23_binary_path); + spec.mutable_path_list()->add_paths(go1_24_binary_path); std::string uprobe_script = "// Deploys uprobes to trace http2 traffic.\n" @@ -489,16 +489,16 @@ TEST(DynamicBPFTraceConnectorTest, InsertUProbeTargetObjPaths) { InsertUprobeTargetObjPaths(spec, &uprobe_script); EXPECT_EQ( uprobe_script, - absl::StrCat("// Deploys uprobes to trace http2 traffic.\n", "uprobe:", go1_18_binary_path, + absl::StrCat("// Deploys uprobes to trace http2 traffic.\n", "uprobe:", go1_23_binary_path, ":\"golang.org/x/net/http2.(*Framer).WriteDataPadded\",\n" "uprobe:", - go1_19_binary_path, + go1_24_binary_path, ":\"golang.org/x/net/http2.(*Framer).WriteDataPadded\"" "{ printf(\"stream_id: %d, end_stream: %d\", arg0, arg1); }\n", - "uretprobe:", go1_18_binary_path, + "uretprobe:", go1_23_binary_path, ":\"golang.org/x/net/http2.(*Framer).WriteDataPadded\",\n" "uretprobe:", - go1_19_binary_path, + go1_24_binary_path, ":\"golang.org/x/net/http2.(*Framer).WriteDataPadded\"" "{ printf(\"retval: %d\", retval); }")); } diff --git a/src/stirling/source_connectors/dynamic_tracer/BUILD.bazel b/src/stirling/source_connectors/dynamic_tracer/BUILD.bazel index 8170c45496f..1d47643b4ea 100644 --- a/src/stirling/source_connectors/dynamic_tracer/BUILD.bazel +++ b/src/stirling/source_connectors/dynamic_tracer/BUILD.bazel @@ -48,12 +48,10 @@ pl_cc_bpf_test( timeout = "moderate", srcs = ["dynamic_trace_bpf_test.cc"], data = [ - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_21_grpc_client", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_22_grpc_client", "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_23_grpc_client", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_21_grpc_server_with_certs", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_22_grpc_server_with_certs", + "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_24_grpc_client", "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_23_grpc_server_with_certs", + "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_24_grpc_server_with_certs", ], tags = [ "cpu:16", @@ -73,9 +71,8 @@ pl_cc_bpf_test( srcs = ["stirling_dt_bpf_test.cc"], data = [ "//src/stirling/obj_tools/testdata/cc:test_exe", - "//src/stirling/obj_tools/testdata/go:test_go_1_21_binary", - "//src/stirling/obj_tools/testdata/go:test_go_1_22_binary", "//src/stirling/obj_tools/testdata/go:test_go_1_23_binary", + "//src/stirling/obj_tools/testdata/go:test_go_1_24_binary", "//src/stirling/testing/dns:dns_hammer", "//src/stirling/testing/dns:dns_hammer_image.tar", ], diff --git a/src/stirling/source_connectors/dynamic_tracer/dynamic_trace_bpf_test.cc b/src/stirling/source_connectors/dynamic_tracer/dynamic_trace_bpf_test.cc index 9dd7dcc305b..801847b3958 100644 --- a/src/stirling/source_connectors/dynamic_tracer/dynamic_trace_bpf_test.cc +++ b/src/stirling/source_connectors/dynamic_tracer/dynamic_trace_bpf_test.cc @@ -30,20 +30,6 @@ #include "src/stirling/proto/stirling.pb.h" -constexpr std::string_view kGo1_21_ClientPath = - "src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client/" - "golang_1_21_grpc_client"; -constexpr std::string_view kGo1_21_ServerPath = - "src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server/" - "golang_1_21_grpc_server"; - -constexpr std::string_view kGo1_22_ClientPath = - "src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client/" - "golang_1_22_grpc_client"; -constexpr std::string_view kGo1_22_ServerPath = - "src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server/" - "golang_1_22_grpc_server"; - constexpr std::string_view kGo1_23_ClientPath = "src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client/" "golang_1_23_grpc_client"; @@ -51,6 +37,13 @@ constexpr std::string_view kGo1_23_ServerPath = "src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server/" "golang_1_23_grpc_server"; +constexpr std::string_view kGo1_24_ClientPath = + "src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client/" + "golang_1_24_grpc_client"; +constexpr std::string_view kGo1_24_ServerPath = + "src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server/" + "golang_1_24_grpc_server"; + DECLARE_bool(debug_dt_pipeline); namespace px { namespace stirling { @@ -129,9 +122,8 @@ class GoHTTPDynamicTraceTest }; INSTANTIATE_TEST_SUITE_P(GoHTTPDynamicTraceTestInstances, GoHTTPDynamicTraceTest, - ::testing::Values(std::make_pair(kGo1_21_ClientPath, kGo1_21_ServerPath), - std::make_pair(kGo1_22_ClientPath, kGo1_22_ServerPath), - std::make_pair(kGo1_23_ClientPath, kGo1_23_ServerPath))); + ::testing::Values(std::make_pair(kGo1_23_ClientPath, kGo1_23_ServerPath), + std::make_pair(kGo1_24_ClientPath, kGo1_24_ServerPath))); constexpr char kGRPCTraceProgram[] = R"( tracepoints { diff --git a/src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/BUILD.bazel b/src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/BUILD.bazel index 998b1395468..957b9a776c5 100644 --- a/src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/BUILD.bazel +++ b/src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/BUILD.bazel @@ -45,7 +45,7 @@ pl_cc_test( name = "code_gen_test", srcs = ["code_gen_test.cc"], data = [ - "//src/stirling/obj_tools/testdata/go:test_go_1_21_binary", + "//src/stirling/obj_tools/testdata/go:test_go_1_24_binary", ], deps = [ ":cc_library", @@ -57,7 +57,7 @@ pl_cc_test( srcs = ["dwarvifier_test.cc"], data = [ "//src/stirling/obj_tools/testdata/cc:test_exe", - "//src/stirling/obj_tools/testdata/go:test_go_1_21_binary", + "//src/stirling/obj_tools/testdata/go:test_go_1_24_binary", ], deps = [ ":cc_library", @@ -68,7 +68,7 @@ pl_cc_test( name = "probe_transformer_test", srcs = ["probe_transformer_test.cc"], data = [ - "//src/stirling/obj_tools/testdata/go:test_go_1_21_binary", + "//src/stirling/obj_tools/testdata/go:test_go_1_24_binary", ], deps = [ ":cc_library", @@ -80,7 +80,7 @@ pl_cc_test( name = "autogen_test", srcs = ["autogen_test.cc"], data = [ - "//src/stirling/obj_tools/testdata/go:test_go_1_21_binary", + "//src/stirling/obj_tools/testdata/go:test_go_1_24_binary", ], deps = [ ":cc_library", @@ -92,9 +92,9 @@ pl_cc_test( name = "dynamic_tracer_test", srcs = ["dynamic_tracer_test.cc"], data = [ - "//src/stirling/obj_tools/testdata/go:test_go_1_21_binary", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_21_grpc_client", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_21_grpc_server_with_certs", + "//src/stirling/obj_tools/testdata/go:test_go_1_24_binary", + "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_24_grpc_client", + "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_24_grpc_server_with_certs", ], tags = [ "exclusive", diff --git a/src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/autogen_test.cc b/src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/autogen_test.cc index dfc8833e45d..b0fcf0f0f30 100644 --- a/src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/autogen_test.cc +++ b/src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/autogen_test.cc @@ -22,7 +22,7 @@ #include "src/common/testing/testing.h" #include "src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/autogen.h" -constexpr std::string_view kBinaryPath = "src/stirling/obj_tools/testdata/go/test_go_1_21_binary"; +constexpr std::string_view kBinaryPath = "src/stirling/obj_tools/testdata/go/test_go_1_24_binary"; namespace px { namespace stirling { diff --git a/src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/dwarvifier_test.cc b/src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/dwarvifier_test.cc index 9aaf0032cf7..97a4f670df0 100644 --- a/src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/dwarvifier_test.cc +++ b/src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/dwarvifier_test.cc @@ -22,7 +22,7 @@ #include "src/common/testing/testing.h" #include "src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/dwarvifier.h" -constexpr std::string_view kBinaryPath = "src/stirling/obj_tools/testdata/go/test_go_1_21_binary"; +constexpr std::string_view kBinaryPath = "src/stirling/obj_tools/testdata/go/test_go_1_24_binary"; constexpr std::string_view kCPPBinaryPath = "src/stirling/obj_tools/testdata/cc/test_exe/test_exe"; namespace px { @@ -1721,6 +1721,19 @@ structs { path: "/len" } } + blob_decoders { + entries { + size: 8 + type: VOID_POINTER + path: "/str" + } + entries { + offset: 8 + size: 8 + type: INT + path: "/len" + } + } blob_decoders { } } @@ -1807,21 +1820,28 @@ probes { scalar_var { name: "main__IntStruct_sym_addr1" type: UINT64 - constant: "4989632" + constant: "5103904" } } vars { scalar_var { name: "runtime__errorString_sym_addr2" type: UINT64 - constant: "4989824" + constant: "5104192" + } + } + vars { + scalar_var { + name: "runtime__plainError_sym_addr3" + type: UINT64 + constant: "5104224" } } vars { scalar_var { - name: "internal___poll__errNetClosing_sym_addr3" + name: "internal___poll__errNetClosing_sym_addr4" type: UINT64 - constant: "4989856" + constant: "5104256" } } vars { @@ -1896,7 +1916,7 @@ probes { cond { op: EQUAL vars: "retval_intf_tab" - vars: "internal___poll__errNetClosing_sym_addr3" + vars: "runtime__plainError_sym_addr3" } vars { scalar_var { @@ -1911,6 +1931,25 @@ probes { } } } + cond_blocks { + cond { + op: EQUAL + vars: "retval_intf_tab" + vars: "internal___poll__errNetClosing_sym_addr4" + } + vars { + scalar_var { + name: "retval" + type: STRUCT_BLOB + memory { + base: "retval_intf_data" + size: 16 + decoder_idx: 4 + op: ASSIGN_ONLY + } + } + } + } } language: GOLANG arrays { diff --git a/src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/dynamic_tracer_test.cc b/src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/dynamic_tracer_test.cc index 4d27a922c95..d1815ca6048 100644 --- a/src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/dynamic_tracer_test.cc +++ b/src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/dynamic_tracer_test.cc @@ -26,7 +26,7 @@ #include "src/common/testing/testing.h" #include "src/stirling/testing/common.h" -constexpr std::string_view kBinaryPath = "src/stirling/obj_tools/testdata/go/test_go_1_21_binary"; +constexpr std::string_view kBinaryPath = "src/stirling/obj_tools/testdata/go/test_go_1_24_binary"; namespace px { namespace stirling { @@ -45,7 +45,7 @@ using ::testing::SizeIs; constexpr char kClientPath[] = "src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client/" - "golang_1_21_grpc_client"; + "golang_1_24_grpc_client"; constexpr char kClientPathExpected[] = "src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client/" @@ -53,7 +53,7 @@ constexpr char kClientPathExpected[] = constexpr char kServerPath[] = "src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server/" - "golang_1_21_grpc_server"; + "golang_1_24_grpc_server"; constexpr char kServerPathExpected[] = "src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server/" @@ -389,7 +389,7 @@ const std::vector kExpectedBCC = { "void* goid_X_;", "bpf_probe_read(&goid_X_, sizeof(void*), parm__ + 0);", "uint64_t goid;", - "bpf_probe_read(&goid, sizeof(uint64_t), goid_X_ + 152);", + "bpf_probe_read(&goid, sizeof(uint64_t), goid_X_ + 160);", "uint32_t newval;", "bpf_probe_read(&newval, sizeof(uint32_t), parm__ + 16);", "struct pid_goid_map_value_t pid_goid_map_value = {};", @@ -476,7 +476,7 @@ TEST(DynamicTracerTest, Compile) { const auto& spec = bcc_program.uprobe_specs[0]; - EXPECT_THAT(spec, Field(&UProbeSpec::binary_path, ::testing::EndsWith("test_go_1_21_binary"))); + EXPECT_THAT(spec, Field(&UProbeSpec::binary_path, ::testing::EndsWith("test_go_1_24_binary"))); EXPECT_THAT(spec, Field(&UProbeSpec::symbol, "runtime.casgstatus")); EXPECT_THAT(spec, Field(&UProbeSpec::attach_type, bpf_tools::BPFProbeAttachType::kEntry)); EXPECT_THAT(spec, Field(&UProbeSpec::probe_fn, "probe_entry_runtime_casgstatus")); diff --git a/src/stirling/source_connectors/dynamic_tracer/stirling_dt_bpf_test.cc b/src/stirling/source_connectors/dynamic_tracer/stirling_dt_bpf_test.cc index a7a6c2d1760..b21ee70612d 100644 --- a/src/stirling/source_connectors/dynamic_tracer/stirling_dt_bpf_test.cc +++ b/src/stirling/source_connectors/dynamic_tracer/stirling_dt_bpf_test.cc @@ -274,10 +274,8 @@ TEST_F(DynamicTraceAPITest, InvalidReference) { // Dynamic Trace Golang tests //----------------------------------------------------------------------------- -constexpr std::string_view kGo1_21BinaryPath = - "src/stirling/obj_tools/testdata/go/test_go_1_21_binary"; -const std::string_view kGo1_22BinaryPath = "src/stirling/obj_tools/testdata/go/test_go_1_22_binary"; const std::string_view kGo1_23BinaryPath = "src/stirling/obj_tools/testdata/go/test_go_1_23_binary"; +const std::string_view kGo1_24BinaryPath = "src/stirling/obj_tools/testdata/go/test_go_1_24_binary"; struct DynamicTraceGolangTestCase { const std::filesystem::path binary_path; @@ -294,9 +292,8 @@ class DynamicTraceGolangTest : public StirlingDynamicTraceBPFTest, }; INSTANTIATE_TEST_SUITE_P(DynamicTraceGolangTestInstances, DynamicTraceGolangTest, - ::testing::Values(DynamicTraceGolangTestCase{kGo1_21BinaryPath}, - DynamicTraceGolangTestCase{kGo1_22BinaryPath}, - DynamicTraceGolangTestCase{kGo1_23BinaryPath})); + ::testing::Values(DynamicTraceGolangTestCase{kGo1_23BinaryPath}, + DynamicTraceGolangTestCase{kGo1_24BinaryPath})); TEST_P(DynamicTraceGolangTest, TraceLatencyOnly) { BinaryRunner trace_target; @@ -581,22 +578,16 @@ tracepoints { INSTANTIATE_TEST_SUITE_P( NilAndNonNilError, ReturnedErrorInterfaceTest, ::testing::Values( - ReturnedErrorInterfaceTestCase{kGo1_21BinaryPath, - absl::Substitute(kProgramTxtPBTmpl, "main.ReturnError"), - "{\"X\":3,\"Y\":4}"}, - ReturnedErrorInterfaceTestCase{kGo1_21BinaryPath, - absl::Substitute(kProgramTxtPBTmpl, "main.ReturnNilError"), - "{\"tab\":0,\"data\":0}"}, - ReturnedErrorInterfaceTestCase{kGo1_22BinaryPath, + ReturnedErrorInterfaceTestCase{kGo1_23BinaryPath, absl::Substitute(kProgramTxtPBTmpl, "main.ReturnError"), "{\"X\":3,\"Y\":4}"}, - ReturnedErrorInterfaceTestCase{kGo1_22BinaryPath, + ReturnedErrorInterfaceTestCase{kGo1_23BinaryPath, absl::Substitute(kProgramTxtPBTmpl, "main.ReturnNilError"), "{\"tab\":0,\"data\":0}"}, - ReturnedErrorInterfaceTestCase{kGo1_23BinaryPath, + ReturnedErrorInterfaceTestCase{kGo1_24BinaryPath, absl::Substitute(kProgramTxtPBTmpl, "main.ReturnError"), "{\"X\":3,\"Y\":4}"}, - ReturnedErrorInterfaceTestCase{kGo1_23BinaryPath, + ReturnedErrorInterfaceTestCase{kGo1_24BinaryPath, absl::Substitute(kProgramTxtPBTmpl, "main.ReturnNilError"), "{\"tab\":0,\"data\":0}"})); @@ -681,12 +672,10 @@ TEST_P(DynamicTraceGolangTestWithParam, TraceByteArray) { INSTANTIATE_TEST_SUITE_P( GolangByteArrayTests, DynamicTraceGolangTestWithParam, - ::testing::Values(TestParam{kGo1_21BinaryPath, "main.BytesToHex", "Bytes"}, - TestParam{kGo1_21BinaryPath, "main.Uint8ArrayToHex", "Uint8"}, - TestParam{kGo1_22BinaryPath, "main.BytesToHex", "Bytes"}, - TestParam{kGo1_22BinaryPath, "main.Uint8ArrayToHex", "Uint8"}, - TestParam{kGo1_23BinaryPath, "main.BytesToHex", "Bytes"}, - TestParam{kGo1_23BinaryPath, "main.Uint8ArrayToHex", "Uint8"})); + ::testing::Values(TestParam{kGo1_23BinaryPath, "main.BytesToHex", "Bytes"}, + TestParam{kGo1_23BinaryPath, "main.Uint8ArrayToHex", "Uint8"}, + TestParam{kGo1_24BinaryPath, "main.BytesToHex", "Bytes"}, + TestParam{kGo1_24BinaryPath, "main.Uint8ArrayToHex", "Uint8"})); //----------------------------------------------------------------------------- // Dynamic Trace C++ tests diff --git a/src/stirling/source_connectors/socket_tracer/BUILD.bazel b/src/stirling/source_connectors/socket_tracer/BUILD.bazel index 10d20e5e03f..47301fffdb5 100644 --- a/src/stirling/source_connectors/socket_tracer/BUILD.bazel +++ b/src/stirling/source_connectors/socket_tracer/BUILD.bazel @@ -304,19 +304,9 @@ pl_cc_bpf_test( timeout = "moderate", srcs = ["grpc_trace_bpf_test.cc"], data = [ - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_18_grpc_client", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_19_grpc_client", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_20_grpc_client", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_21_grpc_client", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_22_grpc_client", "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_23_grpc_client", "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_24_grpc_client", "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_boringcrypto_grpc_client", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_18_grpc_server_with_certs", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_20_grpc_server_with_certs", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_21_grpc_server_with_certs", - "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_22_grpc_server_with_certs", "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_23_grpc_server_with_certs", "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_24_grpc_server_with_certs", "//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_boringcrypto_grpc_server_with_certs", @@ -354,15 +344,10 @@ pl_cc_bpf_test( "//src/common/exec:cc_library", "//src/common/testing/test_utils:cc_library", "//src/stirling/source_connectors/socket_tracer/testing:cc_library", - "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_18_grpc_client_container", "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_18_grpc_server_container", - "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_19_grpc_client_container", "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_19_grpc_server_container", - "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_20_grpc_client_container", "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_20_grpc_server_container", - "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_21_grpc_client_container", "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_21_grpc_server_container", - "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_22_grpc_client_container", "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_22_grpc_server_container", "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_23_grpc_client_container", "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_23_grpc_server_container", @@ -578,15 +563,10 @@ pl_cc_bpf_test( "//src/common/exec:cc_library", "//src/common/testing/test_utils:cc_library", "//src/stirling/source_connectors/socket_tracer/testing:cc_library", - "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_18_tls_client_container", "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_18_tls_server_container", - "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_19_tls_client_container", "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_19_tls_server_container", - "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_20_tls_client_container", "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_20_tls_server_container", - "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_21_tls_client_container", "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_21_tls_server_container", - "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_22_tls_client_container", "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_22_tls_server_container", "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_23_tls_client_container", "//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_23_tls_server_container", diff --git a/src/stirling/source_connectors/socket_tracer/go_tls_trace_bpf_test.cc b/src/stirling/source_connectors/socket_tracer/go_tls_trace_bpf_test.cc index 7a9b535c5f5..9e3120763df 100644 --- a/src/stirling/source_connectors/socket_tracer/go_tls_trace_bpf_test.cc +++ b/src/stirling/source_connectors/socket_tracer/go_tls_trace_bpf_test.cc @@ -20,15 +20,10 @@ #include #include "src/common/testing/testing.h" -#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_18_tls_client_container.h" #include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_18_tls_server_container.h" -#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_tls_client_container.h" #include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_tls_server_container.h" -#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_tls_client_container.h" #include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_tls_server_container.h" -#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_tls_client_container.h" #include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_tls_server_container.h" -#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_tls_client_container.h" #include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_tls_server_container.h" #include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_23_tls_client_container.h" #include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_23_tls_server_container.h" @@ -75,27 +70,27 @@ class GoTLSTraceTest : public testing::SocketTraceBPFTestFixtureserver_.process_pid(); this->StartTransferDataThread(); // Run the client in the network of the server, so they can connect to each other. diff --git a/src/stirling/source_connectors/socket_tracer/grpc_trace_bpf_test.cc b/src/stirling/source_connectors/socket_tracer/grpc_trace_bpf_test.cc index 346e17b515a..f09029853fe 100644 --- a/src/stirling/source_connectors/socket_tracer/grpc_trace_bpf_test.cc +++ b/src/stirling/source_connectors/socket_tracer/grpc_trace_bpf_test.cc @@ -190,11 +190,6 @@ INSTANTIATE_TEST_SUITE_P(SecurityModeTest, GRPCTraceTest, ::testing::Values( // Did not enumerate all combinations, as they are independent based on // our knowledge, and to minimize test size to reduce flakiness. - TestParams{"1_18", false, true}, TestParams{"1_18", true, false}, - TestParams{"1_19", false, false}, TestParams{"1_19", true, true}, - TestParams{"1_20", true, true}, TestParams{"1_20", true, false}, - TestParams{"1_21", true, true}, TestParams{"1_21", true, false}, - TestParams{"1_22", true, true}, TestParams{"1_22", true, false}, TestParams{"1_23", true, true}, TestParams{"1_23", true, false}, TestParams{"1_24", true, true}, TestParams{"1_24", true, false}, TestParams{"boringcrypto", true, true})); diff --git a/src/stirling/source_connectors/socket_tracer/http2_trace_bpf_test.cc b/src/stirling/source_connectors/socket_tracer/http2_trace_bpf_test.cc index 36f9492a838..d98f4375118 100644 --- a/src/stirling/source_connectors/socket_tracer/http2_trace_bpf_test.cc +++ b/src/stirling/source_connectors/socket_tracer/http2_trace_bpf_test.cc @@ -21,15 +21,10 @@ #include "src/common/exec/subprocess.h" #include "src/stirling/core/output.h" -#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_18_grpc_client_container.h" #include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_18_grpc_server_container.h" -#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_grpc_client_container.h" #include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_grpc_server_container.h" -#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_grpc_client_container.h" #include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_grpc_server_container.h" -#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_grpc_client_container.h" #include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_grpc_server_container.h" -#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_grpc_client_container.h" #include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_grpc_server_container.h" #include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_23_grpc_client_container.h" #include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_23_grpc_server_container.h" @@ -79,27 +74,27 @@ class HTTP2TraceTest : public testing::SocketTraceBPFTestFixture - -#include "src/common/testing/test_environment.h" -#include "src/common/testing/test_utils/container_runner.h" - -namespace px { -namespace stirling { -namespace testing { - -class Go1_18_GRPCClientContainer : public ContainerRunner { - public: - Go1_18_GRPCClientContainer() - : 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_1_18_grpc_tls_client.tar"; - static constexpr std::string_view kContainerNamePrefix = "grpc_client"; - static constexpr std::string_view kReadyMessage = ""; -}; - -} // namespace testing -} // namespace stirling -} // namespace px diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_18_grpc_server_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_18_grpc_server_container.h index 94bd9a4c87b..12877b6908c 100644 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_18_grpc_server_container.h +++ b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_18_grpc_server_container.h @@ -33,9 +33,11 @@ class Go1_18_GRPCServerContainer : public ContainerRunner { : 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_1_18_grpc_tls_server.tar"; + "src/stirling/source_connectors/socket_tracer/testing/containers/" + "golang_1_18_grpc_server_with_buildinfo.tar"; + + private: static constexpr std::string_view kContainerNamePrefix = "grpc_server"; static constexpr std::string_view kReadyMessage = "Starting HTTP/2 server"; }; diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_18_tls_client_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_18_tls_client_container.h deleted file mode 100644 index 44ffa3c0fd2..00000000000 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_18_tls_client_container.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - -#include "src/common/testing/test_environment.h" -#include "src/common/testing/test_utils/container_runner.h" - -namespace px { -namespace stirling { -namespace testing { - -class Go1_18_TLSClientContainer : public ContainerRunner { - public: - Go1_18_TLSClientContainer() - : ContainerRunner(::px::testing::BazelRunfilePath(kBazelImageTar), kContainerNamePrefix, - kReadyMessage) {} - - private: - static constexpr std::string_view kBazelImageTar = - "src/stirling/testing/demo_apps/go_https/client/golang_1_18_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 diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_18_tls_server_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_18_tls_server_container.h index cb5ef40211a..1d0184072ac 100644 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_18_tls_server_container.h +++ b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_18_tls_server_container.h @@ -33,9 +33,11 @@ class Go1_18_TLSServerContainer : public ContainerRunner { : ContainerRunner(::px::testing::BazelRunfilePath(kBazelImageTar), kContainerNamePrefix, kReadyMessage) {} - private: static constexpr std::string_view kBazelImageTar = - "src/stirling/testing/demo_apps/go_https/server/golang_1_18_https_server.tar"; + "src/stirling/source_connectors/socket_tracer/testing/containers/" + "golang_1_18_https_server_with_buildinfo.tar"; + + private: static constexpr std::string_view kContainerNamePrefix = "https_server"; static constexpr std::string_view kReadyMessage = "Starting HTTPS service"; }; diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_grpc_client_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_grpc_client_container.h deleted file mode 100644 index f1964c257f7..00000000000 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_grpc_client_container.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - -#include "src/common/testing/test_environment.h" -#include "src/common/testing/test_utils/container_runner.h" - -namespace px { -namespace stirling { -namespace testing { - -class Go1_19_GRPCClientContainer : public ContainerRunner { - public: - Go1_19_GRPCClientContainer() - : 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_1_19_grpc_tls_client.tar"; - static constexpr std::string_view kContainerNamePrefix = "grpc_client"; - static constexpr std::string_view kReadyMessage = ""; -}; - -} // namespace testing -} // namespace stirling -} // namespace px diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_grpc_server_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_grpc_server_container.h index ac4819d23b0..f655fe5fb0e 100644 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_grpc_server_container.h +++ b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_grpc_server_container.h @@ -33,9 +33,11 @@ class Go1_19_GRPCServerContainer : public ContainerRunner { : 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_1_19_grpc_tls_server.tar"; + "src/stirling/source_connectors/socket_tracer/testing/containers/" + "golang_1_19_grpc_server_with_buildinfo.tar"; + + private: static constexpr std::string_view kContainerNamePrefix = "grpc_server"; static constexpr std::string_view kReadyMessage = "Starting HTTP/2 server"; }; diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_tls_client_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_tls_client_container.h deleted file mode 100644 index ce3d92969f4..00000000000 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_tls_client_container.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - -#include "src/common/testing/test_environment.h" -#include "src/common/testing/test_utils/container_runner.h" - -namespace px { -namespace stirling { -namespace testing { - -class Go1_19_TLSClientContainer : public ContainerRunner { - public: - Go1_19_TLSClientContainer() - : ContainerRunner(::px::testing::BazelRunfilePath(kBazelImageTar), kContainerNamePrefix, - kReadyMessage) {} - - private: - static constexpr std::string_view kBazelImageTar = - "src/stirling/testing/demo_apps/go_https/client/golang_1_19_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 diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_tls_server_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_tls_server_container.h index 70b59273fe4..d4e845bd12c 100644 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_tls_server_container.h +++ b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_tls_server_container.h @@ -33,9 +33,11 @@ class Go1_19_TLSServerContainer : public ContainerRunner { : ContainerRunner(::px::testing::BazelRunfilePath(kBazelImageTar), kContainerNamePrefix, kReadyMessage) {} - private: static constexpr std::string_view kBazelImageTar = - "src/stirling/testing/demo_apps/go_https/server/golang_1_19_https_server.tar"; + "src/stirling/source_connectors/socket_tracer/testing/containers/" + "golang_1_19_https_server_with_buildinfo.tar"; + + private: static constexpr std::string_view kContainerNamePrefix = "https_server"; static constexpr std::string_view kReadyMessage = "Starting HTTPS service"; }; diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_grpc_client_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_grpc_client_container.h deleted file mode 100644 index ce50af5523d..00000000000 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_grpc_client_container.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - -#include "src/common/testing/test_environment.h" -#include "src/common/testing/test_utils/container_runner.h" - -namespace px { -namespace stirling { -namespace testing { - -class Go1_20_GRPCClientContainer : public ContainerRunner { - public: - Go1_20_GRPCClientContainer() - : 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_1_20_grpc_tls_client.tar"; - static constexpr std::string_view kContainerNamePrefix = "grpc_client"; - static constexpr std::string_view kReadyMessage = ""; -}; - -} // namespace testing -} // namespace stirling -} // namespace px diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_grpc_server_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_grpc_server_container.h index 67e7c2fa581..e64c6d93e7d 100644 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_grpc_server_container.h +++ b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_grpc_server_container.h @@ -33,9 +33,11 @@ class Go1_20_GRPCServerContainer : public ContainerRunner { : 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_1_20_grpc_tls_server.tar"; + "src/stirling/source_connectors/socket_tracer/testing/containers/" + "golang_1_20_grpc_server_with_buildinfo.tar"; + + private: static constexpr std::string_view kContainerNamePrefix = "grpc_server"; static constexpr std::string_view kReadyMessage = "Starting HTTP/2 server"; }; diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_tls_client_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_tls_client_container.h deleted file mode 100644 index dfa274bc1f5..00000000000 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_tls_client_container.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - -#include "src/common/testing/test_environment.h" -#include "src/common/testing/test_utils/container_runner.h" - -namespace px { -namespace stirling { -namespace testing { - -class Go1_20_TLSClientContainer : public ContainerRunner { - public: - Go1_20_TLSClientContainer() - : ContainerRunner(::px::testing::BazelRunfilePath(kBazelImageTar), kContainerNamePrefix, - kReadyMessage) {} - - private: - static constexpr std::string_view kBazelImageTar = - "src/stirling/testing/demo_apps/go_https/client/golang_1_20_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 diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_tls_server_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_tls_server_container.h index f3287f1a177..13aabed1ade 100644 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_tls_server_container.h +++ b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_20_tls_server_container.h @@ -33,9 +33,11 @@ class Go1_20_TLSServerContainer : public ContainerRunner { : ContainerRunner(::px::testing::BazelRunfilePath(kBazelImageTar), kContainerNamePrefix, kReadyMessage) {} - private: static constexpr std::string_view kBazelImageTar = - "src/stirling/testing/demo_apps/go_https/server/golang_1_20_https_server.tar"; + "src/stirling/source_connectors/socket_tracer/testing/containers/" + "golang_1_20_https_server_with_buildinfo.tar"; + + private: static constexpr std::string_view kContainerNamePrefix = "https_server"; static constexpr std::string_view kReadyMessage = "Starting HTTPS service"; }; diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_grpc_client_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_grpc_client_container.h deleted file mode 100644 index 3cf4e91ef72..00000000000 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_grpc_client_container.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - -#include "src/common/testing/test_environment.h" -#include "src/common/testing/test_utils/container_runner.h" - -namespace px { -namespace stirling { -namespace testing { - -class Go1_21_GRPCClientContainer : public ContainerRunner { - public: - Go1_21_GRPCClientContainer() - : 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_1_21_grpc_tls_client.tar"; - static constexpr std::string_view kContainerNamePrefix = "grpc_client"; - static constexpr std::string_view kReadyMessage = ""; -}; - -} // namespace testing -} // namespace stirling -} // namespace px diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_grpc_server_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_grpc_server_container.h index 00ceb84e000..db0dbb25bce 100644 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_grpc_server_container.h +++ b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_grpc_server_container.h @@ -33,9 +33,11 @@ class Go1_21_GRPCServerContainer : public ContainerRunner { : 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_1_21_grpc_tls_server.tar"; + "src/stirling/source_connectors/socket_tracer/testing/containers/" + "golang_1_21_grpc_server_with_buildinfo.tar"; + + private: static constexpr std::string_view kContainerNamePrefix = "grpc_server"; static constexpr std::string_view kReadyMessage = "Starting HTTP/2 server"; }; diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_tls_client_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_tls_client_container.h deleted file mode 100644 index 5a22d65df81..00000000000 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_tls_client_container.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - -#include "src/common/testing/test_environment.h" -#include "src/common/testing/test_utils/container_runner.h" - -namespace px { -namespace stirling { -namespace testing { - -class Go1_21_TLSClientContainer : public ContainerRunner { - public: - Go1_21_TLSClientContainer() - : ContainerRunner(::px::testing::BazelRunfilePath(kBazelImageTar), kContainerNamePrefix, - kReadyMessage) {} - - private: - static constexpr std::string_view kBazelImageTar = - "src/stirling/testing/demo_apps/go_https/client/golang_1_21_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 diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_tls_server_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_tls_server_container.h index 331e1b28339..342d980b397 100644 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_tls_server_container.h +++ b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_21_tls_server_container.h @@ -33,9 +33,11 @@ class Go1_21_TLSServerContainer : public ContainerRunner { : ContainerRunner(::px::testing::BazelRunfilePath(kBazelImageTar), kContainerNamePrefix, kReadyMessage) {} - private: static constexpr std::string_view kBazelImageTar = - "src/stirling/testing/demo_apps/go_https/server/golang_1_21_https_server.tar"; + "src/stirling/source_connectors/socket_tracer/testing/containers/" + "golang_1_21_https_server_with_buildinfo.tar"; + + private: static constexpr std::string_view kContainerNamePrefix = "https_server"; static constexpr std::string_view kReadyMessage = "Starting HTTPS service"; }; diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_grpc_client_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_grpc_client_container.h deleted file mode 100644 index 032f462b26c..00000000000 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_grpc_client_container.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - -#include "src/common/testing/test_environment.h" -#include "src/common/testing/test_utils/container_runner.h" - -namespace px { -namespace stirling { -namespace testing { - -class Go1_22_GRPCClientContainer : public ContainerRunner { - public: - Go1_22_GRPCClientContainer() - : 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_1_22_grpc_tls_client.tar"; - static constexpr std::string_view kContainerNamePrefix = "grpc_client"; - static constexpr std::string_view kReadyMessage = ""; -}; - -} // namespace testing -} // namespace stirling -} // namespace px diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_grpc_server_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_grpc_server_container.h index 1d2c274cc75..6218f483eb4 100644 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_grpc_server_container.h +++ b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_grpc_server_container.h @@ -33,9 +33,11 @@ class Go1_22_GRPCServerContainer : public ContainerRunner { : 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_1_22_grpc_tls_server.tar"; + "src/stirling/source_connectors/socket_tracer/testing/" + "containers/golang_1_22_grpc_server_with_buildinfo.tar"; + + private: static constexpr std::string_view kContainerNamePrefix = "grpc_server"; static constexpr std::string_view kReadyMessage = "Starting HTTP/2 server"; }; diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_tls_client_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_tls_client_container.h deleted file mode 100644 index 89c00972ebe..00000000000 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_tls_client_container.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - -#include "src/common/testing/test_environment.h" -#include "src/common/testing/test_utils/container_runner.h" - -namespace px { -namespace stirling { -namespace testing { - -class Go1_22_TLSClientContainer : public ContainerRunner { - public: - Go1_22_TLSClientContainer() - : ContainerRunner(::px::testing::BazelRunfilePath(kBazelImageTar), kContainerNamePrefix, - kReadyMessage) {} - - private: - static constexpr std::string_view kBazelImageTar = - "src/stirling/testing/demo_apps/go_https/client/golang_1_22_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 diff --git a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_tls_server_container.h b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_tls_server_container.h index 5f5a53766da..b07bf09348f 100644 --- a/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_tls_server_container.h +++ b/src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_22_tls_server_container.h @@ -33,9 +33,11 @@ class Go1_22_TLSServerContainer : public ContainerRunner { : ContainerRunner(::px::testing::BazelRunfilePath(kBazelImageTar), kContainerNamePrefix, kReadyMessage) {} - private: static constexpr std::string_view kBazelImageTar = - "src/stirling/testing/demo_apps/go_https/server/golang_1_22_https_server.tar"; + "src/stirling/source_connectors/socket_tracer/testing/containers/" + "golang_1_22_https_server_with_buildinfo.tar"; + + private: static constexpr std::string_view kContainerNamePrefix = "https_server"; static constexpr std::string_view kReadyMessage = "Starting HTTPS service"; }; diff --git a/src/stirling/source_connectors/socket_tracer/testing/containers/BUILD.bazel b/src/stirling/source_connectors/socket_tracer/testing/containers/BUILD.bazel index bbdafff556a..3f73a0d5174 100644 --- a/src/stirling/source_connectors/socket_tracer/testing/containers/BUILD.bazel +++ b/src/stirling/source_connectors/socket_tracer/testing/containers/BUILD.bazel @@ -131,6 +131,56 @@ container_image( ] ] +container_image( + name = "golang_1_18_https_server_with_buildinfo", + base = "@golang_1_18_https_server_with_buildinfo//image", +) + +container_image( + name = "golang_1_19_https_server_with_buildinfo", + base = "@golang_1_19_https_server_with_buildinfo//image", +) + +container_image( + name = "golang_1_20_https_server_with_buildinfo", + base = "@golang_1_20_https_server_with_buildinfo//image", +) + +container_image( + name = "golang_1_21_https_server_with_buildinfo", + base = "@golang_1_21_https_server_with_buildinfo//image", +) + +container_image( + name = "golang_1_22_https_server_with_buildinfo", + base = "@golang_1_22_https_server_with_buildinfo//image", +) + +container_image( + name = "golang_1_18_grpc_server_with_buildinfo", + base = "@golang_1_18_grpc_server_with_buildinfo//image", +) + +container_image( + name = "golang_1_19_grpc_server_with_buildinfo", + base = "@golang_1_19_grpc_server_with_buildinfo//image", +) + +container_image( + name = "golang_1_20_grpc_server_with_buildinfo", + base = "@golang_1_20_grpc_server_with_buildinfo//image", +) + +container_image( + name = "golang_1_21_grpc_server_with_buildinfo", + base = "@golang_1_21_grpc_server_with_buildinfo//image", +) + +container_image( + name = "golang_1_22_grpc_server_with_buildinfo", + base = "@golang_1_22_grpc_server_with_buildinfo//image", +) + container_image( name = "amqp_image", base = "@rabbitmq_3_management//image",