Skip to content

Commit

Permalink
Remove deletion of random files in testbackupstorefix.
Browse files Browse the repository at this point in the history
Deleting random files tends to cause random test failures. The results are not
predictable and depend on the order in which files are uploaded and directories
created.
  • Loading branch information
qris committed Sep 16, 2016
1 parent 519a2a3 commit 4f01448
Showing 1 changed file with 0 additions and 54 deletions.
54 changes: 0 additions & 54 deletions test/backupstorefix/testbackupstorefix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -768,41 +768,6 @@ int test(int argc, const char *argv[])
f.Commit(true /* write now! */);
}

#ifndef BOX_RELEASE_BUILD
// Delete two of the three raidfiles and their parent
// directories. This used to crash bbstoreaccounts check.
// We can only do this, without destroying the entire store,
// in debug mode, where the store has a far deeper
// structure.
// This will destroy or damage objects 18-1b and 58-5b,
// some repairably.
TEST_THAT(rename("testfiles/0_0/backup/01234567/02/01/o00.rf",
"testfiles/0_0/backup/01234567/02/01/o00.rfw") == 0); // 0x18
TEST_THAT(rename("testfiles/0_1/backup/01234567/02/01/o01.rf",
"testfiles/0_1/backup/01234567/02/01/o01.rfw") == 0); // 0x19
//RUN("mv testfiles/0_2/backup/01234567/02/01/o02.rf "
// "testfiles/0_0/backup/01234567/02/01/o02.rfw"); // 0x1a
TEST_THAT(rename("testfiles/0_0/backup/01234567/02/01/o03.rf",
"testfiles/0_0/backup/01234567/02/01/o03.rfw") == 0); // 0x1b
TEST_THAT(rename("testfiles/0_0/backup/01234567/02/01/01/o00.rf",
"testfiles/0_0/backup/01234567/02/01/01/o00.rfw") == 0); // 0x58
TEST_THAT(rename("testfiles/0_1/backup/01234567/02/01/01/o01.rf",
"testfiles/0_1/backup/01234567/02/01/01/o01.rfw") == 0); // 0x59
//RUN("mv testfiles/0_2/backup/01234567/02/01/01/o02.rf "
// "testfiles/0_0/backup/01234567/02/01/01/o02.rfw"); // 0x5a
TEST_THAT(rename("testfiles/0_0/backup/01234567/02/01/01/o03.rf",
"testfiles/0_0/backup/01234567/02/01/01/o03.rfw") == 0); // 0x5b
// RUN("rm -r testfiles/0_1/backup/01234567/02/01");

# define RUN(x) TEST_THAT(system(x) == 0);
# ifdef WIN32
RUN("rd /s/q testfiles\\0_2\\backup\\01234567\\02\\01");
# else // !WIN32
RUN("rm -r testfiles/0_2/backup/01234567/02/01");
# endif // WIN32
# undef RUN
#endif // !BOX_RELEASE_BUILD

// Fix it
// ERROR: Object 0x44 is unattached.
// ERROR: BlocksUsed changed from 284 to 282
Expand Down Expand Up @@ -841,25 +806,6 @@ int test(int argc, const char *argv[])
// file, so checking for AsRaid excludes this possibility.
RaidFileController &rcontroller(RaidFileController::GetController());
RaidFileDiscSet rdiscSet(rcontroller.GetDiscSet(discSetNum));

#ifndef BOX_RELEASE_BUILD // Only if we destroyed these particular files, above.
TEST_EQUAL(RaidFileUtil::AsRaid, RaidFileUtil::RaidFileExists(
rdiscSet, "backup/01234567/02/01/o00"));
TEST_EQUAL(RaidFileUtil::AsRaid, RaidFileUtil::RaidFileExists(
rdiscSet, "backup/01234567/02/01/o01"));
TEST_EQUAL(RaidFileUtil::AsRaid, RaidFileUtil::RaidFileExists(
rdiscSet, "backup/01234567/02/01/o02"));
TEST_EQUAL(RaidFileUtil::AsRaid, RaidFileUtil::RaidFileExists(
rdiscSet, "backup/01234567/02/01/o03"));
TEST_EQUAL(RaidFileUtil::AsRaid, RaidFileUtil::RaidFileExists(
rdiscSet, "backup/01234567/02/01/01/o00"));
TEST_EQUAL(RaidFileUtil::AsRaid, RaidFileUtil::RaidFileExists(
rdiscSet, "backup/01234567/02/01/01/o01"));
TEST_EQUAL(RaidFileUtil::AsRaid, RaidFileUtil::RaidFileExists(
rdiscSet, "backup/01234567/02/01/01/o02"));
TEST_EQUAL(RaidFileUtil::AsRaid, RaidFileUtil::RaidFileExists(
rdiscSet, "backup/01234567/02/01/01/o03"));
#endif
}

// ------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 4f01448

Please sign in to comment.