summaryrefslogtreecommitdiff
path: root/debuggerd/debuggerd_test.cpp
diff options
context:
space:
mode:
authorJerome Gaillard <jgaillard@google.com>2021-01-26 12:36:12 +0000
committerJerome Gaillard <jgaillard@google.com>2021-01-26 12:41:52 +0000
commit5ec54d1e843729cd1e38a2f791f001226a653e95 (patch)
treed07ff54fd4c97bd91c4f0a8bb6ab4d84c7bd50b6 /debuggerd/debuggerd_test.cpp
parent1e45d3f2239333217d3252f78151f4294fda4e80 (diff)
Revert "tombstoned: support for protobuf fds."
Revert "Let crash_dump read /proc/$PID." Revert submission 1556807-tombstone_proto Reason for revert: b/178455196, Broken test: android.seccomp.cts.SeccompHostJUnit4DeviceTest#testAppZygoteSyscalls on git_master on cf_x86_64_phone-userdebug Reverted Changes: Ide6811297:tombstoned: switch from goto to RAII. I8d285c4b4:tombstoned: make it easier to add more types of ou... Id0f0fa285:tombstoned: support for protobuf fds. I6be6082ab:Let crash_dump read /proc/$PID. Id812ca390:Make protobuf vendor_ramdisk_available. Ieeece6e6d:libdebuggerd: add protobuf implementation. Change-Id: I0c4f3a17e8b06d6c65255388c571ebf11d371dbb
Diffstat (limited to 'debuggerd/debuggerd_test.cpp')
-rw-r--r--debuggerd/debuggerd_test.cpp67
1 files changed, 0 insertions, 67 deletions
diff --git a/debuggerd/debuggerd_test.cpp b/debuggerd/debuggerd_test.cpp
index b9d66063e..191931da6 100644
--- a/debuggerd/debuggerd_test.cpp
+++ b/debuggerd/debuggerd_test.cpp
@@ -1425,70 +1425,3 @@ TEST_F(CrasherTest, stack_overflow) {
ConsumeFd(std::move(output_fd), &result);
ASSERT_MATCH(result, R"(Cause: stack pointer[^\n]*stack overflow.\n)");
}
-
-TEST(tombstoned, proto) {
- const pid_t self = getpid();
- unique_fd tombstoned_socket, text_fd, proto_fd;
- ASSERT_TRUE(
- tombstoned_connect(self, &tombstoned_socket, &text_fd, &proto_fd, kDebuggerdTombstoneProto));
-
- tombstoned_notify_completion(tombstoned_socket.get());
-
- ASSERT_NE(-1, text_fd.get());
- ASSERT_NE(-1, proto_fd.get());
-
- struct stat text_st;
- ASSERT_EQ(0, fstat(text_fd.get(), &text_st));
-
- // Give tombstoned some time to link the files into place.
- std::this_thread::sleep_for(100ms);
-
- // Find the tombstone.
- std::optional<int> tombstone_index;
- for (int i = 0; i < 50; ++i) {
- std::string path = android::base::StringPrintf("/data/tombstones/tombstone_%02d", i);
-
- struct stat st;
- if (TEMP_FAILURE_RETRY(stat(path.c_str(), &st)) != 0) {
- continue;
- }
-
- if (st.st_dev == text_st.st_dev && st.st_ino == text_st.st_ino) {
- tombstone_index = i;
- break;
- }
- }
-
- ASSERT_TRUE(tombstone_index);
- std::string proto_path =
- android::base::StringPrintf("/data/tombstones/tombstone_%02d.pb", *tombstone_index);
-
- struct stat proto_fd_st;
- struct stat proto_file_st;
- ASSERT_EQ(0, fstat(proto_fd.get(), &proto_fd_st));
- ASSERT_EQ(0, stat(proto_path.c_str(), &proto_file_st));
-
- ASSERT_EQ(proto_fd_st.st_dev, proto_file_st.st_dev);
- ASSERT_EQ(proto_fd_st.st_ino, proto_file_st.st_ino);
-}
-
-TEST(tombstoned, proto_intercept) {
- const pid_t self = getpid();
- unique_fd intercept_fd, output_fd;
- InterceptStatus status;
-
- tombstoned_intercept(self, &intercept_fd, &output_fd, &status, kDebuggerdTombstone);
- ASSERT_EQ(InterceptStatus::kRegistered, status);
-
- unique_fd tombstoned_socket, text_fd, proto_fd;
- ASSERT_TRUE(
- tombstoned_connect(self, &tombstoned_socket, &text_fd, &proto_fd, kDebuggerdTombstoneProto));
- ASSERT_TRUE(android::base::WriteStringToFd("foo", text_fd.get()));
- tombstoned_notify_completion(tombstoned_socket.get());
-
- text_fd.reset();
-
- std::string output;
- ASSERT_TRUE(android::base::ReadFdToString(output_fd, &output));
- ASSERT_EQ("foo", output);
-}