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

Commit 8570d1db authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Don't preserve file attributes when pulling bugreport file..."

parents 46244a64 4bfddbd2
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -102,7 +102,7 @@ class BugreportStandardStreamsCallback : public StandardStreamsCallbackInterface
            std::vector<const char*> srcs{src_file_.c_str()};
            std::vector<const char*> srcs{src_file_.c_str()};
            SetLineMessage("pulling");
            SetLineMessage("pulling");
            status_ =
            status_ =
                br_->DoSyncPull(srcs, destination.c_str(), true, line_message_.c_str()) ? 0 : 1;
                br_->DoSyncPull(srcs, destination.c_str(), false, line_message_.c_str()) ? 0 : 1;
            if (status_ != 0) {
            if (status_ != 0) {
                fprintf(stderr,
                fprintf(stderr,
                        "Bug report finished but could not be copied to '%s'.\n"
                        "Bug report finished but could not be copied to '%s'.\n"
+11 −11
Original line number Original line Diff line number Diff line
@@ -185,7 +185,7 @@ TEST_F(BugreportTest, NoArgumentsNDevice) {
        .WillOnce(DoAll(WithArg<2>(WriteOnStdout("OK:/device/da_bugreport.zip")),
        .WillOnce(DoAll(WithArg<2>(WriteOnStdout("OK:/device/da_bugreport.zip")),
                        WithArg<2>(ReturnCallbackDone())));
                        WithArg<2>(ReturnCallbackDone())));
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file),
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file),
                                true, StrEq("pulling da_bugreport.zip")))
                                false, StrEq("pulling da_bugreport.zip")))
        .WillOnce(Return(true));
        .WillOnce(Return(true));


    const char* args[] = {"bugreport"};
    const char* args[] = {"bugreport"};
@@ -205,7 +205,7 @@ TEST_F(BugreportTest, NoArgumentsPostNDevice) {
                        WithArg<2>(WriteOnStdout("OK:/device/da_bugreport.zip\n")),
                        WithArg<2>(WriteOnStdout("OK:/device/da_bugreport.zip\n")),
                        WithArg<2>(ReturnCallbackDone())));
                        WithArg<2>(ReturnCallbackDone())));
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file),
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file),
                                true, StrEq("pulling da_bugreport.zip")))
                                false, StrEq("pulling da_bugreport.zip")))
        .WillOnce(Return(true));
        .WillOnce(Return(true));


    const char* args[] = {"bugreport"};
    const char* args[] = {"bugreport"};
@@ -219,7 +219,7 @@ TEST_F(BugreportTest, OkNDevice) {
        .WillOnce(DoAll(WithArg<2>(WriteOnStdout("OK:/device/bugreport.zip")),
        .WillOnce(DoAll(WithArg<2>(WriteOnStdout("OK:/device/bugreport.zip")),
                        WithArg<2>(ReturnCallbackDone())));
                        WithArg<2>(ReturnCallbackDone())));
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
                                true, StrEq("pulling file.zip")))
                                false, StrEq("pulling file.zip")))
        .WillOnce(Return(true));
        .WillOnce(Return(true));


    const char* args[] = {"bugreport", "file.zip"};
    const char* args[] = {"bugreport", "file.zip"};
@@ -235,7 +235,7 @@ TEST_F(BugreportTest, OkNDeviceSplitBuffer) {
                        WithArg<2>(WriteOnStdout("/bugreport.zip")),
                        WithArg<2>(WriteOnStdout("/bugreport.zip")),
                        WithArg<2>(ReturnCallbackDone())));
                        WithArg<2>(ReturnCallbackDone())));
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
                                true, StrEq("pulling file.zip")))
                                false, StrEq("pulling file.zip")))
        .WillOnce(Return(true));
        .WillOnce(Return(true));


    const char* args[] = {"bugreport", "file.zip"};
    const char* args[] = {"bugreport", "file.zip"};
@@ -271,7 +271,7 @@ TEST_F(BugreportTest, OkProgress) {
            WithArg<2>(ReturnCallbackDone())));
            WithArg<2>(ReturnCallbackDone())));
    // clang-format on
    // clang-format on
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
                                true, StrEq("pulling file.zip")))
                                false, StrEq("pulling file.zip")))
        .WillOnce(Return(true));
        .WillOnce(Return(true));


    const char* args[] = {"bugreport", "file.zip"};
    const char* args[] = {"bugreport", "file.zip"};
