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

Commit 026db05f authored by Rhed Jao's avatar Rhed Jao Committed by Automerger Merge Worker
Browse files

Merge "Fixes flaky ZippedBugReportStreamTest" am: 6fde2dde am: 61e0d7e2

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1670025

Change-Id: I5c7ad91953cdac0fb1b829b6c952a9d5ee34f745
parents 3d4bed16 61e0d7e2
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -1032,12 +1032,12 @@ class ZippedBugReportStreamTest : public DumpstateBaseTest {
    ZipArchiveHandle handle_;
    ZipArchiveHandle handle_;
};
};


// Generate a quick wifi 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, StreamWifiReport) {
TEST_F(ZippedBugReportStreamTest, StreamLimitedOnlyReport) {
    std::string out_path = kTestDataPath + "out.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);
    ds_.options_->wifi_only = true;
    ds_.options_->limited_only = true;
    ds_.options_->stream_to_socket = true;
    ds_.options_->stream_to_socket = true;
    RedirectOutputToFd(out_fd);
    RedirectOutputToFd(out_fd);


@@ -1051,7 +1051,7 @@ TEST_F(ZippedBugReportStreamTest, StreamWifiReport) {
    ExtractToMemory(handle_, &entry, reinterpret_cast<uint8_t*>(bugreport_txt_name.data()),
    ExtractToMemory(handle_, &entry, reinterpret_cast<uint8_t*>(bugreport_txt_name.data()),
                    entry.uncompressed_length);
                    entry.uncompressed_length);
    EXPECT_THAT(bugreport_txt_name,
    EXPECT_THAT(bugreport_txt_name,
                testing::ContainsRegex("(bugreport-.+-wifi(-[[:digit:]]+){6}\\.txt)"));
                testing::ContainsRegex("(bugreport-.+(-[[:digit:]]+){6}\\.txt)"));
    VerifyEntry(handle_, bugreport_txt_name, &entry);
    VerifyEntry(handle_, bugreport_txt_name, &entry);
}
}