Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 643a9181 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Automerger Merge Worker
Browse files

Merge "Add dropbox entries as files to dumpstate ZIP." am: 7572f7bb

parents b29dea66 7572f7bb
Loading
Loading
Loading
Loading
+15 −0
Original line number Original line Diff line number Diff line
@@ -185,6 +185,7 @@ void add_mountinfo();
#define SYSTEM_TRACE_SNAPSHOT "/data/misc/perfetto-traces/bugreport/systrace.pftrace"
#define SYSTEM_TRACE_SNAPSHOT "/data/misc/perfetto-traces/bugreport/systrace.pftrace"
#define CGROUPFS_DIR "/sys/fs/cgroup"
#define CGROUPFS_DIR "/sys/fs/cgroup"
#define SDK_EXT_INFO "/apex/com.android.sdkext/bin/derive_sdk"
#define SDK_EXT_INFO "/apex/com.android.sdkext/bin/derive_sdk"
#define DROPBOX_DIR "/data/system/dropbox"


// TODO(narayan): Since this information has to be kept in sync
// TODO(narayan): Since this information has to be kept in sync
// with tombstoned, we should just put it in a common header.
// with tombstoned, we should just put it in a common header.
@@ -524,6 +525,15 @@ static bool skip_not_stat(const char *path) {
    return strcmp(path + len - sizeof(stat) + 1, stat); /* .../stat? */
    return strcmp(path + len - sizeof(stat) + 1, stat); /* .../stat? */
}
}


static bool skip_wtf_strictmode(const char *path) {
    if (strstr(path, "_wtf")) {
        return true;
    } else if (strstr(path, "_strictmode")) {
        return true;
    }
    return false;
}

static bool skip_none(const char* path __attribute__((unused))) {
static bool skip_none(const char* path __attribute__((unused))) {
    return false;
    return false;
}
}
@@ -1888,6 +1898,11 @@ Dumpstate::RunStatus Dumpstate::DumpstateDefaultAfterCritical() {
    DumpIpTablesAsRoot();
    DumpIpTablesAsRoot();
    DumpDynamicPartitionInfo();
    DumpDynamicPartitionInfo();
    ds.AddDir(OTA_METADATA_DIR, true);
    ds.AddDir(OTA_METADATA_DIR, true);
    if (!PropertiesHelper::IsUserBuild()) {
        // Include dropbox entry files inside ZIP, but exclude
        // noisy WTF and StrictMode entries
        dump_files("", DROPBOX_DIR, skip_wtf_strictmode, _add_file_from_fd);
    }


    // Capture any IPSec policies in play. No keys are exposed here.
    // Capture any IPSec policies in play. No keys are exposed here.
    RunCommand("IP XFRM POLICY", {"ip", "xfrm", "policy"}, CommandOptions::WithTimeout(10).Build());
    RunCommand("IP XFRM POLICY", {"ip", "xfrm", "policy"}, CommandOptions::WithTimeout(10).Build());
+2 −1
Original line number Original line Diff line number Diff line
@@ -1023,7 +1023,8 @@ class ZippedBugReportStreamTest : public DumpstateBaseTest {
};
};


// Generate a quick LimitedOnly report redirected to a file, open it and verify entry exist.
// Generate a quick LimitedOnly report redirected to a file, open it and verify entry exist.
TEST_F(ZippedBugReportStreamTest, StreamLimitedOnlyReport) {
// TODO: broken test tracked in b/249983726
TEST_F(ZippedBugReportStreamTest, DISABLED_StreamLimitedOnlyReport) {
    std::string out_path = kTestDataPath + "StreamLimitedOnlyReportOut.zip";
    std::string out_path = kTestDataPath + "StreamLimitedOnlyReportOut.zip";
    android::base::unique_fd out_fd;
    android::base::unique_fd out_fd;
    CreateFd(out_path, &out_fd);
    CreateFd(out_path, &out_fd);