1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00

Remove redundant test and move another test.

This commit is contained in:
Cynthia Shang 2019-12-09 14:06:32 -05:00 committed by David Steele
parent 61ad3a44c9
commit ca33545630

View File

@ -899,31 +899,6 @@ testRun(void)
storageRemoveP(storageTest, STRDEF("pg/pg_tblspc/2"), .errorOnMissing = true); storageRemoveP(storageTest, STRDEF("pg/pg_tblspc/2"), .errorOnMissing = true);
storagePathRemoveP(storageTest, STRDEF("ts/2"), .recurse = true); storagePathRemoveP(storageTest, STRDEF("ts/2"), .recurse = true);
// -------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("error on link that points to nothing");
THROW_ON_SYS_ERROR(
symlink("../bogus-link", strPtr(strNewFmt("%s/pg/link-to-link", testPath()))) == -1, FileOpenError,
"unable to create symlink");
TEST_ERROR(
manifestNewBuild(storagePg, PG_VERSION_94, false, true, NULL, NULL), FileOpenError,
hrnReplaceKey("unable to get info for missing path/file '{[path]}/pg/link-to-link': [2] No such file or directory"));
// -------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("error on link to a link");
THROW_ON_SYS_ERROR(
symlink("../bogus", strPtr(strNewFmt("%s/bogus-link", testPath()))) == -1, FileOpenError,
"unable to create symlink");
TEST_ERROR(
manifestNewBuild(storagePg, PG_VERSION_94, false, true, NULL, NULL), LinkDestinationError,
hrnReplaceKey("link '{[path]}/pg/link-to-link' cannot reference another link '{[path]}/bogus-link'"));
storageRemoveP(storageTest, STRDEF("bogus-link"), .errorOnMissing = true);
storageRemoveP(storageTest, STRDEF("pg/link-to-link"), .errorOnMissing = true);
// ------------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("manifest with all features - 12, online"); TEST_TITLE("manifest with all features - 12, online");
@ -1121,6 +1096,20 @@ testRun(void)
storageRemoveP(storagePgWrite, strNew(MANIFEST_TARGET_PGTBLSPC "/somefile")); storageRemoveP(storagePgWrite, strNew(MANIFEST_TARGET_PGTBLSPC "/somefile"));
// -------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("error on link that points to nothing");
THROW_ON_SYS_ERROR(
symlink("../bogus-link", strPtr(strNewFmt("%s/pg/link-to-link", testPath()))) == -1, FileOpenError,
"unable to create symlink");
TEST_ERROR(
manifestNewBuild(storagePg, PG_VERSION_94, false, true, NULL, NULL), FileOpenError,
hrnReplaceKey("unable to get info for missing path/file '{[path]}/pg/link-to-link': [2] No such file or directory"));
THROW_ON_SYS_ERROR(
unlink(strPtr(strNewFmt("%s/pg/link-to-link", testPath()))) == -1, FileRemoveError, "unable to remove symlink");
// ------------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("error on link to a link"); TEST_TITLE("error on link to a link");