@@ -302,7 +302,7 @@ TEST_F(BugreportTest, OkProgressAlwaysForward) {
            WithArg<2>(ReturnCallbackDone())));
            WithArg<2>(ReturnCallbackDone())));
    // clang-format on
    // clang-format on
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
                                true, StrEq("pulling file.zip")))
                                false, StrEq("pulling file.zip")))
        .WillOnce(Return(true));
        .WillOnce(Return(true));


    const char* args[] = {"bugreport", "file.zip"};
    const char* args[] = {"bugreport", "file.zip"};
@@ -325,7 +325,7 @@ TEST_F(BugreportTest, OkProgressZeroPercentIsNotIgnored) {
            WithArg<2>(ReturnCallbackDone())));
            WithArg<2>(ReturnCallbackDone())));
    // clang-format on
    // clang-format on
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
                                true, StrEq("pulling file.zip")))
                                false, StrEq("pulling file.zip")))
        .WillOnce(Return(true));
        .WillOnce(Return(true));


    const char* args[] = {"bugreport", "file.zip"};
    const char* args[] = {"bugreport", "file.zip"};
@@ -344,7 +344,7 @@ TEST_F(BugreportTest, OkDirectory) {
                        WithArg<2>(WriteOnStdout("OK:/device/da_bugreport.zip")),
                        WithArg<2>(WriteOnStdout("OK:/device/da_bugreport.zip")),
                        WithArg<2>(ReturnCallbackDone())));
                        WithArg<2>(ReturnCallbackDone())));
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file),
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file),
                                true, StrEq("pulling da_bugreport.zip")))
                                false, StrEq("pulling da_bugreport.zip")))
        .WillOnce(Return(true));
        .WillOnce(Return(true));


    const char* args[] = {"bugreport", td.path};
    const char* args[] = {"bugreport", td.path};
@@ -358,7 +358,7 @@ TEST_F(BugreportTest, OkNoExtension) {
        .WillOnce(DoAll(WithArg<2>(WriteOnStdout("OK:/device/bugreport.zip\n")),
        .WillOnce(DoAll(WithArg<2>(WriteOnStdout("OK:/device/bugreport.zip\n")),
                        WithArg<2>(ReturnCallbackDone())));
                        WithArg<2>(ReturnCallbackDone())));
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
                                true, StrEq("pulling file.zip")))
                                false, StrEq("pulling file.zip")))
        .WillOnce(Return(true));
        .WillOnce(Return(true));


    const char* args[] = {"bugreport", "file"};
    const char* args[] = {"bugreport", "file"};
@@ -377,7 +377,7 @@ TEST_F(BugreportTest, OkNDeviceDirectory) {
                        WithArg<2>(WriteOnStdout("OK:/device/da_bugreport.zip")),
                        WithArg<2>(WriteOnStdout("OK:/device/da_bugreport.zip")),
                        WithArg<2>(ReturnCallbackDone())));
                        WithArg<2>(ReturnCallbackDone())));
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file),
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file),
                                true, StrEq("pulling da_bugreport.zip")))
                                false, StrEq("pulling da_bugreport.zip")))
        .WillOnce(Return(true));
        .WillOnce(Return(true));


    const char* args[] = {"bugreport", td.path};
    const char* args[] = {"bugreport", td.path};
@@ -458,7 +458,7 @@ TEST_F(BugreportTest, PullFails) {
        .WillOnce(DoAll(WithArg<2>(WriteOnStdout("OK:/device/bugreport.zip")),
        .WillOnce(DoAll(WithArg<2>(WriteOnStdout("OK:/device/bugreport.zip")),
                        WithArg<2>(ReturnCallbackDone())));
                        WithArg<2>(ReturnCallbackDone())));
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
    EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
                                true, HasSubstr("file.zip")))
                                false, HasSubstr("file.zip")))
        .WillOnce(Return(false));
        .WillOnce(Return(false));


    const char* args[] = {"bugreport", "file.zip"};
    const char* args[] = {"bugreport", "file.zip"};