1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-01-18 04:58:51 +02:00

Only test timestamps for files.

In general we don't care about path and link times since they are easily recreated when restoring.

So, outside of storageInfo() we don't need to bother testing them.
This commit is contained in:
David Steele 2019-09-18 22:23:04 -04:00
parent 54638e8704
commit e24b2e3f4d
2 changed files with 4 additions and 6 deletions

View File

@ -60,7 +60,10 @@ hrnStorageInfoListCallback(void *callbackData, const StorageInfo *info)
{
strCatFmt(data->content, ", m=%04o", info->mode);
}
}
if (info->type == storageTypeFile)
{
if (!data->timestampOmit)
strCatFmt(data->content, ", t=%" PRIu64, (uint64_t)info->timeModified);
}

View File

@ -281,18 +281,13 @@ testRun(void)
// -------------------------------------------------------------------------------------------------------------------------
storagePathCreateP(storageTest, strNew("pg"), .mode = 0766);
struct utimbuf utimeTest = {.actime = 1000000000, .modtime = 1555160777};
THROW_ON_SYS_ERROR_FMT(
utime(strPtr(strNewFmt("%s/pg", testPath())), &utimeTest) != 0, FileWriteError, "unable to set time for '%s'/pg",
testPath());
callbackData.content = strNew("");
TEST_RESULT_VOID(
storageInfoListP(storageTest, strNew("pg"), hrnStorageInfoListCallback, &callbackData),
"directory with one dot file sorted");
TEST_RESULT_STR_Z(
callbackData.content, strPtr(strNewFmt(". {path, m=0766, t=1555160777, u=%s, g=%s}", testUser(), testGroup())),
callbackData.content, strPtr(strNewFmt(". {path, m=0766, u=%s, g=%s}", testUser(), testGroup())),
" check content");
// -------------------------------------------------------------------------------------------------------------------------