You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-06-16 23:47:38 +02:00
Remove *MP() macros variants.
Adding a dummy column which is always set by the P() macro allows a single macro to be used for parameters or no parameters without violating C's prohibition on the {} initializer. -Wmissing-field-initializers remains disabled because it still gives wildly different results between versions of gcc.
This commit is contained in:
11
CODING.md
11
CODING.md
@ -189,26 +189,21 @@ This project implements variadic functions using macros (which are exempt from t
|
||||
```c
|
||||
typedef struct StoragePathCreateParam
|
||||
{
|
||||
VAR_PARAM_HEADER;
|
||||
bool errorOnExists;
|
||||
bool noParentCreate;
|
||||
mode_t mode;
|
||||
} StoragePathCreateParam;
|
||||
|
||||
#define storagePathCreateP(this, pathExp, ...) \
|
||||
storagePathCreate(this, pathExp, (StoragePathCreateParam){__VA_ARGS__})
|
||||
#define storagePathCreateNP(this, pathExp) \
|
||||
storagePathCreate(this, pathExp, (StoragePathCreateParam){0})
|
||||
storagePathCreate(this, pathExp, (StoragePathCreateParam){VAR_PARAM_INIT, __VA_ARGS__})
|
||||
|
||||
void storagePathCreate(const Storage *this, const String *pathExp, StoragePathCreateParam param);
|
||||
```
|
||||
Continuation characters should be aligned at column 132 (unlike the example above that has been shortened for display purposes).
|
||||
|
||||
This function can be called without variable parameters:
|
||||
```c
|
||||
storagePathCreateNP(storageLocal(), "/tmp/pgbackrest");
|
||||
This function can now be called with variable parameters using the macro:
|
||||
```
|
||||
Or with variable parameters:
|
||||
```c
|
||||
storagePathCreateP(storageLocal(), "/tmp/pgbackrest", .errorOnExists = true, .mode = 0777);
|
||||
```
|
||||
If the majority of functions in a module or object are variadic it is best to provide macros for all functions even if they do not have variable parameters. Do not use the base function when variadic macros exist.
|
||||
|
@ -325,7 +325,7 @@ Sometimes it is necessary to store a file to the test directory. The following d
|
||||
```
|
||||
String *content = strNew("bad content");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageTest, strNewFmt("%s/backup/demo/backup.info", strPtr(repoPath))),
|
||||
storagePutP(storageNewWriteP(storageTest, strNewFmt("%s/backup/demo/backup.info", strPtr(repoPath))),
|
||||
harnessInfoChecksum(content)), "store a corrupt backup.info file");
|
||||
```
|
||||
**Testing a log message**
|
||||
|
@ -257,7 +257,7 @@ typedef struct StoragePathCreateParam
|
||||
|
||||
#define storagePathCreateP(this, pathExp, ...) \
|
||||
storagePathCreate(this, pathExp, (StoragePathCreateParam){__VA_ARGS__})
|
||||
#define storagePathCreateNP(this, pathExp) \
|
||||
#define storagePathCreateP(this, pathExp) \
|
||||
storagePathCreate(this, pathExp, (StoragePathCreateParam){0})
|
||||
|
||||
void storagePathCreate(const Storage *this, const String *pathExp, StoragePathCreateParam param);
|
||||
@ -268,7 +268,7 @@ void storagePathCreate(const Storage *this, const String *pathExp, StoragePathCr
|
||||
<p>This function can be called without variable parameters:</p>
|
||||
|
||||
<code-block type="c">
|
||||
storagePathCreateNP(storageLocal(), "/tmp/pgbackrest");
|
||||
storagePathCreateP(storageLocal(), "/tmp/pgbackrest");
|
||||
</code-block>
|
||||
|
||||
<p>Or with variable parameters:</p>
|
||||
|
@ -358,7 +358,7 @@ TEST_RESULT_STR(strPtr(infoRender()), "No stanzas exist in the repository.\n", "
|
||||
<code-block>
|
||||
String *content = strNew("bad content");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageTest, strNewFmt("%s/backup/demo/backup.info", strPtr(repoPath))),
|
||||
storagePutP(storageNewWriteP(storageTest, strNewFmt("%s/backup/demo/backup.info", strPtr(repoPath))),
|
||||
harnessInfoChecksum(content)), "store a corrupt backup.info file");
|
||||
</code-block>
|
||||
|
||||
|
@ -74,7 +74,7 @@ INPUT:
|
||||
pgBackRest::LibC::StorageRead source
|
||||
pgBackRest::LibC::StorageWrite destination
|
||||
CODE:
|
||||
RETVAL = storageCopyNP(source, destination);
|
||||
RETVAL = storageCopyP(source, destination);
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
CLEANUP:
|
||||
@ -91,7 +91,7 @@ INPUT:
|
||||
pgBackRest::LibC::Storage self
|
||||
const String *fileExp = STR_NEW_SV($arg);
|
||||
CODE:
|
||||
RETVAL = storageExistsNP(self, fileExp);
|
||||
RETVAL = storageExistsP(self, fileExp);
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
CLEANUP:
|
||||
@ -108,7 +108,7 @@ INPUT:
|
||||
pgBackRest::LibC::StorageRead read
|
||||
CODE:
|
||||
RETVAL = NULL;
|
||||
Buffer *buffer = storageGetNP(read);
|
||||
Buffer *buffer = storageGetP(read);
|
||||
|
||||
if (buffer != NULL)
|
||||
{
|
||||
@ -247,7 +247,7 @@ CODE:
|
||||
RETVAL = true;
|
||||
|
||||
if (storageFeature(self, storageFeaturePath))
|
||||
RETVAL = storagePathExistsNP(self, pathExp);
|
||||
RETVAL = storagePathExistsP(self, pathExp);
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
CLEANUP:
|
||||
@ -264,7 +264,7 @@ INPUT:
|
||||
pgBackRest::LibC::Storage self
|
||||
const String *pathExp = STR_NEW_SV($arg);
|
||||
CODE:
|
||||
String *path = storagePathNP(self, pathExp);
|
||||
String *path = storagePathP(self, pathExp);
|
||||
RETVAL = newSVpv((char *)strPtr(path), strSize(path));
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
@ -300,7 +300,7 @@ INPUT:
|
||||
pgBackRest::LibC::Storage self
|
||||
const String *pathExp = STR_NEW_SV($arg);
|
||||
CODE:
|
||||
storagePathSyncNP(self, pathExp);
|
||||
storagePathSyncP(self, pathExp);
|
||||
CLEANUP:
|
||||
}
|
||||
MEM_CONTEXT_XS_TEMP_END();
|
||||
@ -315,7 +315,7 @@ INPUT:
|
||||
pgBackRest::LibC::StorageWrite write
|
||||
const Buffer *buffer = BUF_CONST_SV($arg);
|
||||
CODE:
|
||||
storagePutNP(write, buffer);
|
||||
storagePutP(write, buffer);
|
||||
RETVAL = buffer ? bufUsed(buffer) : 0;
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
@ -100,7 +100,7 @@ storageManifestXsCallback(void *callbackData, const StorageInfo *info)
|
||||
.path = data->path == NULL ? info->name : strNewFmt("%s/%s", strPtr(data->path), strPtr(info->name)),
|
||||
};
|
||||
|
||||
storageInfoListNP(
|
||||
storageInfoListP(
|
||||
dataSub.storage, strNewFmt("%s/%s", strPtr(dataSub.pathRoot), strPtr(dataSub.path)), storageManifestXsCallback,
|
||||
&dataSub);
|
||||
}
|
||||
|
178
src/Makefile.in
178
src/Makefile.in
@ -213,94 +213,94 @@ clean:
|
||||
####################################################################################################################################
|
||||
# Compile rules
|
||||
####################################################################################################################################
|
||||
command/archive/common.o: command/archive/common.c build.auto.h command/archive/common.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/wait.h config/config.auto.h config/config.h config/define.auto.h config/define.h postgres/version.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/archive/common.o: command/archive/common.c build.auto.h command/archive/common.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/wait.h config/config.auto.h config/config.h config/define.auto.h config/define.h postgres/version.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/archive/common.c -o command/archive/common.o
|
||||
|
||||
command/archive/get/file.o: command/archive/get/file.c build.auto.h command/archive/common.h command/archive/get/file.h command/control/common.h common/assert.h common/compress/gzip/common.h common/compress/gzip/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h info/info.h info/infoArchive.h info/infoPg.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/archive/get/file.o: command/archive/get/file.c build.auto.h command/archive/common.h command/archive/get/file.h command/control/common.h common/assert.h common/compress/gzip/common.h common/compress/gzip/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h info/info.h info/infoArchive.h info/infoPg.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/archive/get/file.c -o command/archive/get/file.o
|
||||
|
||||
command/archive/get/get.o: command/archive/get/get.c build.auto.h command/archive/common.h command/archive/get/file.h command/archive/get/protocol.h command/command.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/fork.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/wait.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/exec.h perl/exec.h postgres/interface.h protocol/client.h protocol/command.h protocol/helper.h protocol/parallel.h protocol/parallelJob.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/archive/get/get.o: command/archive/get/get.c build.auto.h command/archive/common.h command/archive/get/file.h command/archive/get/protocol.h command/command.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/fork.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/wait.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/exec.h perl/exec.h postgres/interface.h protocol/client.h protocol/command.h protocol/helper.h protocol/parallel.h protocol/parallelJob.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/archive/get/get.c -o command/archive/get/get.o
|
||||
|
||||
command/archive/get/protocol.o: command/archive/get/protocol.c build.auto.h command/archive/get/file.h command/archive/get/protocol.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/archive/get/protocol.o: command/archive/get/protocol.c build.auto.h command/archive/get/file.h command/archive/get/protocol.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/archive/get/protocol.c -o command/archive/get/protocol.o
|
||||
|
||||
command/archive/push/file.o: command/archive/push/file.c build.auto.h command/archive/common.h command/archive/push/file.h command/control/common.h common/assert.h common/compress/gzip/common.h common/compress/gzip/compress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/archive/push/file.o: command/archive/push/file.c build.auto.h command/archive/common.h command/archive/push/file.h command/control/common.h common/assert.h common/compress/gzip/common.h common/compress/gzip/compress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/archive/push/file.c -o command/archive/push/file.o
|
||||
|
||||
command/archive/push/protocol.o: command/archive/push/protocol.c build.auto.h command/archive/push/file.h command/archive/push/protocol.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/archive/push/protocol.o: command/archive/push/protocol.c build.auto.h command/archive/push/file.h command/archive/push/protocol.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/archive/push/protocol.c -o command/archive/push/protocol.o
|
||||
|
||||
command/archive/push/push.o: command/archive/push/push.c build.auto.h command/archive/common.h command/archive/push/file.h command/archive/push/protocol.h command/command.h command/control/common.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/fork.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/wait.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/exec.h info/info.h info/infoArchive.h info/infoPg.h postgres/interface.h protocol/client.h protocol/command.h protocol/helper.h protocol/parallel.h protocol/parallelJob.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/archive/push/push.o: command/archive/push/push.c build.auto.h command/archive/common.h command/archive/push/file.h command/archive/push/protocol.h command/command.h command/control/common.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/fork.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/wait.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/exec.h info/info.h info/infoArchive.h info/infoPg.h postgres/interface.h protocol/client.h protocol/command.h protocol/helper.h protocol/parallel.h protocol/parallelJob.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/archive/push/push.c -o command/archive/push/push.o
|
||||
|
||||
command/backup/common.o: command/backup/common.c build.auto.h command/backup/common.h common/assert.h common/debug.h common/error.auto.h common/error.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/string.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/backup/common.c -o command/backup/common.o
|
||||
|
||||
command/backup/file.o: command/backup/file.c build.auto.h command/backup/file.h command/backup/pageChecksum.h common/assert.h common/compress/gzip/common.h common/compress/gzip/compress.h common/compress/gzip/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/filter/size.h common/io/io.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/backup/file.o: command/backup/file.c build.auto.h command/backup/file.h command/backup/pageChecksum.h common/assert.h common/compress/gzip/common.h common/compress/gzip/compress.h common/compress/gzip/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/filter/size.h common/io/io.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/backup/file.c -o command/backup/file.o
|
||||
|
||||
command/backup/pageChecksum.o: command/backup/pageChecksum.c build.auto.h command/backup/pageChecksum.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/filter.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/pageChecksum.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/backup/pageChecksum.c -o command/backup/pageChecksum.o
|
||||
|
||||
command/backup/protocol.o: command/backup/protocol.c build.auto.h command/backup/file.h command/backup/protocol.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/backup/protocol.o: command/backup/protocol.c build.auto.h command/backup/file.h command/backup/protocol.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/backup/protocol.c -o command/backup/protocol.o
|
||||
|
||||
command/check/check.o: command/check/check.c build.auto.h command/archive/common.h command/check/check.h command/check/common.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h db/db.h db/helper.h info/info.h info/infoArchive.h info/infoPg.h postgres/client.h postgres/interface.h protocol/client.h protocol/command.h protocol/helper.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/check/check.o: command/check/check.c build.auto.h command/archive/common.h command/check/check.h command/check/common.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h db/db.h db/helper.h info/info.h info/infoArchive.h info/infoPg.h postgres/client.h postgres/interface.h protocol/client.h protocol/command.h protocol/helper.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/check/check.c -o command/check/check.o
|
||||
|
||||
command/check/common.o: command/check/common.c build.auto.h command/backup/common.h command/check/common.h common/assert.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h db/db.h db/helper.h info/info.h info/infoArchive.h info/infoBackup.h info/infoPg.h info/manifest.h postgres/client.h postgres/interface.h protocol/client.h protocol/command.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
command/check/common.o: command/check/common.c build.auto.h command/backup/common.h command/check/common.h common/assert.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h db/db.h db/helper.h info/info.h info/infoArchive.h info/infoBackup.h info/infoPg.h info/manifest.h postgres/client.h postgres/interface.h protocol/client.h protocol/command.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/check/common.c -o command/check/common.o
|
||||
|
||||
command/command.o: command/command.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/http/client.h common/io/http/header.h common/io/http/query.h common/io/read.h common/io/tls/client.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h version.h
|
||||
command/command.o: command/command.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/http/client.h common/io/http/header.h common/io/http/query.h common/io/read.h common/io/tls/client.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/command.c -o command/command.o
|
||||
|
||||
command/control/common.o: command/control/common.c build.auto.h command/control/common.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/control/common.o: command/control/common.c build.auto.h command/control/common.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/control/common.c -o command/control/common.o
|
||||
|
||||
command/control/start.o: command/control/start.c build.auto.h command/control/common.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/control/start.o: command/control/start.c build.auto.h command/control/common.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/control/start.c -o command/control/start.o
|
||||
|
||||
command/control/stop.o: command/control/stop.c build.auto.h command/control/common.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/read.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
command/control/stop.o: command/control/stop.c build.auto.h command/control/common.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/read.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/control/stop.c -o command/control/stop.o
|
||||
|
||||
command/expire/expire.o: command/expire/expire.c build.auto.h command/archive/common.h command/backup/common.h common/assert.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h info/info.h info/infoArchive.h info/infoBackup.h info/infoPg.h info/manifest.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/expire/expire.o: command/expire/expire.c build.auto.h command/archive/common.h command/backup/common.h common/assert.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h info/info.h info/infoArchive.h info/infoBackup.h info/infoPg.h info/manifest.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/expire/expire.c -o command/expire/expire.o
|
||||
|
||||
command/help/help.o: command/help/help.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/handleWrite.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h version.h
|
||||
command/help/help.o: command/help/help.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/handleWrite.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/help/help.c -o command/help/help.o
|
||||
|
||||
command/info/info.o: command/info/info.c build.auto.h command/archive/common.h command/backup/common.h command/info/info.h common/assert.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/handleWrite.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h info/info.h info/infoArchive.h info/infoBackup.h info/infoPg.h info/manifest.h perl/exec.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/info/info.o: command/info/info.c build.auto.h command/archive/common.h command/backup/common.h command/info/info.h common/assert.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/handleWrite.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h info/info.h info/infoArchive.h info/infoBackup.h info/infoPg.h info/manifest.h perl/exec.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/info/info.c -o command/info/info.o
|
||||
|
||||
command/local/local.o: command/local/local.c build.auto.h command/archive/get/protocol.h command/archive/push/protocol.h command/backup/protocol.h command/restore/protocol.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/handleRead.h common/io/handleWrite.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/protocol.h protocol/client.h protocol/command.h protocol/helper.h protocol/server.h
|
||||
command/local/local.o: command/local/local.c build.auto.h command/archive/get/protocol.h command/archive/push/protocol.h command/backup/protocol.h command/restore/protocol.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/handleRead.h common/io/handleWrite.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/protocol.h protocol/client.h protocol/command.h protocol/helper.h protocol/server.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/local/local.c -o command/local/local.o
|
||||
|
||||
command/remote/remote.o: command/remote/remote.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/handleRead.h common/io/handleWrite.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/protocol.h db/protocol.h protocol/client.h protocol/command.h protocol/helper.h protocol/server.h storage/remote/protocol.h
|
||||
command/remote/remote.o: command/remote/remote.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/handleRead.h common/io/handleWrite.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/protocol.h db/protocol.h protocol/client.h protocol/command.h protocol/helper.h protocol/server.h storage/remote/protocol.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/remote/remote.c -o command/remote/remote.o
|
||||
|
||||
command/restore/file.o: command/restore/file.c build.auto.h command/restore/file.h common/assert.h common/compress/gzip/common.h common/compress/gzip/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/filter/size.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/restore/file.o: command/restore/file.c build.auto.h command/restore/file.h common/assert.h common/compress/gzip/common.h common/compress/gzip/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/filter/size.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/restore/file.c -o command/restore/file.o
|
||||
|
||||
command/restore/protocol.o: command/restore/protocol.c build.auto.h command/restore/file.h command/restore/protocol.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/restore/protocol.o: command/restore/protocol.c build.auto.h command/restore/file.h command/restore/protocol.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/restore/protocol.c -o command/restore/protocol.o
|
||||
|
||||
command/restore/restore.o: command/restore/restore.c build.auto.h command/backup/common.h command/restore/protocol.h command/restore/restore.h common/assert.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/io/write.intern.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/user.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/exec.h info/info.h info/infoBackup.h info/infoPg.h info/manifest.h postgres/interface.h postgres/version.h protocol/client.h protocol/command.h protocol/helper.h protocol/parallel.h protocol/parallelJob.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h storage/write.intern.h version.h
|
||||
command/restore/restore.o: command/restore/restore.c build.auto.h command/backup/common.h command/restore/protocol.h command/restore/restore.h common/assert.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/io/write.intern.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/user.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/exec.h info/info.h info/infoBackup.h info/infoPg.h info/manifest.h postgres/interface.h postgres/version.h protocol/client.h protocol/command.h protocol/helper.h protocol/parallel.h protocol/parallelJob.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/restore/restore.c -o command/restore/restore.o
|
||||
|
||||
command/stanza/common.o: command/stanza/common.c build.auto.h command/check/common.h common/assert.h common/crypto/common.h common/debug.h common/encode.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h db/db.h db/helper.h info/info.h info/infoPg.h postgres/client.h postgres/interface.h postgres/version.h protocol/client.h protocol/command.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/stanza/common.o: command/stanza/common.c build.auto.h command/check/common.h common/assert.h common/crypto/common.h common/debug.h common/encode.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h db/db.h db/helper.h info/info.h info/infoPg.h postgres/client.h postgres/interface.h postgres/version.h protocol/client.h protocol/command.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/stanza/common.c -o command/stanza/common.o
|
||||
|
||||
command/stanza/create.o: command/stanza/create.c build.auto.h command/backup/common.h command/check/common.h command/control/common.h command/stanza/common.h command/stanza/create.h common/assert.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h db/db.h info/info.h info/infoArchive.h info/infoBackup.h info/infoPg.h info/manifest.h postgres/client.h postgres/interface.h postgres/version.h protocol/client.h protocol/command.h protocol/helper.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/stanza/create.o: command/stanza/create.c build.auto.h command/backup/common.h command/check/common.h command/control/common.h command/stanza/common.h command/stanza/create.h common/assert.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h db/db.h info/info.h info/infoArchive.h info/infoBackup.h info/infoPg.h info/manifest.h postgres/client.h postgres/interface.h postgres/version.h protocol/client.h protocol/command.h protocol/helper.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/stanza/create.c -o command/stanza/create.o
|
||||
|
||||
command/stanza/delete.o: command/stanza/delete.c build.auto.h command/backup/common.h command/control/common.h command/stanza/delete.h common/assert.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h info/info.h info/infoArchive.h info/infoBackup.h info/infoPg.h info/manifest.h postgres/interface.h protocol/client.h protocol/command.h protocol/helper.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/stanza/delete.o: command/stanza/delete.c build.auto.h command/backup/common.h command/control/common.h command/stanza/delete.h common/assert.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h info/info.h info/infoArchive.h info/infoBackup.h info/infoPg.h info/manifest.h postgres/interface.h protocol/client.h protocol/command.h protocol/helper.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/stanza/delete.c -o command/stanza/delete.o
|
||||
|
||||
command/stanza/upgrade.o: command/stanza/upgrade.c build.auto.h command/backup/common.h command/check/common.h command/control/common.h command/stanza/common.h command/stanza/upgrade.h common/assert.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h db/db.h info/info.h info/infoArchive.h info/infoBackup.h info/infoPg.h info/manifest.h postgres/client.h postgres/interface.h postgres/version.h protocol/client.h protocol/command.h protocol/helper.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/stanza/upgrade.o: command/stanza/upgrade.c build.auto.h command/backup/common.h command/check/common.h command/control/common.h command/stanza/common.h command/stanza/upgrade.h common/assert.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h db/db.h info/info.h info/infoArchive.h info/infoBackup.h info/infoPg.h info/manifest.h postgres/client.h postgres/interface.h postgres/version.h protocol/client.h protocol/command.h protocol/helper.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/stanza/upgrade.c -o command/stanza/upgrade.o
|
||||
|
||||
command/storage/list.o: command/storage/list.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/handleWrite.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/storage/list.o: command/storage/list.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/handleWrite.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/storage/list.c -o command/storage/list.o
|
||||
|
||||
common/compress/gzip/common.o: common/compress/gzip/common.c build.auto.h common/assert.h common/compress/gzip/common.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/memContext.h common/stackTrace.h common/type/convert.h
|
||||
@ -336,7 +336,7 @@ common/error.o: common/error.c build.auto.h common/error.auto.c common/error.aut
|
||||
common/exec.o: common/exec.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/exec.h common/io/filter/filter.h common/io/filter/group.h common/io/handleRead.h common/io/handleWrite.h common/io/io.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/variant.h common/type/variantList.h common/wait.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/exec.c -o common/exec.o
|
||||
|
||||
common/exit.o: common/exit.c build.auto.h command/command.h common/assert.h common/debug.h common/error.auto.h common/error.h common/exit.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h perl/exec.h protocol/client.h protocol/command.h protocol/helper.h
|
||||
common/exit.o: common/exit.c build.auto.h command/command.h common/assert.h common/debug.h common/error.auto.h common/error.h common/exit.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h perl/exec.h protocol/client.h protocol/command.h protocol/helper.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/exit.c -o common/exit.o
|
||||
|
||||
common/fork.o: common/fork.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/log.h common/logLevel.h common/stackTrace.h common/type/convert.h
|
||||
@ -357,7 +357,7 @@ common/io/filter/buffer.o: common/io/filter/buffer.c build.auto.h common/assert.
|
||||
common/io/filter/filter.o: common/io/filter/filter.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/filter.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/io/filter/filter.c -o common/io/filter/filter.o
|
||||
|
||||
common/io/filter/group.o: common/io/filter/group.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/buffer.h common/io/filter/filter.h common/io/filter/filter.intern.h common/io/filter/group.h common/io/io.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
common/io/filter/group.o: common/io/filter/group.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/buffer.h common/io/filter/filter.h common/io/filter/filter.intern.h common/io/filter/group.h common/io/io.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/io/filter/group.c -o common/io/filter/group.o
|
||||
|
||||
common/io/filter/sink.o: common/io/filter/sink.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/filter.intern.h common/io/filter/sink.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
@ -372,19 +372,19 @@ common/io/handleRead.o: common/io/handleRead.c build.auto.h common/assert.h comm
|
||||
common/io/handleWrite.o: common/io/handleWrite.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/handleWrite.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/io/handleWrite.c -o common/io/handleWrite.o
|
||||
|
||||
common/io/http/cache.o: common/io/http/cache.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/http/cache.h common/io/http/client.h common/io/http/header.h common/io/http/query.h common/io/read.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
common/io/http/cache.o: common/io/http/cache.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/http/cache.h common/io/http/client.h common/io/http/header.h common/io/http/query.h common/io/read.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/io/http/cache.c -o common/io/http/cache.o
|
||||
|
||||
common/io/http/client.o: common/io/http/client.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/http/client.h common/io/http/common.h common/io/http/header.h common/io/http/query.h common/io/io.h common/io/read.h common/io/read.intern.h common/io/tls/client.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/wait.h
|
||||
common/io/http/client.o: common/io/http/client.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/http/client.h common/io/http/common.h common/io/http/header.h common/io/http/query.h common/io/io.h common/io/read.h common/io/read.intern.h common/io/tls/client.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/wait.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/io/http/client.c -o common/io/http/client.o
|
||||
|
||||
common/io/http/common.o: common/io/http/common.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/http/common.h common/logLevel.h common/memContext.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/string.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/io/http/common.c -o common/io/http/common.o
|
||||
|
||||
common/io/http/header.o: common/io/http/header.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/http/header.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
common/io/http/header.o: common/io/http/header.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/http/header.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/io/http/header.c -o common/io/http/header.o
|
||||
|
||||
common/io/http/query.o: common/io/http/query.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/http/common.h common/io/http/query.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
common/io/http/query.o: common/io/http/query.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/http/common.h common/io/http/query.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/io/http/query.c -o common/io/http/query.o
|
||||
|
||||
common/io/io.o: common/io/io.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/sink.h common/io/io.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/variant.h common/type/variantList.h
|
||||
@ -399,7 +399,7 @@ common/io/tls/client.o: common/io/tls/client.c build.auto.h common/assert.h comm
|
||||
common/io/write.o: common/io/write.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/io/write.c -o common/io/write.o
|
||||
|
||||
common/lock.o: common/lock.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/handleWrite.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/wait.h storage/helper.h storage/info.h storage/read.h storage/read.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
common/lock.o: common/lock.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/handleWrite.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/wait.h storage/helper.h storage/info.h storage/read.h storage/read.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/lock.c -o common/lock.o
|
||||
|
||||
common/log.o: common/log.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/log.h common/logLevel.h common/stackTrace.h common/time.h common/type/convert.h
|
||||
@ -426,28 +426,28 @@ common/type/convert.o: common/type/convert.c build.auto.h common/assert.h common
|
||||
common/type/json.o: common/type/json.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/log.h common/logLevel.h common/stackTrace.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/type/json.c -o common/type/json.o
|
||||
|
||||
common/type/keyValue.o: common/type/keyValue.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
common/type/keyValue.o: common/type/keyValue.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/type/keyValue.c -o common/type/keyValue.o
|
||||
|
||||
common/type/list.o: common/type/list.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/list.h common/type/string.h
|
||||
common/type/list.o: common/type/list.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/list.h common/type/param.h common/type/string.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/type/list.c -o common/type/list.o
|
||||
|
||||
common/type/mcv.o: common/type/mcv.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/mcv.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
common/type/mcv.o: common/type/mcv.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/mcv.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/type/mcv.c -o common/type/mcv.o
|
||||
|
||||
common/type/string.o: common/type/string.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/macro.h common/memContext.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
common/type/string.o: common/type/string.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/macro.h common/memContext.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/type/string.c -o common/type/string.o
|
||||
|
||||
common/type/stringList.o: common/type/stringList.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/memContext.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
common/type/stringList.o: common/type/stringList.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/memContext.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/type/stringList.c -o common/type/stringList.o
|
||||
|
||||
common/type/variant.o: common/type/variant.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/memContext.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/type/variant.c -o common/type/variant.o
|
||||
|
||||
common/type/variantList.o: common/type/variantList.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/memContext.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
common/type/variantList.o: common/type/variantList.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/memContext.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/type/variantList.c -o common/type/variantList.o
|
||||
|
||||
common/type/xml.o: common/type/xml.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/list.h common/type/string.h common/type/xml.h
|
||||
common/type/xml.o: common/type/xml.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/list.h common/type/param.h common/type/string.h common/type/xml.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/type/xml.c -o common/type/xml.o
|
||||
|
||||
common/user.o: common/user.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/memContext.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/string.h common/user.h
|
||||
@ -456,100 +456,100 @@ common/user.o: common/user.c build.auto.h common/assert.h common/debug.h common/
|
||||
common/wait.o: common/wait.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/convert.h common/wait.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/wait.c -o common/wait.o
|
||||
|
||||
config/config.o: config/config.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.c config/config.auto.h config/config.h config/define.auto.h config/define.h
|
||||
config/config.o: config/config.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.c config/config.auto.h config/config.h config/define.auto.h config/define.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c config/config.c -o config/config.o
|
||||
|
||||
config/define.o: config/define.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/memContext.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/string.h config/define.auto.c config/define.auto.h config/define.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c config/define.c -o config/define.o
|
||||
|
||||
config/exec.o: config/exec.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/exec.h
|
||||
config/exec.o: config/exec.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/exec.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c config/exec.c -o config/exec.o
|
||||
|
||||
config/load.o: config/load.c build.auto.h command/command.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/io.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/load.h config/parse.h
|
||||
config/load.o: config/load.c build.auto.h command/command.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/io.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/load.h config/parse.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c config/load.c -o config/load.o
|
||||
|
||||
config/parse.o: config/parse.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/parse.auto.c config/parse.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
config/parse.o: config/parse.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/parse.auto.c config/parse.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c config/parse.c -o config/parse.o
|
||||
|
||||
config/protocol.o: config/protocol.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/protocol.h protocol/client.h protocol/command.h protocol/server.h
|
||||
config/protocol.o: config/protocol.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/protocol.h protocol/client.h protocol/command.h protocol/server.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c config/protocol.c -o config/protocol.o
|
||||
|
||||
db/db.o: db/db.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h db/db.h db/protocol.h postgres/client.h postgres/interface.h postgres/version.h protocol/client.h protocol/command.h protocol/server.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
db/db.o: db/db.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h db/db.h db/protocol.h postgres/client.h postgres/interface.h postgres/version.h protocol/client.h protocol/command.h protocol/server.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c db/db.c -o db/db.o
|
||||
|
||||
db/helper.o: db/helper.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h db/db.h db/helper.h postgres/client.h postgres/interface.h protocol/client.h protocol/command.h protocol/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
db/helper.o: db/helper.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h db/db.h db/helper.h postgres/client.h postgres/interface.h protocol/client.h protocol/command.h protocol/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c db/helper.c -o db/helper.o
|
||||
|
||||
db/protocol.o: db/protocol.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h db/protocol.h postgres/client.h postgres/interface.h protocol/client.h protocol/command.h protocol/server.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
db/protocol.o: db/protocol.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h db/protocol.h postgres/client.h postgres/interface.h protocol/client.h protocol/command.h protocol/server.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c db/protocol.c -o db/protocol.o
|
||||
|
||||
info/info.o: info/info.c build.auto.h common/assert.h common/crypto/hash.h common/debug.h common/encode.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/filter.intern.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h info/info.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
info/info.o: info/info.c build.auto.h common/assert.h common/crypto/hash.h common/debug.h common/encode.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/filter.intern.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h info/info.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c info/info.c -o info/info.o
|
||||
|
||||
info/infoArchive.o: info/infoArchive.c build.auto.h common/assert.h common/crypto/cipherBlock.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h info/info.h info/infoArchive.h info/infoPg.h postgres/interface.h postgres/version.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
info/infoArchive.o: info/infoArchive.c build.auto.h common/assert.h common/crypto/cipherBlock.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h info/info.h info/infoArchive.h info/infoPg.h postgres/interface.h postgres/version.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c info/infoArchive.c -o info/infoArchive.o
|
||||
|
||||
info/infoBackup.o: info/infoBackup.c build.auto.h command/backup/common.h common/assert.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h info/info.h info/infoBackup.h info/infoPg.h info/manifest.h postgres/interface.h postgres/version.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
info/infoBackup.o: info/infoBackup.c build.auto.h command/backup/common.h common/assert.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h info/info.h info/infoBackup.h info/infoPg.h info/manifest.h postgres/interface.h postgres/version.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c info/infoBackup.c -o info/infoBackup.o
|
||||
|
||||
info/infoPg.o: info/infoPg.c build.auto.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h info/info.h info/infoPg.h postgres/interface.h postgres/version.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
info/infoPg.o: info/infoPg.c build.auto.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h info/info.h info/infoPg.h postgres/interface.h postgres/version.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c info/infoPg.c -o info/infoPg.o
|
||||
|
||||
info/manifest.o: info/manifest.c build.auto.h command/backup/common.h common/assert.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/mcv.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h info/info.h info/manifest.h postgres/interface.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
info/manifest.o: info/manifest.c build.auto.h command/backup/common.h common/assert.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/mcv.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h info/info.h info/manifest.h postgres/interface.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c info/manifest.c -o info/manifest.o
|
||||
|
||||
main.o: main.c build.auto.h command/archive/get/get.h command/archive/push/push.h command/check/check.h command/command.h command/control/start.h command/control/stop.h command/expire/expire.h command/help/help.h command/info/info.h command/local/local.h command/remote/remote.h command/restore/restore.h command/stanza/create.h command/stanza/delete.h command/stanza/upgrade.h command/storage/list.h common/assert.h common/debug.h common/error.auto.h common/error.h common/exit.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/load.h perl/exec.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
main.o: main.c build.auto.h command/archive/get/get.h command/archive/push/push.h command/check/check.h command/command.h command/control/start.h command/control/stop.h command/expire/expire.h command/help/help.h command/info/info.h command/local/local.h command/remote/remote.h command/restore/restore.h command/stanza/create.h command/stanza/delete.h command/stanza/upgrade.h command/storage/list.h common/assert.h common/debug.h common/error.auto.h common/error.h common/exit.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/load.h perl/exec.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c main.c -o main.o
|
||||
|
||||
perl/config.o: perl/config.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h
|
||||
perl/config.o: perl/config.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c perl/config.c -o perl/config.o
|
||||
|
||||
perl/exec.o: perl/exec.c ../libc/LibC.h build.auto.h common/assert.h common/compress/gzip/compress.h common/compress/gzip/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/encode.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/filter/size.h common/io/http/client.h common/io/http/header.h common/io/http/query.h common/io/io.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/load.h config/parse.h perl/config.h perl/embed.auto.c perl/exec.h perl/libc.auto.c postgres/client.h postgres/interface.h postgres/pageChecksum.h storage/helper.h storage/info.h storage/posix/storage.h storage/read.h storage/read.intern.h storage/s3/storage.h storage/s3/storage.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h ../libc/xs/common/encode.xsh ../libc/xs/crypto/hash.xsh ../libc/xs/postgres/client.xsh ../libc/xs/storage/storage.xsh ../libc/xs/storage/storageRead.xsh ../libc/xs/storage/storageWrite.xsh
|
||||
perl/exec.o: perl/exec.c ../libc/LibC.h build.auto.h common/assert.h common/compress/gzip/compress.h common/compress/gzip/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/encode.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/filter/size.h common/io/http/client.h common/io/http/header.h common/io/http/query.h common/io/io.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/load.h config/parse.h perl/config.h perl/embed.auto.c perl/exec.h perl/libc.auto.c postgres/client.h postgres/interface.h postgres/pageChecksum.h storage/helper.h storage/info.h storage/posix/storage.h storage/read.h storage/read.intern.h storage/s3/storage.h storage/s3/storage.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h ../libc/xs/common/encode.xsh ../libc/xs/crypto/hash.xsh ../libc/xs/postgres/client.xsh ../libc/xs/storage/storage.xsh ../libc/xs/storage/storageRead.xsh ../libc/xs/storage/storageWrite.xsh
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c perl/exec.c -o perl/exec.o
|
||||
|
||||
postgres/client.o: postgres/client.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/wait.h postgres/client.h
|
||||
postgres/client.o: postgres/client.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/wait.h postgres/client.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c postgres/client.c -o postgres/client.o
|
||||
|
||||
postgres/interface.o: postgres/interface.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.h postgres/version.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
postgres/interface.o: postgres/interface.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.h postgres/version.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c postgres/interface.c -o postgres/interface.o
|
||||
|
||||
postgres/interface/v083.o: postgres/interface/v083.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
postgres/interface/v083.o: postgres/interface/v083.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c postgres/interface/v083.c -o postgres/interface/v083.o
|
||||
|
||||
postgres/interface/v084.o: postgres/interface/v084.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
postgres/interface/v084.o: postgres/interface/v084.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c postgres/interface/v084.c -o postgres/interface/v084.o
|
||||
|
||||
postgres/interface/v090.o: postgres/interface/v090.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
postgres/interface/v090.o: postgres/interface/v090.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c postgres/interface/v090.c -o postgres/interface/v090.o
|
||||
|
||||
postgres/interface/v091.o: postgres/interface/v091.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
postgres/interface/v091.o: postgres/interface/v091.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c postgres/interface/v091.c -o postgres/interface/v091.o
|
||||
|
||||
postgres/interface/v092.o: postgres/interface/v092.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
postgres/interface/v092.o: postgres/interface/v092.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c postgres/interface/v092.c -o postgres/interface/v092.o
|
||||
|
||||
postgres/interface/v093.o: postgres/interface/v093.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
postgres/interface/v093.o: postgres/interface/v093.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c postgres/interface/v093.c -o postgres/interface/v093.o
|
||||
|
||||
postgres/interface/v094.o: postgres/interface/v094.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
postgres/interface/v094.o: postgres/interface/v094.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c postgres/interface/v094.c -o postgres/interface/v094.o
|
||||
|
||||
postgres/interface/v095.o: postgres/interface/v095.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
postgres/interface/v095.o: postgres/interface/v095.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c postgres/interface/v095.c -o postgres/interface/v095.o
|
||||
|
||||
postgres/interface/v096.o: postgres/interface/v096.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
postgres/interface/v096.o: postgres/interface/v096.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c postgres/interface/v096.c -o postgres/interface/v096.o
|
||||
|
||||
postgres/interface/v100.o: postgres/interface/v100.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
postgres/interface/v100.o: postgres/interface/v100.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c postgres/interface/v100.c -o postgres/interface/v100.o
|
||||
|
||||
postgres/interface/v110.o: postgres/interface/v110.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
postgres/interface/v110.o: postgres/interface/v110.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c postgres/interface/v110.c -o postgres/interface/v110.o
|
||||
|
||||
postgres/interface/v120.o: postgres/interface/v120.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
postgres/interface/v120.o: postgres/interface/v120.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/interface/version.auto.h postgres/interface/version.h postgres/interface/version.intern.h postgres/version.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c postgres/interface/v120.c -o postgres/interface/v120.o
|
||||
|
||||
postgres/pageChecksum.o: postgres/pageChecksum.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/pageChecksum.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
postgres/pageChecksum.o: postgres/pageChecksum.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h postgres/interface.h postgres/pageChecksum.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) @COPTIMIZE_PAGE_CHECKSUM@ -c postgres/pageChecksum.c -o postgres/pageChecksum.o
|
||||
|
||||
protocol/client.o: protocol/client.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/string.h common/type/variant.h common/type/variantList.h protocol/client.h protocol/command.h version.h
|
||||
@ -558,58 +558,58 @@ protocol/client.o: protocol/client.c build.auto.h common/assert.h common/debug.h
|
||||
protocol/command.o: protocol/command.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/string.h common/type/variant.h common/type/variantList.h protocol/command.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c protocol/command.c -o protocol/command.o
|
||||
|
||||
protocol/helper.o: protocol/helper.c build.auto.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/exec.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/exec.h config/protocol.h protocol/client.h protocol/command.h protocol/helper.h protocol/server.h
|
||||
protocol/helper.o: protocol/helper.c build.auto.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/exec.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/exec.h config/protocol.h protocol/client.h protocol/command.h protocol/helper.h protocol/server.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c protocol/helper.c -o protocol/helper.o
|
||||
|
||||
protocol/parallel.o: protocol/parallel.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/variant.h common/type/variantList.h protocol/client.h protocol/command.h protocol/parallel.h protocol/parallelJob.h
|
||||
protocol/parallel.o: protocol/parallel.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/variant.h common/type/variantList.h protocol/client.h protocol/command.h protocol/parallel.h protocol/parallelJob.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c protocol/parallel.c -o protocol/parallel.o
|
||||
|
||||
protocol/parallelJob.o: protocol/parallelJob.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/variant.h common/type/variantList.h protocol/client.h protocol/command.h protocol/parallelJob.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c protocol/parallelJob.c -o protocol/parallelJob.o
|
||||
|
||||
protocol/server.o: protocol/server.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/variant.h common/type/variantList.h protocol/client.h protocol/command.h protocol/helper.h protocol/server.h version.h
|
||||
protocol/server.o: protocol/server.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/variant.h common/type/variantList.h protocol/client.h protocol/command.h protocol/helper.h protocol/server.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c protocol/server.c -o protocol/server.o
|
||||
|
||||
storage/cifs/storage.o: storage/cifs/storage.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h storage/cifs/storage.h storage/info.h storage/posix/storage.h storage/posix/storage.intern.h storage/read.h storage/read.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
storage/cifs/storage.o: storage/cifs/storage.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h storage/cifs/storage.h storage/info.h storage/posix/storage.h storage/posix/storage.intern.h storage/read.h storage/read.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/cifs/storage.c -o storage/cifs/storage.o
|
||||
|
||||
storage/helper.o: storage/helper.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h protocol/client.h protocol/command.h protocol/helper.h storage/cifs/storage.h storage/helper.h storage/info.h storage/posix/storage.h storage/read.h storage/read.intern.h storage/remote/storage.h storage/s3/storage.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
storage/helper.o: storage/helper.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h protocol/client.h protocol/command.h protocol/helper.h storage/cifs/storage.h storage/helper.h storage/info.h storage/posix/storage.h storage/read.h storage/read.intern.h storage/remote/storage.h storage/s3/storage.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/helper.c -o storage/helper.o
|
||||
|
||||
storage/posix/read.o: storage/posix/read.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h storage/info.h storage/posix/read.h storage/posix/storage.h storage/posix/storage.intern.h storage/read.h storage/read.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
storage/posix/read.o: storage/posix/read.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h storage/info.h storage/posix/read.h storage/posix/storage.h storage/posix/storage.intern.h storage/read.h storage/read.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/posix/read.c -o storage/posix/read.o
|
||||
|
||||
storage/posix/storage.o: storage/posix/storage.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/user.h storage/info.h storage/posix/read.h storage/posix/storage.h storage/posix/storage.intern.h storage/posix/write.h storage/read.h storage/read.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
storage/posix/storage.o: storage/posix/storage.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/user.h storage/info.h storage/posix/read.h storage/posix/storage.h storage/posix/storage.intern.h storage/posix/write.h storage/read.h storage/read.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/posix/storage.c -o storage/posix/storage.o
|
||||
|
||||
storage/posix/write.o: storage/posix/write.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/user.h storage/info.h storage/posix/storage.h storage/posix/storage.intern.h storage/posix/write.h storage/read.h storage/read.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
storage/posix/write.o: storage/posix/write.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/user.h storage/info.h storage/posix/storage.h storage/posix/storage.intern.h storage/posix/write.h storage/read.h storage/read.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/posix/write.c -o storage/posix/write.o
|
||||
|
||||
storage/read.o: storage/read.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/variant.h common/type/variantList.h storage/read.h storage/read.intern.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/read.c -o storage/read.o
|
||||
|
||||
storage/remote/protocol.o: storage/remote/protocol.c build.auto.h command/backup/pageChecksum.h common/assert.h common/compress/gzip/compress.h common/compress/gzip/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/filter/sink.h common/io/filter/size.h common/io/io.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/read.intern.h storage/remote/protocol.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
storage/remote/protocol.o: storage/remote/protocol.c build.auto.h command/backup/pageChecksum.h common/assert.h common/compress/gzip/compress.h common/compress/gzip/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/filter/sink.h common/io/filter/size.h common/io/io.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/read.intern.h storage/remote/protocol.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/remote/protocol.c -o storage/remote/protocol.o
|
||||
|
||||
storage/remote/read.o: storage/remote/read.c build.auto.h common/assert.h common/compress/gzip/compress.h common/compress/gzip/decompress.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h protocol/client.h protocol/command.h protocol/server.h storage/info.h storage/read.h storage/read.intern.h storage/remote/protocol.h storage/remote/read.h storage/remote/storage.h storage/remote/storage.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
storage/remote/read.o: storage/remote/read.c build.auto.h common/assert.h common/compress/gzip/compress.h common/compress/gzip/decompress.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h protocol/client.h protocol/command.h protocol/server.h storage/info.h storage/read.h storage/read.intern.h storage/remote/protocol.h storage/remote/read.h storage/remote/storage.h storage/remote/storage.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/remote/read.c -o storage/remote/read.o
|
||||
|
||||
storage/remote/storage.o: storage/remote/storage.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h protocol/client.h protocol/command.h protocol/server.h storage/info.h storage/read.h storage/read.intern.h storage/remote/protocol.h storage/remote/read.h storage/remote/storage.h storage/remote/storage.intern.h storage/remote/write.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
storage/remote/storage.o: storage/remote/storage.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h protocol/client.h protocol/command.h protocol/server.h storage/info.h storage/read.h storage/read.intern.h storage/remote/protocol.h storage/remote/read.h storage/remote/storage.h storage/remote/storage.intern.h storage/remote/write.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/remote/storage.c -o storage/remote/storage.o
|
||||
|
||||
storage/remote/write.o: storage/remote/write.c build.auto.h common/assert.h common/compress/gzip/compress.h common/compress/gzip/decompress.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h protocol/client.h protocol/command.h protocol/server.h storage/info.h storage/read.h storage/read.intern.h storage/remote/protocol.h storage/remote/storage.h storage/remote/storage.intern.h storage/remote/write.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
storage/remote/write.o: storage/remote/write.c build.auto.h common/assert.h common/compress/gzip/compress.h common/compress/gzip/decompress.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h protocol/client.h protocol/command.h protocol/server.h storage/info.h storage/read.h storage/read.intern.h storage/remote/protocol.h storage/remote/storage.h storage/remote/storage.intern.h storage/remote/write.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/remote/write.c -o storage/remote/write.o
|
||||
|
||||
storage/s3/read.o: storage/s3/read.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/http/client.h common/io/http/header.h common/io/http/query.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h storage/info.h storage/read.h storage/read.intern.h storage/s3/read.h storage/s3/storage.h storage/s3/storage.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
storage/s3/read.o: storage/s3/read.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/http/client.h common/io/http/header.h common/io/http/query.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h storage/info.h storage/read.h storage/read.intern.h storage/s3/read.h storage/s3/storage.h storage/s3/storage.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/s3/read.c -o storage/s3/read.o
|
||||
|
||||
storage/s3/storage.o: storage/s3/storage.c build.auto.h common/assert.h common/crypto/hash.h common/debug.h common/encode.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/http/cache.h common/io/http/client.h common/io/http/common.h common/io/http/header.h common/io/http/query.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/type/xml.h storage/info.h storage/read.h storage/read.intern.h storage/s3/read.h storage/s3/storage.h storage/s3/storage.intern.h storage/s3/write.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
storage/s3/storage.o: storage/s3/storage.c build.auto.h common/assert.h common/crypto/hash.h common/debug.h common/encode.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/http/cache.h common/io/http/client.h common/io/http/common.h common/io/http/header.h common/io/http/query.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/type/xml.h storage/info.h storage/read.h storage/read.intern.h storage/s3/read.h storage/s3/storage.h storage/s3/storage.intern.h storage/s3/write.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/s3/storage.c -o storage/s3/storage.o
|
||||
|
||||
storage/s3/write.o: storage/s3/write.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/http/client.h common/io/http/header.h common/io/http/query.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/type/xml.h storage/info.h storage/read.h storage/read.intern.h storage/s3/storage.h storage/s3/storage.intern.h storage/s3/write.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
storage/s3/write.o: storage/s3/write.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/http/client.h common/io/http/header.h common/io/http/query.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/type/xml.h storage/info.h storage/read.h storage/read.intern.h storage/s3/storage.h storage/s3/storage.intern.h storage/s3/write.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/s3/write.c -o storage/s3/write.o
|
||||
|
||||
storage/storage.o: storage/storage.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/wait.h storage/info.h storage/read.h storage/read.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
storage/storage.o: storage/storage.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/variant.h common/type/variantList.h common/wait.h storage/info.h storage/read.h storage/read.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/storage.c -o storage/storage.o
|
||||
|
||||
storage/write.o: storage/write.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/variant.h common/type/variantList.h storage/write.h storage/write.intern.h version.h
|
||||
|
@ -70,20 +70,20 @@ archiveAsyncStatus(ArchiveMode archiveMode, const String *walSegment, bool confe
|
||||
const String *spoolQueue = archiveAsyncSpoolQueue(archiveMode);
|
||||
|
||||
String *okFile = strNewFmt("%s" STATUS_EXT_OK, strPtr(walSegment));
|
||||
bool okFileExists = storageExistsNP(storageSpool(), strNewFmt("%s/%s", strPtr(spoolQueue), strPtr(okFile)));
|
||||
bool okFileExists = storageExistsP(storageSpool(), strNewFmt("%s/%s", strPtr(spoolQueue), strPtr(okFile)));
|
||||
|
||||
// If the ok file does not exist then check to see if a file-specific or global error exists
|
||||
if (!okFileExists)
|
||||
{
|
||||
// Check for a file-specific error first
|
||||
errorFile = strNewFmt("%s" STATUS_EXT_ERROR, strPtr(walSegment));
|
||||
errorFileExists = storageExistsNP(storageSpool(), strNewFmt("%s/%s", strPtr(spoolQueue), strPtr(errorFile)));
|
||||
errorFileExists = storageExistsP(storageSpool(), strNewFmt("%s/%s", strPtr(spoolQueue), strPtr(errorFile)));
|
||||
|
||||
// If that doesn't exist then check for a global error
|
||||
if (!errorFileExists)
|
||||
{
|
||||
errorFile = STATUS_FILE_GLOBAL_ERROR_STR;
|
||||
errorFileExists = storageExistsNP(storageSpool(), strNewFmt("%s/%s", strPtr(spoolQueue), strPtr(errorFile)));
|
||||
errorFileExists = storageExistsP(storageSpool(), strNewFmt("%s/%s", strPtr(spoolQueue), strPtr(errorFile)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ archiveAsyncStatus(ArchiveMode archiveMode, const String *walSegment, bool confe
|
||||
const String *statusFile = okFileExists ? okFile: errorFile;
|
||||
|
||||
String *content = strNewBuf(
|
||||
storageGetNP(storageNewReadNP(storageSpool(), strNewFmt("%s/%s", strPtr(spoolQueue), strPtr(statusFile)))));
|
||||
storageGetP(storageNewReadP(storageSpool(), strNewFmt("%s/%s", strPtr(spoolQueue), strPtr(statusFile)))));
|
||||
|
||||
// Get the code and message if the file has content
|
||||
int code = 0;
|
||||
@ -173,8 +173,8 @@ archiveAsyncStatusErrorWrite(ArchiveMode archiveMode, const String *walSegment,
|
||||
{
|
||||
const String *errorFile = walSegment == NULL ? STATUS_FILE_GLOBAL_STR : walSegment;
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageSpoolWrite(),
|
||||
strNewFmt("%s/%s" STATUS_EXT_ERROR, strPtr(archiveAsyncSpoolQueue(archiveMode)), strPtr(errorFile))),
|
||||
BUFSTR(strNewFmt("%d\n%s", code, strPtr(message))));
|
||||
@ -201,8 +201,8 @@ archiveAsyncStatusOkWrite(ArchiveMode archiveMode, const String *walSegment, con
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
// Write file
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageSpoolWrite(),
|
||||
strNewFmt("%s/%s" STATUS_EXT_OK, strPtr(archiveAsyncSpoolQueue(archiveMode)), strPtr(walSegment))),
|
||||
warning == NULL ? NULL : BUFSTR(strNewFmt("0\n%s", strPtr(warning))));
|
||||
|
@ -78,7 +78,7 @@ archiveGetCheck(const String *archiveFile, CipherType cipherType, const String *
|
||||
}
|
||||
// Else if not a WAL segment, see if it exists in the archive dir
|
||||
else if (
|
||||
storageExistsNP(
|
||||
storageExistsP(
|
||||
storageRepo(), strNewFmt(STORAGE_REPO_ARCHIVE "/%s/%s", strPtr(archiveId), strPtr(archiveFile))))
|
||||
{
|
||||
archiveFileActual = archiveFile;
|
||||
@ -165,7 +165,7 @@ archiveGetFile(
|
||||
}
|
||||
|
||||
// Copy the file
|
||||
storageCopyNP(
|
||||
storageCopyP(
|
||||
storageNewReadP(
|
||||
storageRepo(), strNewFmt(STORAGE_REPO_ARCHIVE "/%s", strPtr(archiveGetCheckResult.archiveFileActual)),
|
||||
.compressible = compressible),
|
||||
|
@ -84,7 +84,7 @@ queueNeed(const String *walSegment, bool found, uint64_t queueSize, size_t walSe
|
||||
|
||||
// Else delete it
|
||||
else
|
||||
storageRemoveNP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_IN "/%s", strPtr(file)));
|
||||
storageRemoveP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_IN "/%s", strPtr(file)));
|
||||
}
|
||||
|
||||
// Generate a list of the WAL that are needed by removing kept WAL from the ideal queue
|
||||
@ -158,13 +158,13 @@ cmdArchiveGet(void)
|
||||
}
|
||||
|
||||
// Check if the WAL segment is already in the queue
|
||||
found = storageExistsNP(storageSpool(), strNewFmt(STORAGE_SPOOL_ARCHIVE_IN "/%s", strPtr(walSegment)));
|
||||
found = storageExistsP(storageSpool(), strNewFmt(STORAGE_SPOOL_ARCHIVE_IN "/%s", strPtr(walSegment)));
|
||||
|
||||
// If found then move the WAL segment to the destination directory
|
||||
if (found)
|
||||
{
|
||||
// Source is the WAL segment in the spool queue
|
||||
StorageRead *source = storageNewReadNP(
|
||||
StorageRead *source = storageNewReadP(
|
||||
storageSpool(), strNewFmt(STORAGE_SPOOL_ARCHIVE_IN "/%s", strPtr(walSegment)));
|
||||
|
||||
// A move will be attempted but if the spool queue and the WAL path are on different file systems then a copy
|
||||
@ -179,7 +179,7 @@ cmdArchiveGet(void)
|
||||
.noAtomic = true);
|
||||
|
||||
// Move (or copy if required) the file
|
||||
storageMoveNP(storageSpoolWrite(), source, destination);
|
||||
storageMoveP(storageSpoolWrite(), source, destination);
|
||||
|
||||
// Return success
|
||||
result = 0;
|
||||
@ -191,7 +191,7 @@ cmdArchiveGet(void)
|
||||
if (strLstSize(queue) > 0)
|
||||
{
|
||||
// Get size of the WAL segment
|
||||
uint64_t walSegmentSize = storageInfoNP(storageLocal(), walDestination).size;
|
||||
uint64_t walSegmentSize = storageInfoP(storageLocal(), walDestination).size;
|
||||
|
||||
// Use WAL segment size to estimate queue size and determine if the async process should be launched
|
||||
queueFull = strLstSize(queue) * walSegmentSize > cfgOptionUInt64(cfgOptArchiveGetQueueMax) / 2;
|
||||
@ -208,7 +208,7 @@ cmdArchiveGet(void)
|
||||
PgControl pgControl = pgControlFromFile(storagePg());
|
||||
|
||||
// Create the queue
|
||||
storagePathCreateNP(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_IN_STR);
|
||||
storagePathCreateP(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_IN_STR);
|
||||
|
||||
// The async process should not output on the console at all
|
||||
KeyValue *optionReplace = kvNew();
|
||||
|
@ -73,7 +73,7 @@ archivePushFile(
|
||||
if (isSegment)
|
||||
{
|
||||
// Generate a sha1 checksum for the wal segment
|
||||
IoRead *read = storageReadIo(storageNewReadNP(storageLocal(), walSource));
|
||||
IoRead *read = storageReadIo(storageNewReadP(storageLocal(), walSource));
|
||||
ioFilterGroupAdd(ioReadFilterGroup(read), cryptoHashNew(HASH_TYPE_SHA1_STR));
|
||||
ioReadDrain(read);
|
||||
|
||||
@ -106,7 +106,7 @@ archivePushFile(
|
||||
// Only copy if the file was not found in the archive
|
||||
if (walSegmentFile == NULL)
|
||||
{
|
||||
StorageRead *source = storageNewReadNP(storageLocal(), walSource);
|
||||
StorageRead *source = storageNewReadP(storageLocal(), walSource);
|
||||
|
||||
// Is the file compressible during the copy?
|
||||
bool compressible = true;
|
||||
@ -129,7 +129,7 @@ archivePushFile(
|
||||
}
|
||||
|
||||
// Copy the file
|
||||
storageCopyNP(
|
||||
storageCopyP(
|
||||
source,
|
||||
storageNewWriteP(
|
||||
storageRepoWrite(), strNewFmt(STORAGE_REPO_ARCHIVE "/%s/%s", strPtr(archiveId), strPtr(archiveDestination)),
|
||||
|
@ -62,7 +62,7 @@ archivePushDrop(const String *walPath, const StringList *const processList)
|
||||
|
||||
for (unsigned int processIdx = 0; processIdx < strLstSize(processList); processIdx++)
|
||||
{
|
||||
queueSize += storageInfoNP(
|
||||
queueSize += storageInfoP(
|
||||
storagePg(), strNewFmt("%s/%s", strPtr(walPath), strPtr(strLstGet(processList, processIdx)))).size;
|
||||
|
||||
if (queueSize > queueMax)
|
||||
@ -136,7 +136,7 @@ archivePushProcessList(const String *walPath)
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
// Create the spool out path if it does not already exist
|
||||
storagePathCreateNP(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT_STR);
|
||||
storagePathCreateP(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT_STR);
|
||||
|
||||
// Read the status files from the spool directory, then remove any files that do not end in ok and create a list of the
|
||||
// ok files for further processing
|
||||
|
@ -129,12 +129,12 @@ backupFile(
|
||||
// will remove it from the manifest)
|
||||
if (result.backupCopyResult == backupCopyResultSkip)
|
||||
{
|
||||
storageRemoveNP(storageRepoWrite(), repoPathFile);
|
||||
storageRemoveP(storageRepoWrite(), repoPathFile);
|
||||
}
|
||||
else if (!delta || pgFileMatch)
|
||||
{
|
||||
// Generate checksum/size for the repo file
|
||||
IoRead *read = storageReadIo(storageNewReadNP(storageRepo(), repoPathFile));
|
||||
IoRead *read = storageReadIo(storageNewReadP(storageRepo(), repoPathFile));
|
||||
|
||||
if (cipherType != cipherTypeNone)
|
||||
{
|
||||
@ -243,7 +243,7 @@ backupFile(
|
||||
storageFeature(storageRepo(), storageFeatureCompress)) ||
|
||||
result.backupCopyResult == backupCopyResultChecksum)
|
||||
{
|
||||
result.repoSize = storageInfoNP(storageRepo(), repoPathFile).size;
|
||||
result.repoSize = storageInfoP(storageRepo(), repoPathFile).size;
|
||||
}
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
@ -36,7 +36,7 @@ checkManifest(void)
|
||||
{
|
||||
result++;
|
||||
// ??? Placeholder for manifest build
|
||||
storageListNP(storagePgId(pgIdx + 1), varStr(cfgOption(cfgOptPgPath + pgIdx)));
|
||||
storageListP(storagePgId(pgIdx + 1), varStr(cfgOption(cfgOptPgPath + pgIdx)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,12 +37,12 @@ lockStopTest(void)
|
||||
// Check the current stanza (if any)
|
||||
if (cfgOptionTest(cfgOptStanza))
|
||||
{
|
||||
if (storageExistsNP(storageLocal(), lockStopFileName(cfgOptionStr(cfgOptStanza))))
|
||||
if (storageExistsP(storageLocal(), lockStopFileName(cfgOptionStr(cfgOptStanza))))
|
||||
THROW_FMT(StopError, "stop file exists for stanza %s", strPtr(cfgOptionStr(cfgOptStanza)));
|
||||
}
|
||||
|
||||
// Check all stanzas
|
||||
if (storageExistsNP(storageLocal(), lockStopFileName(NULL)))
|
||||
if (storageExistsP(storageLocal(), lockStopFileName(NULL)))
|
||||
THROW(StopError, "stop file exists for all stanzas");
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
@ -20,10 +20,10 @@ cmdStart(void)
|
||||
String *stopFile = lockStopFileName(cfgOptionStr(cfgOptStanza));
|
||||
|
||||
// If the stop file exists, then remove it
|
||||
if (storageExistsNP(storageLocal(), stopFile))
|
||||
if (storageExistsP(storageLocal(), stopFile))
|
||||
{
|
||||
// If the file cannot be removed, storageRemove() will throw an error if the error is not ENOENT
|
||||
storageRemoveNP(storageLocalWrite(), stopFile);
|
||||
storageRemoveP(storageLocalWrite(), stopFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ cmdStop(void)
|
||||
String *stopFile = lockStopFileName(cfgOptionStr(cfgOptStanza));
|
||||
|
||||
// If the stop file does not already exist, then create it
|
||||
if (!storageExistsNP(storageLocal(), stopFile))
|
||||
if (!storageExistsP(storageLocal(), stopFile))
|
||||
{
|
||||
// Create the lock path (ignore if already created)
|
||||
storagePathCreateP(storageLocalWrite(), strPath(stopFile), .mode = 0770);
|
||||
|
@ -59,8 +59,8 @@ expireBackup(InfoBackup *infoBackup, String *removeBackupLabel, String *backupEx
|
||||
ASSERT(removeBackupLabel != NULL);
|
||||
ASSERT(backupExpired != NULL);
|
||||
|
||||
storageRemoveNP(storageRepoWrite(), strNewFmt(STORAGE_REPO_BACKUP "/%s/" BACKUP_MANIFEST_FILE, strPtr(removeBackupLabel)));
|
||||
storageRemoveNP(
|
||||
storageRemoveP(storageRepoWrite(), strNewFmt(STORAGE_REPO_BACKUP "/%s/" BACKUP_MANIFEST_FILE, strPtr(removeBackupLabel)));
|
||||
storageRemoveP(
|
||||
storageRepoWrite(), strNewFmt(STORAGE_REPO_BACKUP "/%s/" BACKUP_MANIFEST_FILE INFO_COPY_EXT, strPtr(removeBackupLabel)));
|
||||
|
||||
// Remove the backup from the info object
|
||||
@ -545,7 +545,7 @@ removeExpiredArchive(InfoBackup *infoBackup)
|
||||
// Remove archive log if it is not used in a backup
|
||||
if (removeArchive)
|
||||
{
|
||||
storageRemoveNP(
|
||||
storageRemoveP(
|
||||
storageRepoWrite(),
|
||||
strNewFmt(STORAGE_REPO_ARCHIVE "/%s/%s/%s",
|
||||
strPtr(archiveId), strPtr(walPath), strPtr(walSubPath)));
|
||||
|
@ -728,7 +728,7 @@ infoRender(void)
|
||||
if (!strEq(cfgOptionStr(cfgOptOutput), CFGOPTVAL_INFO_OUTPUT_TEXT_STR))
|
||||
THROW(ConfigError, "option 'set' is currently only valid for text output");
|
||||
|
||||
if (!storageExistsNP(storageRepo(), strNewFmt(STORAGE_REPO_BACKUP "/%s/" BACKUP_MANIFEST_FILE, strPtr(backupLabel))))
|
||||
if (!storageExistsP(storageRepo(), strNewFmt(STORAGE_REPO_BACKUP "/%s/" BACKUP_MANIFEST_FILE, strPtr(backupLabel))))
|
||||
{
|
||||
THROW_FMT(
|
||||
FileMissingError, "manifest does not exist for backup '%s'\n"
|
||||
@ -737,7 +737,7 @@ infoRender(void)
|
||||
}
|
||||
|
||||
// Get a list of stanzas in the backup directory.
|
||||
StringList *stanzaList = storageListNP(storageRepo(), STORAGE_PATH_BACKUP_STR);
|
||||
StringList *stanzaList = storageListP(storageRepo(), STORAGE_PATH_BACKUP_STR);
|
||||
VariantList *infoList = varLstNew();
|
||||
String *resultStr = strNew("");
|
||||
|
||||
|
@ -86,7 +86,7 @@ restoreFile(
|
||||
|
||||
if (info.size != 0)
|
||||
{
|
||||
read = storageReadIo(storageNewReadNP(storagePgWrite(), pgFile));
|
||||
read = storageReadIo(storageNewReadP(storagePgWrite(), pgFile));
|
||||
ioFilterGroupAdd(ioReadFilterGroup(read), cryptoHashNew(HASH_TYPE_SHA1_STR));
|
||||
ioReadDrain(read);
|
||||
}
|
||||
@ -166,7 +166,7 @@ restoreFile(
|
||||
ioFilterGroupAdd(filterGroup, ioSizeNew());
|
||||
|
||||
// Copy file
|
||||
storageCopyNP(
|
||||
storageCopyP(
|
||||
storageNewReadP(
|
||||
storageRepo(),
|
||||
strNewFmt(
|
||||
|
@ -72,11 +72,11 @@ restorePathValidate(void)
|
||||
{
|
||||
// The PGDATA directory must exist
|
||||
// ??? We should remove this requirement in a separate commit. What's the harm in creating the dir assuming we have perms?
|
||||
if (!storagePathExistsNP(storagePg(), NULL))
|
||||
if (!storagePathExistsP(storagePg(), NULL))
|
||||
THROW_FMT(PathMissingError, "$PGDATA directory '%s' does not exist", strPtr(cfgOptionStr(cfgOptPgPath)));
|
||||
|
||||
// PostgreSQL must not be running
|
||||
if (storageExistsNP(storagePg(), PG_FILE_POSTMASTERPID_STR))
|
||||
if (storageExistsP(storagePg(), PG_FILE_POSTMASTERPID_STR))
|
||||
{
|
||||
THROW_FMT(
|
||||
PostmasterRunningError,
|
||||
@ -88,7 +88,7 @@ restorePathValidate(void)
|
||||
|
||||
// If the restore will be destructive attempt to verify that PGDATA looks like a valid PostgreSQL directory
|
||||
if ((cfgOptionBool(cfgOptDelta) || cfgOptionBool(cfgOptForce)) &&
|
||||
!storageExistsNP(storagePg(), PG_FILE_PGVERSION_STR) && !storageExistsNP(storagePg(), BACKUP_MANIFEST_FILE_STR))
|
||||
!storageExistsP(storagePg(), PG_FILE_PGVERSION_STR) && !storageExistsP(storagePg(), BACKUP_MANIFEST_FILE_STR))
|
||||
{
|
||||
LOG_WARN(
|
||||
"--delta or --force specified but unable to find '" PG_FILE_PGVERSION "' or '" BACKUP_MANIFEST_FILE "' in '%s' to"
|
||||
@ -476,7 +476,7 @@ restoreManifestOwner(Manifest *manifest)
|
||||
if (userRoot())
|
||||
{
|
||||
// Get user/group info from data directory to use for invalid user/groups
|
||||
StorageInfo pathInfo = storageInfoNP(storagePg(), manifestTargetBase(manifest)->path);
|
||||
StorageInfo pathInfo = storageInfoP(storagePg(), manifestTargetBase(manifest)->path);
|
||||
|
||||
// If user/group is null then set it to root
|
||||
if (pathInfo.user == NULL)
|
||||
@ -855,7 +855,7 @@ restoreCleanBuild(Manifest *manifest)
|
||||
{
|
||||
const String *file = strNewFmt("%s/%s", strPtr(cleanData->targetPath), strPtr(cleanData->target->file));
|
||||
|
||||
if (storageExistsNP(storageLocal(), file))
|
||||
if (storageExistsP(storageLocal(), file))
|
||||
{
|
||||
THROW_FMT(
|
||||
FileExistsError,
|
||||
@ -896,11 +896,11 @@ restoreCleanBuild(Manifest *manifest)
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
// Delete the pg_control file (if it exists) so the cluster cannot be started if restore does not complete. Sync the path
|
||||
// so the file does not return, zombie-like, in the case of a host crash.
|
||||
if (storageExistsNP(storagePg(), STRDEF(PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)))
|
||||
if (storageExistsP(storagePg(), STRDEF(PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)))
|
||||
{
|
||||
LOG_DETAIL("remove '" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL "' so cluster will not start if restore does not complete");
|
||||
storageRemoveNP(storagePgWrite(), STRDEF(PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL));
|
||||
storagePathSyncNP(storagePgWrite(), PG_PATH_GLOBAL_STR);
|
||||
storageRemoveP(storagePgWrite(), STRDEF(PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL));
|
||||
storagePathSyncP(storagePgWrite(), PG_PATH_GLOBAL_STR);
|
||||
}
|
||||
|
||||
for (unsigned int targetIdx = 0; targetIdx < manifestTargetTotal(manifest); targetIdx++)
|
||||
@ -964,7 +964,7 @@ restoreCleanBuild(Manifest *manifest)
|
||||
|
||||
if (link != NULL)
|
||||
{
|
||||
const String *pgPath = storagePathNP(storagePg(), manifestPgPath(link->name));
|
||||
const String *pgPath = storagePathP(storagePg(), manifestPgPath(link->name));
|
||||
StorageInfo linkInfo = storageInfoP(storagePg(), pgPath, .ignoreMissing = true);
|
||||
|
||||
// Create the link if it is missing. If it exists it should already have the correct ownership and destination.
|
||||
@ -981,7 +981,7 @@ restoreCleanBuild(Manifest *manifest)
|
||||
// Create the path normally
|
||||
else
|
||||
{
|
||||
const String *pgPath = storagePathNP(storagePg(), manifestPgPath(path->name));
|
||||
const String *pgPath = storagePathP(storagePg(), manifestPgPath(path->name));
|
||||
StorageInfo pathInfo = storageInfoP(storagePg(), pgPath, .ignoreMissing = true);
|
||||
|
||||
// Create the path if it is missing If it exists it should already have the correct ownership and mode.
|
||||
@ -990,7 +990,7 @@ restoreCleanBuild(Manifest *manifest)
|
||||
LOG_DETAIL("create path '%s'", strPtr(pgPath));
|
||||
|
||||
storagePathCreateP(storagePgWrite(), pgPath, .mode = path->mode, .noParentCreate = true, .errorOnExists = true);
|
||||
restoreCleanOwnership(storagePathNP(storagePg(), pgPath), path->user, path->group, userId(), groupId(), true);
|
||||
restoreCleanOwnership(storagePathP(storagePg(), pgPath), path->user, path->group, userId(), groupId(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1001,7 +1001,7 @@ restoreCleanBuild(Manifest *manifest)
|
||||
{
|
||||
const ManifestLink *link = manifestLink(manifest, linkIdx);
|
||||
|
||||
const String *pgPath = storagePathNP(storagePg(), manifestPgPath(link->name));
|
||||
const String *pgPath = storagePathP(storagePg(), manifestPgPath(link->name));
|
||||
StorageInfo linkInfo = storageInfoP(storagePg(), pgPath, .ignoreMissing = true);
|
||||
|
||||
// Create the link if it is missing. If it exists it should already have the correct ownership and destination.
|
||||
@ -1340,14 +1340,14 @@ restoreRecoveryWriteConf(const Manifest *manifest, unsigned int pgVersion, const
|
||||
// Only write recovery.conf if recovery type != none
|
||||
if (!strEq(cfgOptionStr(cfgOptType), RECOVERY_TYPE_NONE_STR))
|
||||
{
|
||||
LOG_INFO("write %s", strPtr(storagePathNP(storagePg(), PG_FILE_RECOVERYCONF_STR)));
|
||||
LOG_INFO("write %s", strPtr(storagePathP(storagePg(), PG_FILE_RECOVERYCONF_STR)));
|
||||
|
||||
// Use the data directory to set permissions and ownership for recovery file
|
||||
const ManifestPath *dataPath = manifestPathFind(manifest, MANIFEST_TARGET_PGDATA_STR);
|
||||
mode_t recoveryFileMode = dataPath->mode & (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
|
||||
|
||||
// Write recovery.conf
|
||||
storagePutNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storagePgWrite(), PG_FILE_RECOVERYCONF_STR, .noCreatePath = true, .modeFile = recoveryFileMode, .noAtomic = true,
|
||||
.noSyncPath = true, .user = dataPath->user, .group = dataPath->group),
|
||||
@ -1371,7 +1371,7 @@ restoreRecoveryWriteAutoConf(unsigned int pgVersion, const String *restoreLabel)
|
||||
String *content = strNew("");
|
||||
|
||||
// Load postgresql.auto.conf so we can preserve the existing contents
|
||||
Buffer *autoConf = storageGetNP(storageNewReadP(storagePg(), PG_FILE_POSTGRESQLAUTOCONF_STR, .ignoreMissing = true));
|
||||
Buffer *autoConf = storageGetP(storageNewReadP(storagePg(), PG_FILE_POSTGRESQLAUTOCONF_STR, .ignoreMissing = true));
|
||||
|
||||
// It is unusual for the file not to exist, but we'll continue processing by creating a blank file
|
||||
if (autoConf == NULL)
|
||||
@ -1447,21 +1447,21 @@ restoreRecoveryWriteAutoConf(unsigned int pgVersion, const String *restoreLabel)
|
||||
}
|
||||
|
||||
LOG_INFO(
|
||||
"write %s%s", autoConf == NULL ? "" : "updated ", strPtr(storagePathNP(storagePg(), PG_FILE_POSTGRESQLAUTOCONF_STR)));
|
||||
"write %s%s", autoConf == NULL ? "" : "updated ", strPtr(storagePathP(storagePg(), PG_FILE_POSTGRESQLAUTOCONF_STR)));
|
||||
|
||||
// Use the data directory to set permissions and ownership for recovery file
|
||||
const StorageInfo dataPath = storageInfoNP(storagePg(), NULL);
|
||||
const StorageInfo dataPath = storageInfoP(storagePg(), NULL);
|
||||
mode_t recoveryFileMode = dataPath.mode & (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
|
||||
|
||||
// Write postgresql.auto.conf
|
||||
storagePutNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storagePgWrite(), PG_FILE_POSTGRESQLAUTOCONF_STR, .noCreatePath = true, .modeFile = recoveryFileMode,
|
||||
.noAtomic = true, .noSyncPath = true, .user = dataPath.user, .group = dataPath.group),
|
||||
BUFSTR(content));
|
||||
|
||||
// The recovery.signal file is required for targeted recovery
|
||||
storagePutNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storagePgWrite(), PG_FILE_RECOVERYSIGNAL_STR, .noCreatePath = true, .modeFile = recoveryFileMode,
|
||||
.noAtomic = true, .noSyncPath = true, .user = dataPath.user, .group = dataPath.group),
|
||||
@ -1470,7 +1470,7 @@ restoreRecoveryWriteAutoConf(unsigned int pgVersion, const String *restoreLabel)
|
||||
// The standby.signal file is required for standby mode
|
||||
if (strEq(cfgOptionStr(cfgOptType), RECOVERY_TYPE_STANDBY_STR))
|
||||
{
|
||||
storagePutNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storagePgWrite(), PG_FILE_STANDBYSIGNAL_STR, .noCreatePath = true, .modeFile = recoveryFileMode,
|
||||
.noAtomic = true, .noSyncPath = true, .user = dataPath.user, .group = dataPath.group),
|
||||
@ -1501,11 +1501,11 @@ restoreRecoveryWrite(const Manifest *manifest)
|
||||
const String *recoveryFile = pgVersion >= PG_VERSION_RECOVERY_GUC ?
|
||||
PG_FILE_POSTGRESQLAUTOCONF_STR : PG_FILE_RECOVERYCONF_STR;
|
||||
|
||||
if (!storageExistsNP(storagePg(), recoveryFile))
|
||||
if (!storageExistsP(storagePg(), recoveryFile))
|
||||
{
|
||||
LOG_WARN(
|
||||
"recovery type is " RECOVERY_TYPE_PRESERVE " but recovery file does not exist at '%s'",
|
||||
strPtr(storagePathNP(storagePg(), recoveryFile)));
|
||||
strPtr(storagePathP(storagePg(), recoveryFile)));
|
||||
}
|
||||
}
|
||||
// Else write recovery file
|
||||
@ -1921,7 +1921,7 @@ cmdRestore(void)
|
||||
uint64_t sizeTotal = restoreProcessQueue(jobData.manifest, &jobData.queueList);
|
||||
|
||||
// Save manifest to the data directory so we can restart a delta restore even if the PG_VERSION file is missing
|
||||
manifestSave(jobData.manifest, storageWriteIo(storageNewWriteNP(storagePgWrite(), BACKUP_MANIFEST_FILE_STR)));
|
||||
manifestSave(jobData.manifest, storageWriteIo(storageNewWriteP(storagePgWrite(), BACKUP_MANIFEST_FILE_STR)));
|
||||
|
||||
// Create the parallel executor
|
||||
ProtocolParallel *parallelExec = protocolParallelNew(
|
||||
@ -1949,7 +1949,7 @@ cmdRestore(void)
|
||||
restoreRecoveryWrite(jobData.manifest);
|
||||
|
||||
// Remove backup.manifest
|
||||
storageRemoveNP(storagePgWrite(), BACKUP_MANIFEST_FILE_STR);
|
||||
storageRemoveP(storagePgWrite(), BACKUP_MANIFEST_FILE_STR);
|
||||
|
||||
// Sync file link paths. These need to be synced separately because they are not linked from the data directory.
|
||||
StringList *pathSynced = strLstNew();
|
||||
@ -1972,7 +1972,7 @@ cmdRestore(void)
|
||||
|
||||
// Sync the path
|
||||
LOG_DETAIL("sync path '%s'", strPtr(pgPath));
|
||||
storagePathSyncNP(storageLocalWrite(), pgPath);
|
||||
storagePathSyncP(storageLocalWrite(), pgPath);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1990,29 +1990,29 @@ cmdRestore(void)
|
||||
if (strEq(manifestName, STRDEF(MANIFEST_TARGET_PGDATA "/" PG_PATH_GLOBAL)))
|
||||
continue;
|
||||
|
||||
const String *pgPath = storagePathNP(storagePg(), manifestPgPath(manifestName));
|
||||
const String *pgPath = storagePathP(storagePg(), manifestPgPath(manifestName));
|
||||
|
||||
LOG_DETAIL("sync path '%s'", strPtr(pgPath));
|
||||
storagePathSyncNP(storagePgWrite(), pgPath);
|
||||
storagePathSyncP(storagePgWrite(), pgPath);
|
||||
}
|
||||
|
||||
// Rename pg_control
|
||||
if (storageExistsNP(storagePg(), STRDEF(PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL "." STORAGE_FILE_TEMP_EXT)))
|
||||
if (storageExistsP(storagePg(), STRDEF(PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL "." STORAGE_FILE_TEMP_EXT)))
|
||||
{
|
||||
LOG_INFO(
|
||||
"restore " PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL " (performed last to ensure aborted restores cannot be started)");
|
||||
|
||||
storageMoveNP(
|
||||
storageMoveP(
|
||||
storagePgWrite(),
|
||||
storageNewReadNP(storagePg(), STRDEF(PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL "." STORAGE_FILE_TEMP_EXT)),
|
||||
storageNewReadP(storagePg(), STRDEF(PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL "." STORAGE_FILE_TEMP_EXT)),
|
||||
storageNewWriteP(storagePgWrite(), STRDEF(PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL), .noSyncPath = true));
|
||||
}
|
||||
else
|
||||
LOG_WARN("backup does not contain '" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL "' -- cluster will not start");
|
||||
|
||||
// Sync global path
|
||||
LOG_DETAIL("sync path '%s'", strPtr(storagePathNP(storagePg(), PG_PATH_GLOBAL_STR)));
|
||||
storagePathSyncNP(storagePgWrite(), PG_PATH_GLOBAL_STR);
|
||||
LOG_DETAIL("sync path '%s'", strPtr(storagePathP(storagePg(), PG_PATH_GLOBAL_STR)));
|
||||
storagePathSyncP(storagePgWrite(), PG_PATH_GLOBAL_STR);
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
|
@ -48,17 +48,17 @@ cmdStanzaCreate(void)
|
||||
// Get the version and system information - validating it if the database is online
|
||||
PgControl pgControl = pgValidate();
|
||||
|
||||
bool archiveInfoFileExists = storageExistsNP(storageRepoReadStanza, INFO_ARCHIVE_PATH_FILE_STR);
|
||||
bool archiveInfoFileCopyExists = storageExistsNP(storageRepoReadStanza, INFO_ARCHIVE_PATH_FILE_COPY_STR);
|
||||
bool backupInfoFileExists = storageExistsNP(storageRepoReadStanza, INFO_BACKUP_PATH_FILE_STR);
|
||||
bool backupInfoFileCopyExists = storageExistsNP(storageRepoReadStanza, INFO_BACKUP_PATH_FILE_COPY_STR);
|
||||
bool archiveInfoFileExists = storageExistsP(storageRepoReadStanza, INFO_ARCHIVE_PATH_FILE_STR);
|
||||
bool archiveInfoFileCopyExists = storageExistsP(storageRepoReadStanza, INFO_ARCHIVE_PATH_FILE_COPY_STR);
|
||||
bool backupInfoFileExists = storageExistsP(storageRepoReadStanza, INFO_BACKUP_PATH_FILE_STR);
|
||||
bool backupInfoFileCopyExists = storageExistsP(storageRepoReadStanza, INFO_BACKUP_PATH_FILE_COPY_STR);
|
||||
|
||||
// If neither archive info nor backup info files exist and nothing else exists in the stanza directory
|
||||
// then create the stanza
|
||||
if (!archiveInfoFileExists && !archiveInfoFileCopyExists && !backupInfoFileExists && !backupInfoFileCopyExists)
|
||||
{
|
||||
bool archiveNotEmpty = strLstSize(storageListNP(storageRepoReadStanza, STORAGE_REPO_ARCHIVE_STR)) > 0 ? true : false;
|
||||
bool backupNotEmpty = strLstSize(storageListNP(storageRepoReadStanza, STORAGE_REPO_BACKUP_STR)) > 0 ? true : false;
|
||||
bool archiveNotEmpty = strLstSize(storageListP(storageRepoReadStanza, STORAGE_REPO_ARCHIVE_STR)) > 0 ? true : false;
|
||||
bool backupNotEmpty = strLstSize(storageListP(storageRepoReadStanza, STORAGE_REPO_BACKUP_STR)) > 0 ? true : false;
|
||||
|
||||
// If something else exists in the backup or archive directories for this stanza, then error
|
||||
if (archiveNotEmpty || backupNotEmpty)
|
||||
@ -108,9 +108,9 @@ cmdStanzaCreate(void)
|
||||
sourceFile = archiveInfoFileExists ? INFO_ARCHIVE_PATH_FILE_STR : INFO_ARCHIVE_PATH_FILE_COPY_STR;
|
||||
destinationFile = !archiveInfoFileExists ? INFO_ARCHIVE_PATH_FILE_STR : INFO_ARCHIVE_PATH_FILE_COPY_STR;
|
||||
|
||||
storageCopyNP(
|
||||
storageNewReadNP(storageRepoReadStanza, sourceFile),
|
||||
storageNewWriteNP(storageRepoWriteStanza, destinationFile));
|
||||
storageCopyP(
|
||||
storageNewReadP(storageRepoReadStanza, sourceFile),
|
||||
storageNewWriteP(storageRepoWriteStanza, destinationFile));
|
||||
}
|
||||
|
||||
if (!backupInfoFileExists || !backupInfoFileCopyExists)
|
||||
@ -118,9 +118,9 @@ cmdStanzaCreate(void)
|
||||
sourceFile = backupInfoFileExists ? INFO_BACKUP_PATH_FILE_STR : INFO_BACKUP_PATH_FILE_COPY_STR;
|
||||
destinationFile = !backupInfoFileExists ? INFO_BACKUP_PATH_FILE_STR : INFO_BACKUP_PATH_FILE_COPY_STR;
|
||||
|
||||
storageCopyNP(
|
||||
storageNewReadNP(storageRepoReadStanza, sourceFile),
|
||||
storageNewWriteNP(storageRepoWriteStanza, destinationFile));
|
||||
storageCopyP(
|
||||
storageNewReadP(storageRepoReadStanza, sourceFile),
|
||||
storageNewWriteP(storageRepoWriteStanza, destinationFile));
|
||||
}
|
||||
|
||||
// If no files copied, then the stanza was already valid
|
||||
|
@ -39,9 +39,9 @@ manifestDelete(const Storage *storageRepoWriteStanza)
|
||||
// Delete all manifest files
|
||||
for (unsigned int idx = 0; idx < strLstSize(backupList); idx++)
|
||||
{
|
||||
storageRemoveNP(
|
||||
storageRemoveP(
|
||||
storageRepoWriteStanza, strNewFmt(STORAGE_REPO_BACKUP "/%s/" BACKUP_MANIFEST_FILE, strPtr(strLstGet(backupList, idx))));
|
||||
storageRemoveNP(
|
||||
storageRemoveP(
|
||||
storageRepoWriteStanza,
|
||||
strNewFmt(STORAGE_REPO_BACKUP "/%s/" BACKUP_MANIFEST_FILE INFO_COPY_EXT, strPtr(strLstGet(backupList, idx))));
|
||||
}
|
||||
@ -73,7 +73,7 @@ stanzaDelete(const Storage *storageRepoWriteStanza, const StringList *archiveLis
|
||||
if (archiveNotEmpty || backupNotEmpty)
|
||||
{
|
||||
// If the stop file does not exist, then error. This check is required even when --force is issued.
|
||||
if (!storageExistsNP(storageLocal(), lockStopFileName(cfgOptionStr(cfgOptStanza))))
|
||||
if (!storageExistsP(storageLocal(), lockStopFileName(cfgOptionStr(cfgOptStanza))))
|
||||
{
|
||||
THROW_FMT(
|
||||
FileMissingError, "stop file does not exist for stanza '%s'\n"
|
||||
@ -82,7 +82,7 @@ stanzaDelete(const Storage *storageRepoWriteStanza, const StringList *archiveLis
|
||||
}
|
||||
|
||||
// If a force has not been issued and Postgres is running, then error
|
||||
if (!cfgOptionBool(cfgOptForce) && storageExistsNP(storagePg(), STRDEF(PG_FILE_POSTMASTERPID)))
|
||||
if (!cfgOptionBool(cfgOptForce) && storageExistsP(storagePg(), STRDEF(PG_FILE_POSTMASTERPID)))
|
||||
{
|
||||
THROW_FMT(
|
||||
PostmasterRunningError, PG_FILE_POSTMASTERPID " exists - looks like the postmaster is running. "
|
||||
@ -93,15 +93,15 @@ stanzaDelete(const Storage *storageRepoWriteStanza, const StringList *archiveLis
|
||||
// Delete the archive info files
|
||||
if (archiveNotEmpty)
|
||||
{
|
||||
storageRemoveNP(storageRepoWriteStanza, INFO_ARCHIVE_PATH_FILE_STR);
|
||||
storageRemoveNP(storageRepoWriteStanza, INFO_ARCHIVE_PATH_FILE_COPY_STR);
|
||||
storageRemoveP(storageRepoWriteStanza, INFO_ARCHIVE_PATH_FILE_STR);
|
||||
storageRemoveP(storageRepoWriteStanza, INFO_ARCHIVE_PATH_FILE_COPY_STR);
|
||||
}
|
||||
|
||||
// Delete the backup info files
|
||||
if (backupNotEmpty)
|
||||
{
|
||||
storageRemoveNP(storageRepoWriteStanza, INFO_BACKUP_PATH_FILE_STR);
|
||||
storageRemoveNP(storageRepoWriteStanza, INFO_BACKUP_PATH_FILE_COPY_STR);
|
||||
storageRemoveP(storageRepoWriteStanza, INFO_BACKUP_PATH_FILE_STR);
|
||||
storageRemoveP(storageRepoWriteStanza, INFO_BACKUP_PATH_FILE_COPY_STR);
|
||||
}
|
||||
|
||||
// Remove manifest files
|
||||
@ -117,7 +117,7 @@ stanzaDelete(const Storage *storageRepoWriteStanza, const StringList *archiveLis
|
||||
|
||||
// Remove the stop file - this will not error if the stop file does not exist. If the stanza directories existed but nothing
|
||||
// was in them, then no pgbackrest commands can be in progress without the info files so a stop is technically not necessary
|
||||
storageRemoveNP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza)));
|
||||
storageRemoveP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza)));
|
||||
|
||||
result = true;
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ lockAcquireFile(const String *lockFile, TimeMSec lockTimeout, bool failOnNoLock)
|
||||
// If the path does not exist then create it
|
||||
if (errNo == ENOENT)
|
||||
{
|
||||
storagePathCreateNP(storageLocalWrite(), strPath(lockFile));
|
||||
storagePathCreateP(storageLocalWrite(), strPath(lockFile));
|
||||
retry = true;
|
||||
}
|
||||
}
|
||||
@ -138,7 +138,7 @@ lockReleaseFile(int lockHandle, const String *lockFile)
|
||||
|
||||
// Remove file first and then close it to release the lock. If we close it first then another process might grab the lock
|
||||
// right before the delete which means the file locked by the other process will get deleted.
|
||||
storageRemoveNP(storageLocalWrite(), lockFile);
|
||||
storageRemoveP(storageLocalWrite(), lockFile);
|
||||
close(lockHandle);
|
||||
|
||||
FUNCTION_LOG_RETURN_VOID();
|
||||
|
@ -15,6 +15,7 @@ List object
|
||||
typedef struct List List;
|
||||
|
||||
#include "common/memContext.h"
|
||||
#include "common/type/param.h"
|
||||
#include "common/type/string.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
@ -54,12 +55,13 @@ List *lstNew(size_t itemSize);
|
||||
|
||||
typedef struct ListParam
|
||||
{
|
||||
VAR_PARAM_HEADER;
|
||||
SortOrder sortOrder;
|
||||
ListComparator *comparator;
|
||||
} ListParam;
|
||||
|
||||
#define lstNewP(itemSize, ...) \
|
||||
lstNewParam(itemSize, (ListParam){__VA_ARGS__})
|
||||
lstNewParam(itemSize, (ListParam){VAR_PARAM_INIT, __VA_ARGS__})
|
||||
|
||||
List *lstNewParam(size_t itemSize, ListParam param);
|
||||
|
||||
|
18
src/common/type/param.h
Normal file
18
src/common/type/param.h
Normal file
@ -0,0 +1,18 @@
|
||||
/***********************************************************************************************************************************
|
||||
Variable Parameter Helper Macros
|
||||
***********************************************************************************************************************************/
|
||||
#ifndef COMMON_TYPE_PARAM_H
|
||||
#define COMMON_TYPE_PARAM_H
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Macros to help with implementing functions with variable parameters using structs
|
||||
***********************************************************************************************************************************/
|
||||
// This macro goes at the top of the parameter struct
|
||||
#define VAR_PARAM_HEADER \
|
||||
bool dummy
|
||||
|
||||
// This macro goes in the struct parameter list right before __VA_ARGS__
|
||||
#define VAR_PARAM_INIT \
|
||||
.dummy = false
|
||||
|
||||
#endif
|
@ -350,7 +350,7 @@ cfgFileLoad( // NOTE: Pas
|
||||
configFileName = optConfigDefault;
|
||||
|
||||
// Load the config file
|
||||
Buffer *buffer = storageGetNP(storageNewReadP(storageLocal(), configFileName, .ignoreMissing = !configRequired));
|
||||
Buffer *buffer = storageGetP(storageNewReadP(storageLocal(), configFileName, .ignoreMissing = !configRequired));
|
||||
|
||||
// Convert the contents of the file buffer to the config string object
|
||||
if (buffer != NULL)
|
||||
@ -358,7 +358,7 @@ cfgFileLoad( // NOTE: Pas
|
||||
else if (strEq(configFileName, optConfigDefaultCurrent))
|
||||
{
|
||||
// If confg is current default and it was not found, attempt to load the config file from the old default location
|
||||
buffer = storageGetNP(storageNewReadP(storageLocal(), origConfigDefault, .ignoreMissing = !configRequired));
|
||||
buffer = storageGetP(storageNewReadP(storageLocal(), origConfigDefault, .ignoreMissing = !configRequired));
|
||||
|
||||
if (buffer != NULL)
|
||||
result = strNewBuf(buffer);
|
||||
@ -398,7 +398,7 @@ cfgFileLoad( // NOTE: Pas
|
||||
{
|
||||
cfgFileLoadPart(
|
||||
&result,
|
||||
storageGetNP(
|
||||
storageGetP(
|
||||
storageNewReadP(
|
||||
storageLocal(), strNewFmt("%s/%s", strPtr(configIncludePath), strPtr(strLstGet(list, listIdx))),
|
||||
.ignoreMissing = true)));
|
||||
|
@ -282,7 +282,7 @@ infoArchiveLoadFileCallback(void *data, unsigned int try)
|
||||
const String *fileName = try == 0 ? loadData->fileName : strNewFmt("%s" INFO_COPY_EXT, strPtr(loadData->fileName));
|
||||
|
||||
// Attempt to load the file
|
||||
IoRead *read = storageReadIo(storageNewReadNP(loadData->storage, fileName));
|
||||
IoRead *read = storageReadIo(storageNewReadP(loadData->storage, fileName));
|
||||
cipherBlockFilterGroupAdd(ioReadFilterGroup(read), loadData->cipherType, cipherModeDecrypt, loadData->cipherPass);
|
||||
|
||||
MEM_CONTEXT_BEGIN(loadData->memContext)
|
||||
@ -321,7 +321,7 @@ infoArchiveLoadFile(const Storage *storage, const String *fileName, CipherType c
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
const char *fileNamePath = strPtr(storagePathNP(storage, fileName));
|
||||
const char *fileNamePath = strPtr(storagePathP(storage, fileName));
|
||||
|
||||
TRY_BEGIN()
|
||||
{
|
||||
@ -370,13 +370,13 @@ infoArchiveSaveFile(
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
// Save the file
|
||||
IoWrite *write = storageWriteIo(storageNewWriteNP(storage, fileName));
|
||||
IoWrite *write = storageWriteIo(storageNewWriteP(storage, fileName));
|
||||
cipherBlockFilterGroupAdd(ioWriteFilterGroup(write), cipherType, cipherModeEncrypt, cipherPass);
|
||||
infoArchiveSave(infoArchive, write);
|
||||
|
||||
// Make a copy of the file
|
||||
storageCopy(
|
||||
storageNewReadNP(storage, fileName), storageNewWriteNP(storage, strNewFmt("%s" INFO_COPY_EXT, strPtr(fileName))));
|
||||
storageNewReadP(storage, fileName), storageNewWriteP(storage, strNewFmt("%s" INFO_COPY_EXT, strPtr(fileName))));
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
|
@ -551,7 +551,7 @@ infoBackupLoadFileCallback(void *data, unsigned int try)
|
||||
const String *fileName = try == 0 ? loadData->fileName : strNewFmt("%s" INFO_COPY_EXT, strPtr(loadData->fileName));
|
||||
|
||||
// Attempt to load the file
|
||||
IoRead *read = storageReadIo(storageNewReadNP(loadData->storage, fileName));
|
||||
IoRead *read = storageReadIo(storageNewReadP(loadData->storage, fileName));
|
||||
cipherBlockFilterGroupAdd(ioReadFilterGroup(read), loadData->cipherType, cipherModeDecrypt, loadData->cipherPass);
|
||||
|
||||
MEM_CONTEXT_BEGIN(loadData->memContext)
|
||||
@ -590,7 +590,7 @@ infoBackupLoadFile(const Storage *storage, const String *fileName, CipherType ci
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
const char *fileNamePath = strPtr(storagePathNP(storage, fileName));
|
||||
const char *fileNamePath = strPtr(storagePathP(storage, fileName));
|
||||
|
||||
TRY_BEGIN()
|
||||
{
|
||||
@ -656,7 +656,7 @@ infoBackupLoadFileReconstruct(const Storage *storage, const String *fileName, Ci
|
||||
String *manifestFileName = strNewFmt(STORAGE_REPO_BACKUP "/%s/" BACKUP_MANIFEST_FILE, strPtr(backupLabel));
|
||||
|
||||
// Check if a completed backup exists (backup.manifest only - ignore .copy)
|
||||
if (storageExistsNP(storage, manifestFileName))
|
||||
if (storageExistsP(storage, manifestFileName))
|
||||
{
|
||||
bool found = false;
|
||||
const Manifest *manifest = manifestLoadFile(
|
||||
@ -695,7 +695,7 @@ infoBackupLoadFileReconstruct(const Storage *storage, const String *fileName, Ci
|
||||
String *manifestFileName = strNewFmt(STORAGE_REPO_BACKUP "/%s/" BACKUP_MANIFEST_FILE, strPtr(backupLabel));
|
||||
|
||||
// Remove backup from the current list in the infoBackup object
|
||||
if (!storageExistsNP(storage, manifestFileName))
|
||||
if (!storageExistsP(storage, manifestFileName))
|
||||
{
|
||||
LOG_WARN("backup '%s' missing manifest removed from " INFO_BACKUP_FILE, strPtr(backupLabel));
|
||||
infoBackupDataDelete(infoBackup, backupLabel);
|
||||
@ -730,13 +730,13 @@ infoBackupSaveFile(
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
// Save the file
|
||||
IoWrite *write = storageWriteIo(storageNewWriteNP(storage, fileName));
|
||||
IoWrite *write = storageWriteIo(storageNewWriteP(storage, fileName));
|
||||
cipherBlockFilterGroupAdd(ioWriteFilterGroup(write), cipherType, cipherModeEncrypt, cipherPass);
|
||||
infoBackupSave(infoBackup, write);
|
||||
|
||||
// Make a copy of the file
|
||||
storageCopy(
|
||||
storageNewReadNP(storage, fileName), storageNewWriteNP(storage, strNewFmt("%s" INFO_COPY_EXT, strPtr(fileName))));
|
||||
storageNewReadP(storage, fileName), storageNewWriteP(storage, strNewFmt("%s" INFO_COPY_EXT, strPtr(fileName))));
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
|
@ -1957,7 +1957,7 @@ manifestLoadFileCallback(void *data, unsigned int try)
|
||||
const String *fileName = try == 0 ? loadData->fileName : strNewFmt("%s" INFO_COPY_EXT, strPtr(loadData->fileName));
|
||||
|
||||
// Attempt to load the file
|
||||
IoRead *read = storageReadIo(storageNewReadNP(loadData->storage, fileName));
|
||||
IoRead *read = storageReadIo(storageNewReadP(loadData->storage, fileName));
|
||||
cipherBlockFilterGroupAdd(ioReadFilterGroup(read), loadData->cipherType, cipherModeDecrypt, loadData->cipherPass);
|
||||
|
||||
MEM_CONTEXT_BEGIN(loadData->memContext)
|
||||
@ -1996,7 +1996,7 @@ manifestLoadFile(const Storage *storage, const String *fileName, CipherType ciph
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
const char *fileNamePath = strPtr(storagePathNP(storage, fileName));
|
||||
const char *fileNamePath = strPtr(storagePathP(storage, fileName));
|
||||
|
||||
infoLoad(
|
||||
strNewFmt("unable to load backup manifest file '%s' or '%s" INFO_COPY_EXT "'", fileNamePath, fileNamePath),
|
||||
|
@ -960,7 +960,7 @@ XS_EUPXS(XS_pgBackRest__LibC__Storage_copy)
|
||||
"pgBackRest::LibC::Storage::copy",
|
||||
"destination", "pgBackRest::LibC::StorageWrite")
|
||||
;
|
||||
RETVAL = storageCopyNP(source, destination);
|
||||
RETVAL = storageCopyP(source, destination);
|
||||
ST(0) = boolSV(RETVAL);
|
||||
}
|
||||
MEM_CONTEXT_XS_TEMP_END();
|
||||
@ -991,7 +991,7 @@ XS_EUPXS(XS_pgBackRest__LibC__Storage_exists)
|
||||
"pgBackRest::LibC::Storage::exists",
|
||||
"self", "pgBackRest::LibC::Storage")
|
||||
;
|
||||
RETVAL = storageExistsNP(self, fileExp);
|
||||
RETVAL = storageExistsP(self, fileExp);
|
||||
ST(0) = boolSV(RETVAL);
|
||||
}
|
||||
MEM_CONTEXT_XS_TEMP_END();
|
||||
@ -1022,7 +1022,7 @@ XS_EUPXS(XS_pgBackRest__LibC__Storage_get)
|
||||
"read", "pgBackRest::LibC::StorageRead")
|
||||
;
|
||||
RETVAL = NULL;
|
||||
Buffer *buffer = storageGetNP(read);
|
||||
Buffer *buffer = storageGetP(read);
|
||||
|
||||
if (buffer != NULL)
|
||||
{
|
||||
@ -1240,7 +1240,7 @@ XS_EUPXS(XS_pgBackRest__LibC__Storage_pathExists)
|
||||
RETVAL = true;
|
||||
|
||||
if (storageFeature(self, storageFeaturePath))
|
||||
RETVAL = storagePathExistsNP(self, pathExp);
|
||||
RETVAL = storagePathExistsP(self, pathExp);
|
||||
ST(0) = boolSV(RETVAL);
|
||||
}
|
||||
MEM_CONTEXT_XS_TEMP_END();
|
||||
@ -1271,7 +1271,7 @@ XS_EUPXS(XS_pgBackRest__LibC__Storage_pathGet)
|
||||
"pgBackRest::LibC::Storage::pathGet",
|
||||
"self", "pgBackRest::LibC::Storage")
|
||||
;
|
||||
String *path = storagePathNP(self, pathExp);
|
||||
String *path = storagePathP(self, pathExp);
|
||||
RETVAL = newSVpv((char *)strPtr(path), strSize(path));
|
||||
RETVAL = sv_2mortal(RETVAL);
|
||||
ST(0) = RETVAL;
|
||||
@ -1337,7 +1337,7 @@ XS_EUPXS(XS_pgBackRest__LibC__Storage_pathSync)
|
||||
"pgBackRest::LibC::Storage::pathSync",
|
||||
"self", "pgBackRest::LibC::Storage")
|
||||
;
|
||||
storagePathSyncNP(self, pathExp);
|
||||
storagePathSyncP(self, pathExp);
|
||||
}
|
||||
MEM_CONTEXT_XS_TEMP_END();
|
||||
}
|
||||
@ -1368,7 +1368,7 @@ XS_EUPXS(XS_pgBackRest__LibC__Storage_put)
|
||||
"pgBackRest::LibC::Storage::put",
|
||||
"write", "pgBackRest::LibC::StorageWrite")
|
||||
;
|
||||
storagePutNP(write, buffer);
|
||||
storagePutP(write, buffer);
|
||||
RETVAL = buffer ? bufUsed(buffer) : 0;
|
||||
XSprePUSH; PUSHu((UV)RETVAL);
|
||||
}
|
||||
|
@ -431,7 +431,7 @@ pgControlFromFile(const Storage *storage)
|
||||
{
|
||||
// Read control file
|
||||
Buffer *controlFile = storageGetP(
|
||||
storageNewReadNP(storage, STRDEF(PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)), .exactSize = PG_CONTROL_DATA_SIZE);
|
||||
storageNewReadP(storage, STRDEF(PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)), .exactSize = PG_CONTROL_DATA_SIZE);
|
||||
|
||||
result = pgControlFromBuffer(controlFile);
|
||||
}
|
||||
@ -527,7 +527,7 @@ pgWalFromFile(const String *walFile)
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
// Read WAL segment header
|
||||
Buffer *walBuffer = storageGetP(storageNewReadNP(storageLocal(), walFile), .exactSize = PG_WAL_HEADER_SIZE);
|
||||
Buffer *walBuffer = storageGetP(storageNewReadP(storageLocal(), walFile), .exactSize = PG_WAL_HEADER_SIZE);
|
||||
|
||||
result = pgWalFromBuffer(walBuffer);
|
||||
}
|
||||
|
@ -23,16 +23,16 @@ Object type
|
||||
typedef struct StorageInfo
|
||||
{
|
||||
const String *name; // Name of path/file/link
|
||||
const String *linkDestination; // Destination if this is a link
|
||||
StorageType type; // Type file/path/link)
|
||||
bool exists; // Does the path/file/link exist?
|
||||
uid_t userId; // User that owns the file
|
||||
const String *user; // Name of user that owns the file
|
||||
uid_t groupId; // Group that owns the file
|
||||
const String *group; // Name of group that owns the file
|
||||
mode_t mode; // Mode of path/file/link
|
||||
time_t timeModified; // Time file was last modified
|
||||
StorageType type; // Type file/path/link)
|
||||
uint64_t size; // Size (path/link is 0)
|
||||
time_t timeModified; // Time file was last modified
|
||||
mode_t mode; // Mode of path/file/link
|
||||
uid_t userId; // User that owns the file
|
||||
uid_t groupId; // Group that owns the file
|
||||
const String *user; // Name of user that owns the file
|
||||
const String *group; // Name of group that owns the file
|
||||
const String *linkDestination; // Destination if this is a link
|
||||
} StorageInfo;
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
@ -208,7 +208,7 @@ storageRemoteProtocol(const String *command, const VariantList *paramList, Proto
|
||||
}
|
||||
else if (strEq(command, PROTOCOL_COMMAND_STORAGE_FEATURE_STR))
|
||||
{
|
||||
protocolServerWriteLine(server, jsonFromStr(storagePathNP(storage, NULL)));
|
||||
protocolServerWriteLine(server, jsonFromStr(storagePathP(storage, NULL)));
|
||||
protocolServerWriteLine(server, jsonFromUInt64(interface.feature));
|
||||
|
||||
protocolServerResponse(server, NULL);
|
||||
|
@ -149,7 +149,7 @@ storageExists(const Storage *this, const String *pathExp, StorageExistsParam par
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
// Build the path to the file
|
||||
String *path = storagePathNP(this, pathExp);
|
||||
String *path = storagePathP(this, pathExp);
|
||||
|
||||
// Create Wait object of timeout > 0
|
||||
Wait *wait = param.timeout != 0 ? waitNew(param.timeout) : NULL;
|
||||
@ -250,7 +250,7 @@ storageInfo(const Storage *this, const String *fileExp, StorageInfoParam param)
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
// Build the path
|
||||
String *file = storagePathNP(this, fileExp);
|
||||
String *file = storagePathP(this, fileExp);
|
||||
|
||||
// Call driver function
|
||||
result = this->interface.info(this->driver, file, (StorageInterfaceInfoParam){.followLink = param.followLink});
|
||||
@ -451,7 +451,7 @@ storageInfoList(
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
// Build the path
|
||||
String *path = storagePathNP(this, pathExp);
|
||||
String *path = storagePathP(this, pathExp);
|
||||
|
||||
// If there is an expression or recursion then the info will need to be filtered through a local callback
|
||||
if (param.expression != NULL || param.recurse)
|
||||
@ -505,7 +505,7 @@ storageList(const Storage *this, const String *pathExp, StorageListParam param)
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
// Build the path
|
||||
String *path = storagePathNP(this, pathExp);
|
||||
String *path = storagePathP(this, pathExp);
|
||||
|
||||
// Get the list
|
||||
result = this->interface.list(this->driver, path, (StorageInterfaceListParam){.expression = param.expression});
|
||||
@ -556,7 +556,7 @@ storageMove(const Storage *this, StorageRead *source, StorageWrite *destination)
|
||||
if (!this->interface.move(this->driver, source, destination, (StorageInterfaceMoveParam){false}))
|
||||
{
|
||||
// Perform the copy
|
||||
storageCopyNP(source, destination);
|
||||
storageCopyP(source, destination);
|
||||
|
||||
// Remove the source file
|
||||
this->interface.remove(this->driver, storageReadName(source), (StorageInterfaceRemoveParam){.errorOnMissing = false});
|
||||
@ -594,7 +594,7 @@ storageNewRead(const Storage *this, const String *fileExp, StorageNewReadParam p
|
||||
{
|
||||
result = storageReadMove(
|
||||
this->interface.newRead(
|
||||
this->driver, storagePathNP(this, fileExp), param.ignoreMissing,
|
||||
this->driver, storagePathP(this, fileExp), param.ignoreMissing,
|
||||
(StorageInterfaceNewReadParam){.compressible = param.compressible}),
|
||||
MEM_CONTEXT_OLD());
|
||||
}
|
||||
@ -633,7 +633,7 @@ storageNewWrite(const Storage *this, const String *fileExp, StorageNewWriteParam
|
||||
{
|
||||
result = storageWriteMove(
|
||||
this->interface.newWrite(
|
||||
this->driver, storagePathNP(this, fileExp),
|
||||
this->driver, storagePathP(this, fileExp),
|
||||
(StorageInterfaceNewWriteParam){
|
||||
.modeFile = param.modeFile != 0 ? param.modeFile : this->modeFile,
|
||||
.modePath = param.modePath != 0 ? param.modePath : this->modePath, .user = param.user, .group = param.group,
|
||||
@ -769,7 +769,7 @@ storagePathCreate(const Storage *this, const String *pathExp, StoragePathCreateP
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
// Build the path
|
||||
String *path = storagePathNP(this, pathExp);
|
||||
String *path = storagePathP(this, pathExp);
|
||||
|
||||
// Call driver function
|
||||
this->interface.pathCreate(
|
||||
@ -799,7 +799,7 @@ storagePathExists(const Storage *this, const String *pathExp)
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
result = this->interface.pathExists(this->driver, storagePathNP(this, pathExp), (StorageInterfacePathExistsParam){false});
|
||||
result = this->interface.pathExists(this->driver, storagePathP(this, pathExp), (StorageInterfacePathExistsParam){false});
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
@ -827,7 +827,7 @@ storagePathRemove(const Storage *this, const String *pathExp, StoragePathRemoveP
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
// Build the path
|
||||
String *path = storagePathNP(this, pathExp);
|
||||
String *path = storagePathP(this, pathExp);
|
||||
|
||||
// Call driver function
|
||||
if (!this->interface.pathRemove(this->driver, path, param.recurse, (StorageInterfacePathRemoveParam){false}) &&
|
||||
@ -859,7 +859,7 @@ void storagePathSync(const Storage *this, const String *pathExp)
|
||||
{
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
this->interface.pathSync(this->driver, storagePathNP(this, pathExp), (StorageInterfacePathSyncParam){false});
|
||||
this->interface.pathSync(this->driver, storagePathP(this, pathExp), (StorageInterfacePathSyncParam){false});
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
}
|
||||
@ -905,7 +905,7 @@ storageRemove(const Storage *this, const String *fileExp, StorageRemoveParam par
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
// Build the path
|
||||
String *file = storagePathNP(this, fileExp);
|
||||
String *file = storagePathP(this, fileExp);
|
||||
|
||||
// Call driver function
|
||||
this->interface.remove(this->driver, file, (StorageInterfaceRemoveParam){.errorOnMissing = param.errorOnMissing});
|
||||
|
@ -18,6 +18,7 @@ typedef struct Storage Storage;
|
||||
#include "common/type/stringList.h"
|
||||
#include "common/io/filter/group.h"
|
||||
#include "common/time.h"
|
||||
#include "common/type/param.h"
|
||||
#include "storage/info.h"
|
||||
#include "storage/read.h"
|
||||
#include "storage/write.h"
|
||||
@ -42,7 +43,7 @@ typedef enum
|
||||
/***********************************************************************************************************************************
|
||||
storageCopy
|
||||
***********************************************************************************************************************************/
|
||||
#define storageCopyNP(source, destination) \
|
||||
#define storageCopyP(source, destination) \
|
||||
storageCopy(source, destination)
|
||||
|
||||
bool storageCopy(StorageRead *source, StorageWrite *destination);
|
||||
@ -52,36 +53,26 @@ storageExists
|
||||
***********************************************************************************************************************************/
|
||||
typedef struct StorageExistsParam
|
||||
{
|
||||
VAR_PARAM_HEADER;
|
||||
TimeMSec timeout;
|
||||
} StorageExistsParam;
|
||||
|
||||
#define storageExistsP(this, pathExp, ...) \
|
||||
storageExists(this, pathExp, (StorageExistsParam){__VA_ARGS__})
|
||||
#define storageExistsNP(this, pathExp) \
|
||||
storageExists(this, pathExp, (StorageExistsParam){0})
|
||||
storageExists(this, pathExp, (StorageExistsParam){VAR_PARAM_INIT, __VA_ARGS__})
|
||||
|
||||
bool storageExists(const Storage *this, const String *pathExp, StorageExistsParam param);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
storageFeature
|
||||
***********************************************************************************************************************************/
|
||||
#define storageFeatureNP(this, feature) \
|
||||
storageFeature(this, feature)
|
||||
|
||||
bool storageFeature(const Storage *this, StorageFeature feature);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
storageGet
|
||||
***********************************************************************************************************************************/
|
||||
typedef struct StorageGetParam
|
||||
{
|
||||
VAR_PARAM_HEADER;
|
||||
size_t exactSize;
|
||||
} StorageGetParam;
|
||||
|
||||
#define storageGetP(file, ...) \
|
||||
storageGet(file, (StorageGetParam){__VA_ARGS__})
|
||||
#define storageGetNP(file) \
|
||||
storageGet(file, (StorageGetParam){0})
|
||||
storageGet(file, (StorageGetParam){VAR_PARAM_INIT, __VA_ARGS__})
|
||||
|
||||
Buffer *storageGet(StorageRead *file, StorageGetParam param);
|
||||
|
||||
@ -90,14 +81,13 @@ storageInfo
|
||||
***********************************************************************************************************************************/
|
||||
typedef struct StorageInfoParam
|
||||
{
|
||||
VAR_PARAM_HEADER;
|
||||
bool ignoreMissing;
|
||||
bool followLink;
|
||||
} StorageInfoParam;
|
||||
|
||||
#define storageInfoP(this, fileExp, ...) \
|
||||
storageInfo(this, fileExp, (StorageInfoParam){__VA_ARGS__})
|
||||
#define storageInfoNP(this, fileExp) \
|
||||
storageInfo(this, fileExp, (StorageInfoParam){0})
|
||||
storageInfo(this, fileExp, (StorageInfoParam){VAR_PARAM_INIT, __VA_ARGS__})
|
||||
|
||||
StorageInfo storageInfo(const Storage *this, const String *fileExp, StorageInfoParam param);
|
||||
|
||||
@ -108,16 +98,15 @@ typedef void (*StorageInfoListCallback)(void *callbackData, const StorageInfo *i
|
||||
|
||||
typedef struct StorageInfoListParam
|
||||
{
|
||||
VAR_PARAM_HEADER;
|
||||
bool errorOnMissing;
|
||||
bool recurse;
|
||||
SortOrder sortOrder;
|
||||
const String *expression;
|
||||
bool recurse;
|
||||
} StorageInfoListParam;
|
||||
|
||||
#define storageInfoListP(this, fileExp, callback, callbackData, ...) \
|
||||
storageInfoList(this, fileExp, callback, callbackData, (StorageInfoListParam){__VA_ARGS__})
|
||||
#define storageInfoListNP(this, fileExp, callback, callbackData) \
|
||||
storageInfoList(this, fileExp, callback, callbackData, (StorageInfoListParam){0})
|
||||
storageInfoList(this, fileExp, callback, callbackData, (StorageInfoListParam){VAR_PARAM_INIT, __VA_ARGS__})
|
||||
|
||||
bool storageInfoList(
|
||||
const Storage *this, const String *pathExp, StorageInfoListCallback callback, void *callbackData, StorageInfoListParam param);
|
||||
@ -127,22 +116,21 @@ storageList
|
||||
***********************************************************************************************************************************/
|
||||
typedef struct StorageListParam
|
||||
{
|
||||
VAR_PARAM_HEADER;
|
||||
bool errorOnMissing;
|
||||
bool nullOnMissing;
|
||||
const String *expression;
|
||||
} StorageListParam;
|
||||
|
||||
#define storageListP(this, pathExp, ...) \
|
||||
storageList(this, pathExp, (StorageListParam){__VA_ARGS__})
|
||||
#define storageListNP(this, pathExp) \
|
||||
storageList(this, pathExp, (StorageListParam){0})
|
||||
storageList(this, pathExp, (StorageListParam){VAR_PARAM_INIT, __VA_ARGS__})
|
||||
|
||||
StringList *storageList(const Storage *this, const String *pathExp, StorageListParam param);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
storageMove
|
||||
***********************************************************************************************************************************/
|
||||
#define storageMoveNP(this, source, destination) \
|
||||
#define storageMoveP(this, source, destination) \
|
||||
storageMove(this, source, destination)
|
||||
|
||||
void storageMove(const Storage *this, StorageRead *source, StorageWrite *destination);
|
||||
@ -152,14 +140,13 @@ storageNewRead
|
||||
***********************************************************************************************************************************/
|
||||
typedef struct StorageNewReadParam
|
||||
{
|
||||
VAR_PARAM_HEADER;
|
||||
bool ignoreMissing;
|
||||
bool compressible;
|
||||
} StorageNewReadParam;
|
||||
|
||||
#define storageNewReadP(this, pathExp, ...) \
|
||||
storageNewRead(this, pathExp, (StorageNewReadParam){__VA_ARGS__})
|
||||
#define storageNewReadNP(this, pathExp) \
|
||||
storageNewRead(this, pathExp, (StorageNewReadParam){0})
|
||||
storageNewRead(this, pathExp, (StorageNewReadParam){VAR_PARAM_INIT, __VA_ARGS__})
|
||||
|
||||
StorageRead *storageNewRead(const Storage *this, const String *fileExp, StorageNewReadParam param);
|
||||
|
||||
@ -168,29 +155,28 @@ storageNewWrite
|
||||
***********************************************************************************************************************************/
|
||||
typedef struct StorageNewWriteParam
|
||||
{
|
||||
mode_t modeFile;
|
||||
mode_t modePath;
|
||||
const String *user;
|
||||
const String *group;
|
||||
time_t timeModified;
|
||||
VAR_PARAM_HEADER;
|
||||
bool noCreatePath;
|
||||
bool noSyncFile;
|
||||
bool noSyncPath;
|
||||
bool noAtomic;
|
||||
bool compressible;
|
||||
mode_t modeFile;
|
||||
mode_t modePath;
|
||||
time_t timeModified;
|
||||
const String *user;
|
||||
const String *group;
|
||||
} StorageNewWriteParam;
|
||||
|
||||
#define storageNewWriteP(this, pathExp, ...) \
|
||||
storageNewWrite(this, pathExp, (StorageNewWriteParam){__VA_ARGS__})
|
||||
#define storageNewWriteNP(this, pathExp) \
|
||||
storageNewWrite(this, pathExp, (StorageNewWriteParam){0})
|
||||
storageNewWrite(this, pathExp, (StorageNewWriteParam){VAR_PARAM_INIT, __VA_ARGS__})
|
||||
|
||||
StorageWrite *storageNewWrite(const Storage *this, const String *fileExp, StorageNewWriteParam param);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
storagePath
|
||||
***********************************************************************************************************************************/
|
||||
#define storagePathNP(this, pathExp) \
|
||||
#define storagePathP(this, pathExp) \
|
||||
storagePath(this, pathExp)
|
||||
|
||||
String *storagePath(const Storage *this, const String *pathExp);
|
||||
@ -200,22 +186,21 @@ storagePathCreate
|
||||
***********************************************************************************************************************************/
|
||||
typedef struct StoragePathCreateParam
|
||||
{
|
||||
VAR_PARAM_HEADER;
|
||||
bool errorOnExists;
|
||||
bool noParentCreate;
|
||||
mode_t mode;
|
||||
} StoragePathCreateParam;
|
||||
|
||||
#define storagePathCreateP(this, pathExp, ...) \
|
||||
storagePathCreate(this, pathExp, (StoragePathCreateParam){__VA_ARGS__})
|
||||
#define storagePathCreateNP(this, pathExp) \
|
||||
storagePathCreate(this, pathExp, (StoragePathCreateParam){0})
|
||||
storagePathCreate(this, pathExp, (StoragePathCreateParam){VAR_PARAM_INIT, __VA_ARGS__})
|
||||
|
||||
void storagePathCreate(const Storage *this, const String *pathExp, StoragePathCreateParam param);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
storagePathExists
|
||||
***********************************************************************************************************************************/
|
||||
#define storagePathExistsNP(this, pathExp) \
|
||||
#define storagePathExistsP(this, pathExp) \
|
||||
storagePathExists(this, pathExp)
|
||||
|
||||
bool storagePathExists(const Storage *this, const String *pathExp);
|
||||
@ -225,21 +210,20 @@ storagePathRemove
|
||||
***********************************************************************************************************************************/
|
||||
typedef struct StoragePathRemoveParam
|
||||
{
|
||||
VAR_PARAM_HEADER;
|
||||
bool errorOnMissing;
|
||||
bool recurse;
|
||||
} StoragePathRemoveParam;
|
||||
|
||||
#define storagePathRemoveP(this, pathExp, ...) \
|
||||
storagePathRemove(this, pathExp, (StoragePathRemoveParam){__VA_ARGS__})
|
||||
#define storagePathRemoveNP(this, pathExp) \
|
||||
storagePathRemove(this, pathExp, (StoragePathRemoveParam){0})
|
||||
storagePathRemove(this, pathExp, (StoragePathRemoveParam){VAR_PARAM_INIT, __VA_ARGS__})
|
||||
|
||||
void storagePathRemove(const Storage *this, const String *pathExp, StoragePathRemoveParam param);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
storagePathSync
|
||||
***********************************************************************************************************************************/
|
||||
#define storagePathSyncNP(this, pathExp) \
|
||||
#define storagePathSyncP(this, pathExp) \
|
||||
storagePathSync(this, pathExp)
|
||||
|
||||
void storagePathSync(const Storage *this, const String *pathExp);
|
||||
@ -247,7 +231,7 @@ void storagePathSync(const Storage *this, const String *pathExp);
|
||||
/***********************************************************************************************************************************
|
||||
storagePut
|
||||
***********************************************************************************************************************************/
|
||||
#define storagePutNP(file, buffer) \
|
||||
#define storagePutP(file, buffer) \
|
||||
storagePut(file, buffer)
|
||||
|
||||
void storagePut(StorageWrite *file, const Buffer *buffer);
|
||||
@ -257,19 +241,19 @@ storageRemove
|
||||
***********************************************************************************************************************************/
|
||||
typedef struct StorageRemoveParam
|
||||
{
|
||||
VAR_PARAM_HEADER;
|
||||
bool errorOnMissing;
|
||||
} StorageRemoveParam;
|
||||
|
||||
#define storageRemoveP(this, fileExp, ...) \
|
||||
storageRemove(this, fileExp, (StorageRemoveParam){__VA_ARGS__})
|
||||
#define storageRemoveNP(this, fileExp) \
|
||||
storageRemove(this, fileExp, (StorageRemoveParam){0})
|
||||
storageRemove(this, fileExp, (StorageRemoveParam){VAR_PARAM_INIT, __VA_ARGS__})
|
||||
|
||||
void storageRemove(const Storage *this, const String *fileExp, StorageRemoveParam param);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Getters
|
||||
***********************************************************************************************************************************/
|
||||
bool storageFeature(const Storage *this, StorageFeature feature);
|
||||
const String *storageType(const Storage *this);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
@ -45,36 +45,36 @@ testRun(void)
|
||||
TEST_RESULT_BOOL(archiveAsyncStatus(archiveModePush, segment, false), false, "status file not present");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_OUT "/%s.ok", strPtr(segment))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_OUT "/%s.ok", strPtr(segment))),
|
||||
BUFSTRDEF(BOGUS_STR));
|
||||
TEST_ERROR(
|
||||
archiveAsyncStatus(archiveModePush, segment, false), FormatError,
|
||||
"000000010000000100000001.ok content must have at least two lines");
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_OUT "/%s.ok", strPtr(segment))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_OUT "/%s.ok", strPtr(segment))),
|
||||
BUFSTRDEF(BOGUS_STR "\n"));
|
||||
TEST_ERROR(
|
||||
archiveAsyncStatus(archiveModePush, segment, false), FormatError, "000000010000000100000001.ok message must be > 0");
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_OUT "/%s.ok", strPtr(segment))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_OUT "/%s.ok", strPtr(segment))),
|
||||
BUFSTRDEF(BOGUS_STR "\nmessage"));
|
||||
TEST_ERROR(
|
||||
archiveAsyncStatus(archiveModePush, segment, false), FormatError, "unable to convert base 10 string 'BOGUS' to int");
|
||||
|
||||
storagePutNP(storageNewWriteNP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_OUT "/%s.ok", strPtr(segment))), NULL);
|
||||
storagePutP(storageNewWriteP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_OUT "/%s.ok", strPtr(segment))), NULL);
|
||||
TEST_RESULT_BOOL(archiveAsyncStatus(archiveModePush, segment, false), true, "ok file");
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_OUT "/%s.ok", strPtr(segment))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_OUT "/%s.ok", strPtr(segment))),
|
||||
BUFSTRDEF("0\nwarning"));
|
||||
TEST_RESULT_BOOL(archiveAsyncStatus(archiveModePush, segment, false), true, "ok file with warning");
|
||||
harnessLogResult("P00 WARN: warning");
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_OUT "/%s.ok", strPtr(segment))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_OUT "/%s.ok", strPtr(segment))),
|
||||
BUFSTRDEF("25\nerror"));
|
||||
TEST_RESULT_BOOL(archiveAsyncStatus(archiveModePush, segment, false), true, "error status renamed to ok");
|
||||
harnessLogResult(
|
||||
@ -85,22 +85,22 @@ testRun(void)
|
||||
"remove ok");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_OUT "/%s.error", strPtr(segment))), bufNew(0));
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_OUT "/%s.error", strPtr(segment))), bufNew(0));
|
||||
TEST_ERROR(
|
||||
archiveAsyncStatus(archiveModePush, segment, true), AssertError,
|
||||
"status file '000000010000000100000001.error' has no content");
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_OUT "/%s.error", strPtr(segment))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_OUT "/%s.error", strPtr(segment))),
|
||||
BUFSTRDEF("25\nmessage"));
|
||||
TEST_ERROR(archiveAsyncStatus(archiveModePush, segment, true), AssertError, "message");
|
||||
|
||||
TEST_RESULT_BOOL(archiveAsyncStatus(archiveModePush, segment, false), false, "suppress error");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/global.error")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/global.error")),
|
||||
BUFSTRDEF("102\nexecute error"));
|
||||
|
||||
TEST_ERROR(archiveAsyncStatus(archiveModePush, strNew("anyfile"), true), ExecuteError, "execute error");
|
||||
@ -120,7 +120,7 @@ testRun(void)
|
||||
TEST_RESULT_VOID(
|
||||
archiveAsyncStatusErrorWrite(archiveModeGet, walSegment, 25, strNew("error message")), "write error");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storageTest, strNew("archive/db/in/000000010000000100000001.error"))))),
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(storageTest, strNew("archive/db/in/000000010000000100000001.error"))))),
|
||||
"25\nerror message", "check error");
|
||||
TEST_RESULT_VOID(
|
||||
storageRemoveP(storageTest, strNew("archive/db/in/000000010000000100000001.error"), .errorOnMissing = true),
|
||||
@ -129,7 +129,7 @@ testRun(void)
|
||||
TEST_RESULT_VOID(
|
||||
archiveAsyncStatusErrorWrite(archiveModeGet, NULL, 25, strNew("global error message")), "write global error");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storageTest, strNew("archive/db/in/global.error"))))),
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(storageTest, strNew("archive/db/in/global.error"))))),
|
||||
"25\nglobal error message", "check global error");
|
||||
TEST_RESULT_VOID(
|
||||
storageRemoveP(storageTest, strNew("archive/db/in/global.error"), .errorOnMissing = true),
|
||||
@ -138,7 +138,7 @@ testRun(void)
|
||||
TEST_RESULT_VOID(
|
||||
archiveAsyncStatusOkWrite(archiveModeGet, walSegment, NULL), "write ok file");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storageTest, strNew("archive/db/in/000000010000000100000001.ok"))))),
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(storageTest, strNew("archive/db/in/000000010000000100000001.ok"))))),
|
||||
"", "check ok");
|
||||
TEST_RESULT_VOID(
|
||||
storageRemoveP(storageTest, strNew("archive/db/in/000000010000000100000001.ok"), .errorOnMissing = true),
|
||||
@ -147,7 +147,7 @@ testRun(void)
|
||||
TEST_RESULT_VOID(
|
||||
archiveAsyncStatusOkWrite(archiveModeGet, walSegment, strNew("WARNING")), "write ok file with warning");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storageTest, strNew("archive/db/in/000000010000000100000001.ok"))))),
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(storageTest, strNew("archive/db/in/000000010000000100000001.ok"))))),
|
||||
"0\nWARNING", "check ok warning");
|
||||
TEST_RESULT_VOID(
|
||||
storageRemoveP(storageTest, strNew("archive/db/in/000000010000000100000001.ok"), .errorOnMissing = true),
|
||||
@ -190,7 +190,7 @@ testRun(void)
|
||||
|
||||
TEST_RESULT_PTR(walSegmentFind(storageRepo(), strNew("9.6-2"), strNew("123456781234567812345678"), 0), NULL, "no path");
|
||||
|
||||
storagePathCreateNP(storageTest, strNew("archive/db/9.6-2/1234567812345678"));
|
||||
storagePathCreateP(storageTest, strNew("archive/db/9.6-2/1234567812345678"));
|
||||
TEST_RESULT_PTR(walSegmentFind(storageRepo(), strNew("9.6-2"), strNew("123456781234567812345678"), 0), NULL, "no segment");
|
||||
TEST_RESULT_PTR(
|
||||
walSegmentFind(storageRepo(), strNew("9.6-2"), strNew("123456781234567812345678"), 500), NULL,
|
||||
@ -203,8 +203,8 @@ testRun(void)
|
||||
{
|
||||
sleepMSec(250);
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageTest,
|
||||
strNew(
|
||||
"archive/db/9.6-2/1234567812345678/123456781234567812345678-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")),
|
||||
@ -222,8 +222,8 @@ testRun(void)
|
||||
}
|
||||
HARNESS_FORK_END();
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageTest,
|
||||
strNew("archive/db/9.6-2/1234567812345678/123456781234567812345678-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.gz")),
|
||||
NULL);
|
||||
|
@ -44,14 +44,14 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdArchiveGet, argList);
|
||||
|
||||
// Create pg_control file
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNew("db/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNew("db/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_10, .systemId = 0xFACEFACEFACEFACE}));
|
||||
|
||||
// Control and archive info mismatch
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNew("repo/archive/test1/archive.info")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNew("repo/archive/test1/archive.info")),
|
||||
harnessInfoChecksumZ(
|
||||
"[db]\n"
|
||||
"db-id=1\n"
|
||||
@ -65,8 +65,8 @@ testRun(void)
|
||||
|
||||
// Nothing to find in empty archive dir
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNew("repo/archive/test1/archive.info")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNew("repo/archive/test1/archive.info")),
|
||||
harnessInfoChecksumZ(
|
||||
"[db]\n"
|
||||
"db-id=3\n"
|
||||
@ -82,8 +82,8 @@ testRun(void)
|
||||
|
||||
// Write segment into an older archive path
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageTest,
|
||||
strNew(
|
||||
"repo/archive/test1/10-2/8765432187654321/876543218765432187654321-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")),
|
||||
@ -95,8 +95,8 @@ testRun(void)
|
||||
|
||||
// Write segment into an newer archive path
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageTest,
|
||||
strNew(
|
||||
"repo/archive/test1/10-4/8765432187654321/876543218765432187654321-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb")),
|
||||
@ -111,7 +111,7 @@ testRun(void)
|
||||
TEST_RESULT_PTR(
|
||||
archiveGetCheck(strNew("00000009.history"), cipherTypeNone, NULL).archiveFileActual, NULL, "history file not found");
|
||||
|
||||
storagePutNP(storageNewWriteNP(storageTest, strNew("repo/archive/test1/10-4/00000009.history")), NULL);
|
||||
storagePutP(storageNewWriteP(storageTest, strNew("repo/archive/test1/10-4/00000009.history")), NULL);
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(
|
||||
@ -131,13 +131,13 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdArchiveGet, argList);
|
||||
|
||||
// Create pg_control file
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNew("db/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNew("db/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_10, .systemId = 0xFACEFACEFACEFACE}));
|
||||
|
||||
// Create archive.info
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNew("repo/archive/test1/archive.info")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNew("repo/archive/test1/archive.info")),
|
||||
harnessInfoChecksumZ(
|
||||
"[db]\n"
|
||||
"db-id=1\n"
|
||||
@ -149,7 +149,7 @@ testRun(void)
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
String *archiveFile = strNew("01ABCDEF01ABCDEF01ABCDEF");
|
||||
String *walDestination = strNewFmt("%s/db/pg_wal/RECOVERYXLOG", testPath());
|
||||
storagePathCreateNP(storageTest, strPath(walDestination));
|
||||
storagePathCreateP(storageTest, strPath(walDestination));
|
||||
|
||||
TEST_RESULT_INT(
|
||||
archiveGetFile(storageTest, archiveFile, walDestination, false, cipherTypeNone, NULL), 1, "WAL segment missing");
|
||||
@ -160,8 +160,8 @@ testRun(void)
|
||||
memset(bufPtr(buffer), 0, bufSize(buffer));
|
||||
bufUsedSet(buffer, bufSize(buffer));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageTest,
|
||||
strNew(
|
||||
"repo/archive/test1/10-1/01ABCDEF01ABCDEF/01ABCDEF01ABCDEF01ABCDEF-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")),
|
||||
@ -169,8 +169,8 @@ testRun(void)
|
||||
|
||||
TEST_RESULT_INT(
|
||||
archiveGetFile(storageTest, archiveFile, walDestination, false, cipherTypeNone, NULL), 0, "WAL segment copied");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, walDestination), true, " check exists");
|
||||
TEST_RESULT_INT(storageInfoNP(storageTest, walDestination).size, 16 * 1024 * 1024, " check size");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, walDestination), true, " check exists");
|
||||
TEST_RESULT_INT(storageInfoP(storageTest, walDestination).size, 16 * 1024 * 1024, " check size");
|
||||
|
||||
storageRemoveP(
|
||||
storageTest,
|
||||
@ -180,13 +180,13 @@ testRun(void)
|
||||
|
||||
// Create a compressed WAL segment to copy
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
StorageWrite *infoWrite = storageNewWriteNP(storageTest, strNew("repo/archive/test1/archive.info"));
|
||||
StorageWrite *infoWrite = storageNewWriteP(storageTest, strNew("repo/archive/test1/archive.info"));
|
||||
|
||||
ioFilterGroupAdd(
|
||||
ioWriteFilterGroup(storageWriteIo(infoWrite)), cipherBlockNew(cipherModeEncrypt, cipherTypeAes256Cbc,
|
||||
BUFSTRDEF("12345678"), NULL));
|
||||
|
||||
storagePutNP(
|
||||
storagePutP(
|
||||
infoWrite,
|
||||
harnessInfoChecksumZ(
|
||||
"[cipher]\n"
|
||||
@ -198,7 +198,7 @@ testRun(void)
|
||||
"[db:history]\n"
|
||||
"1={\"db-id\":18072658121562454734,\"db-version\":\"10\"}"));
|
||||
|
||||
StorageWrite *destination = storageNewWriteNP(
|
||||
StorageWrite *destination = storageNewWriteP(
|
||||
storageTest,
|
||||
strNew(
|
||||
"repo/archive/test1/10-1/01ABCDEF01ABCDEF/01ABCDEF01ABCDEF01ABCDEF-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.gz"));
|
||||
@ -207,13 +207,13 @@ testRun(void)
|
||||
ioFilterGroupAdd(filterGroup, gzipCompressNew(3, false));
|
||||
ioFilterGroupAdd(
|
||||
filterGroup, cipherBlockNew(cipherModeEncrypt, cipherTypeAes256Cbc, BUFSTRDEF("worstpassphraseever"), NULL));
|
||||
storagePutNP(destination, buffer);
|
||||
storagePutP(destination, buffer);
|
||||
|
||||
TEST_RESULT_INT(
|
||||
archiveGetFile(
|
||||
storageTest, archiveFile, walDestination, false, cipherTypeAes256Cbc, strNew("12345678")), 0, "WAL segment copied");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, walDestination), true, " check exists");
|
||||
TEST_RESULT_INT(storageInfoNP(storageTest, walDestination).size, 16 * 1024 * 1024, " check size");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, walDestination), true, " check exists");
|
||||
TEST_RESULT_INT(storageInfoP(storageTest, walDestination).size, 16 * 1024 * 1024, " check size");
|
||||
|
||||
// Check protocol function directly
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -227,7 +227,7 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdArchiveGetAsync, argList);
|
||||
unsetenv("PGBACKREST_REPO1_CIPHER_PASS");
|
||||
|
||||
storagePathCreateNP(storageTest, strNew("spool/archive/test1/in"));
|
||||
storagePathCreateP(storageTest, strNew("spool/archive/test1/in"));
|
||||
|
||||
VariantList *paramList = varLstNew();
|
||||
varLstAdd(paramList, varNewStr(archiveFile));
|
||||
@ -236,7 +236,7 @@ testRun(void)
|
||||
archiveGetProtocol(PROTOCOL_COMMAND_ARCHIVE_GET_STR, paramList, server), true, "protocol archive get");
|
||||
TEST_RESULT_STR(strPtr(strNewBuf(serverWrite)), "{\"out\":0}\n", "check result");
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageTest, strNewFmt("spool/archive/test1/in/%s", strPtr(archiveFile))), true, " check exists");
|
||||
storageExistsP(storageTest, strNewFmt("spool/archive/test1/in/%s", strPtr(archiveFile))), true, " check exists");
|
||||
|
||||
bufUsedSet(serverWrite, 0);
|
||||
|
||||
@ -262,7 +262,7 @@ testRun(void)
|
||||
PathMissingError, "unable to list files for missing path '%s/spool/archive/test1/in'", testPath());
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePathCreateNP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_IN));
|
||||
storagePathCreateP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_IN));
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(queueNeed(strNew("000000010000000100000001"), false, queueSize, walSegmentSize, PG_VERSION_92), "|")),
|
||||
@ -279,11 +279,11 @@ testRun(void)
|
||||
Buffer *walSegmentBuffer = bufNew(walSegmentSize);
|
||||
memset(bufPtr(walSegmentBuffer), 0, walSegmentSize);
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/0000000100000001000000FE")), walSegmentBuffer);
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/0000000100000001000000FF")), walSegmentBuffer);
|
||||
|
||||
TEST_RESULT_STR(
|
||||
@ -291,19 +291,19 @@ testRun(void)
|
||||
"000000010000000200000000|000000010000000200000001", "queue has wal < 9.3");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(storageListNP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_IN)), "|")),
|
||||
strPtr(strLstJoin(storageListP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_IN)), "|")),
|
||||
"0000000100000001000000FE", "check queue");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
walSegmentSize = 1024 * 1024;
|
||||
queueSize = walSegmentSize * 5;
|
||||
|
||||
storagePutNP(storageNewWriteNP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/junk")), BUFSTRDEF("JUNK"));
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(storageNewWriteP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/junk")), BUFSTRDEF("JUNK"));
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000A00000FFE")), walSegmentBuffer);
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000A00000FFF")), walSegmentBuffer);
|
||||
|
||||
TEST_RESULT_STR(
|
||||
@ -311,7 +311,7 @@ testRun(void)
|
||||
"000000010000000B00000000|000000010000000B00000001|000000010000000B00000002", "queue has wal >= 9.3");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN)), sortOrderAsc), "|")),
|
||||
strPtr(strLstJoin(strLstSort(storageListP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN)), sortOrderAsc), "|")),
|
||||
"000000010000000A00000FFE|000000010000000A00000FFF", "check queue");
|
||||
}
|
||||
|
||||
@ -332,12 +332,12 @@ testRun(void)
|
||||
|
||||
// Create pg_control file and archive.info
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNew("pg/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNew("pg/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_10, .systemId = 0xFACEFACEFACEFACE}));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNew("repo/archive/test2/archive.info")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNew("repo/archive/test2/archive.info")),
|
||||
harnessInfoChecksumZ(
|
||||
"[db]\n"
|
||||
"db-id=1\n"
|
||||
@ -351,11 +351,11 @@ testRun(void)
|
||||
strLstAddZ(argList, "000000010000000100000001");
|
||||
harnessCfgLoad(cfgCmdArchiveGetAsync, argList);
|
||||
|
||||
storagePathCreateNP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_IN));
|
||||
storagePathCreateP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_IN));
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageTest,
|
||||
strNew(
|
||||
"repo/archive/test2/10-1/0000000100000001/"
|
||||
@ -369,7 +369,7 @@ testRun(void)
|
||||
"P01 DETAIL: found 000000010000000100000001 in the archive");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000001")), true,
|
||||
storageExistsP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000001")), true,
|
||||
"check 000000010000000100000001 in spool");
|
||||
|
||||
// Get multiple segments where some are missing or errored
|
||||
@ -380,11 +380,11 @@ testRun(void)
|
||||
strLstAddZ(argList, "000000010000000100000003");
|
||||
harnessCfgLoad(cfgCmdArchiveGetAsync, argList);
|
||||
|
||||
storagePathCreateNP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_IN));
|
||||
storagePathCreateP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_IN));
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageTest,
|
||||
strNew(
|
||||
"repo/archive/test2/10-1/0000000100000001/"
|
||||
@ -393,8 +393,8 @@ testRun(void)
|
||||
"normal WAL segment");
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageTest,
|
||||
strNew(
|
||||
"repo/archive/test2/10-1/0000000100000001/"
|
||||
@ -414,19 +414,19 @@ testRun(void)
|
||||
" HINT: are multiple primaries archiving to this stanza?");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000001")), true,
|
||||
storageExistsP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000001")), true,
|
||||
"check 000000010000000100000001 in spool");
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000002")), false,
|
||||
storageExistsP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000002")), false,
|
||||
"check 000000010000000100000002 not in spool");
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000002.ok")), true,
|
||||
storageExistsP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000002.ok")), true,
|
||||
"check 000000010000000100000002.ok in spool");
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000003")), false,
|
||||
storageExistsP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000003")), false,
|
||||
"check 000000010000000100000003 not in spool");
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000003.error")), true,
|
||||
storageExistsP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000003.error")), true,
|
||||
"check 000000010000000100000003.error in spool");
|
||||
|
||||
protocolFree();
|
||||
@ -455,19 +455,19 @@ testRun(void)
|
||||
"P00 INFO: get 3 WAL file(s) from archive: 000000010000000100000001...000000010000000100000003");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000001.error")), false,
|
||||
storageExistsP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000001.error")), false,
|
||||
"check 000000010000000100000001.error not in spool");
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000002.error")), false,
|
||||
storageExistsP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000002.error")), false,
|
||||
"check 000000010000000100000002.error not in spool");
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000003.error")), false,
|
||||
storageExistsP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000003.error")), false,
|
||||
"check 000000010000000100000003.error not in spool");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(
|
||||
strNewBuf(
|
||||
storageGetNP(
|
||||
storageNewReadNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/global.error"))))),
|
||||
storageGetP(
|
||||
storageNewReadP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_IN "/global.error"))))),
|
||||
"102\nlocal-1 process terminated unexpectedly [102]: unable to execute 'pgbackrest-bogus': "
|
||||
"[2] No such file or directory",
|
||||
"check global error");
|
||||
@ -514,11 +514,11 @@ testRun(void)
|
||||
HARNESS_FORK_END();
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNew("db/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNew("db/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_10, .systemId = 0xFACEFACEFACEFACE}));
|
||||
|
||||
storagePathCreateNP(storageTest, strNewFmt("%s/db/pg_wal", testPath()));
|
||||
storagePathCreateP(storageTest, strNewFmt("%s/db/pg_wal", testPath()));
|
||||
|
||||
String *walFile = strNewFmt("%s/db/pg_wal/RECOVERYXLOG", testPath());
|
||||
strLstAdd(argListTemp, walFile);
|
||||
@ -602,8 +602,8 @@ testRun(void)
|
||||
|
||||
// Check for missing WAL
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_IN "/%s.ok", strPtr(walSegment))), NULL);
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_IN "/%s.ok", strPtr(walSegment))), NULL);
|
||||
|
||||
HARNESS_FORK_BEGIN()
|
||||
{
|
||||
@ -618,15 +618,15 @@ testRun(void)
|
||||
harnessLogResult("P00 INFO: unable to find 000000010000000100000001 in the archive");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageSpool(), strNewFmt(STORAGE_SPOOL_ARCHIVE_IN "/%s.ok", strPtr(walSegment))), false,
|
||||
storageExistsP(storageSpool(), strNewFmt(STORAGE_SPOOL_ARCHIVE_IN "/%s.ok", strPtr(walSegment))), false,
|
||||
"check OK file was removed");
|
||||
|
||||
// Write out a WAL segment for success
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
THROW_ON_SYS_ERROR(chdir(strPtr(cfgOptionStr(cfgOptPgPath))) != 0, PathMissingError, "unable to chdir()");
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_IN "/%s", strPtr(walSegment))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_IN "/%s", strPtr(walSegment))),
|
||||
BUFSTRDEF("SHOULD-BE-A-REAL-WAL-FILE"));
|
||||
|
||||
HARNESS_FORK_BEGIN()
|
||||
@ -642,9 +642,9 @@ testRun(void)
|
||||
TEST_RESULT_VOID(harnessLogResult("P00 INFO: found 000000010000000100000001 in the archive"), "check log");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_IN "/%s", strPtr(walSegment))), false,
|
||||
storageExistsP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_IN "/%s", strPtr(walSegment))), false,
|
||||
"check WAL segment was removed from source");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, walFile), true, "check WAL segment was moved to destination");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, walFile), true, "check WAL segment was moved to destination");
|
||||
storageRemoveP(storageTest, walFile, .errorOnMissing = true);
|
||||
|
||||
// Write more WAL segments (in this case queue should be full)
|
||||
@ -654,11 +654,11 @@ testRun(void)
|
||||
|
||||
String *walSegment2 = strNew("000000010000000100000002");
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_IN "/%s", strPtr(walSegment))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_IN "/%s", strPtr(walSegment))),
|
||||
BUFSTRDEF("SHOULD-BE-A-REAL-WAL-FILE"));
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_IN "/%s", strPtr(walSegment2))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNewFmt(STORAGE_SPOOL_ARCHIVE_IN "/%s", strPtr(walSegment2))),
|
||||
BUFSTRDEF("SHOULD-BE-A-REAL-WAL-FILE"));
|
||||
|
||||
HARNESS_FORK_BEGIN()
|
||||
@ -673,7 +673,7 @@ testRun(void)
|
||||
|
||||
TEST_RESULT_VOID(harnessLogResult("P00 INFO: found 000000010000000100000001 in the archive"), "check log");
|
||||
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, walFile), true, "check WAL segment was moved");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, walFile), true, "check WAL segment was moved");
|
||||
|
||||
// Make sure the process times out when it can't get a lock
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -44,35 +44,35 @@ testRun(void)
|
||||
strLstAdd(argList, strNewFmt("--spool-path=%s/spool", testPath()));
|
||||
harnessCfgLoad(cfgCmdArchivePushAsync, argList);
|
||||
|
||||
storagePathCreateNP(storagePgWrite(), strNew("pg_wal/archive_status"));
|
||||
storagePathCreateNP(storageTest, strNew("spool/archive/db/out"));
|
||||
storagePathCreateP(storagePgWrite(), strNew("pg_wal/archive_status"));
|
||||
storagePathCreateP(storageTest, strNew("spool/archive/db/out"));
|
||||
|
||||
// Create ok files to indicate WAL that has already been archived
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000001.ok")), NULL);
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000003.ok")), NULL);
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000004.ok")), NULL);
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000005.error")), NULL);
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000006.error")), NULL);
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/global.error")), NULL);
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000001.ok")), NULL);
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000003.ok")), NULL);
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000004.ok")), NULL);
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000005.error")), NULL);
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000006.error")), NULL);
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/global.error")), NULL);
|
||||
|
||||
// Create ready files for wal that still needs to be archived
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_wal/archive_status/000000010000000100000002.ready")), NULL);
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_wal/archive_status/000000010000000100000003.ready")), NULL);
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_wal/archive_status/000000010000000100000005.ready")), NULL);
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_wal/archive_status/000000010000000100000006.ready")), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/archive_status/000000010000000100000002.ready")), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/archive_status/000000010000000100000003.ready")), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/archive_status/000000010000000100000005.ready")), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/archive_status/000000010000000100000006.ready")), NULL);
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(archivePushProcessList(strNewFmt("%s/db/pg_wal", testPath())), "|")),
|
||||
"000000010000000100000002|000000010000000100000005|000000010000000100000006", "ready list");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|")),
|
||||
strPtr(strLstJoin(strLstSort(storageListP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|")),
|
||||
"000000010000000100000003.ok", "remaining status list");
|
||||
|
||||
// Test drop
|
||||
@ -87,10 +87,10 @@ testRun(void)
|
||||
memset(bufPtr(walBuffer), 0, bufSize(walBuffer));
|
||||
pgWalTestToBuffer((PgWal){.version = PG_VERSION_10, .systemId = 0xFACEFACEFACEFACE}, walBuffer);
|
||||
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_wal/000000010000000100000002")), walBuffer);
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_wal/000000010000000100000003")), walBuffer);
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_wal/000000010000000100000005")), walBuffer);
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_wal/000000010000000100000006")), walBuffer);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/000000010000000100000002")), walBuffer);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/000000010000000100000003")), walBuffer);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/000000010000000100000005")), walBuffer);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/000000010000000100000006")), walBuffer);
|
||||
|
||||
// Queue max is high enough that no WAL will be dropped
|
||||
TEST_RESULT_BOOL(
|
||||
@ -118,13 +118,13 @@ testRun(void)
|
||||
|
||||
// Check mismatched pg_control and archive.info
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNew("pg/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNew("pg/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_96, .systemId = 0xFACEFACEFACEFACE}));
|
||||
|
||||
// Create incorrect archive info
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNew("repo/archive/test/archive.info")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNew("repo/archive/test/archive.info")),
|
||||
harnessInfoChecksumZ(
|
||||
"[db]\n"
|
||||
"db-id=1\n"
|
||||
@ -138,8 +138,8 @@ testRun(void)
|
||||
"\nHINT: are you archiving to the correct stanza?");
|
||||
|
||||
// Fix the version
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNew("repo/archive/test/archive.info")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNew("repo/archive/test/archive.info")),
|
||||
harnessInfoChecksumZ(
|
||||
"[db]\n"
|
||||
"db-id=1\n"
|
||||
@ -153,8 +153,8 @@ testRun(void)
|
||||
"\nHINT: are you archiving to the correct stanza?");
|
||||
|
||||
// Fix archive info
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNew("repo/archive/test/archive.info")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNew("repo/archive/test/archive.info")),
|
||||
harnessInfoChecksumZ(
|
||||
"[db]\n"
|
||||
"db-id=1\n"
|
||||
@ -190,12 +190,12 @@ testRun(void)
|
||||
strLstAddZ(argListTemp, "pg_wal/000000010000000100000001");
|
||||
harnessCfgLoad(cfgCmdArchivePush, argListTemp);
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNew("pg/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNew("pg/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_11, .systemId = 0xFACEFACEFACEFACE}));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNew("repo/archive/test/archive.info")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNew("repo/archive/test/archive.info")),
|
||||
harnessInfoChecksumZ(
|
||||
"[db]\n"
|
||||
"db-id=1\n"
|
||||
@ -210,7 +210,7 @@ testRun(void)
|
||||
memset(bufPtr(walBuffer1), 0, bufSize(walBuffer1));
|
||||
pgWalTestToBuffer((PgWal){.version = PG_VERSION_10, .systemId = 0xFACEFACEFACEFACE}, walBuffer1);
|
||||
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_wal/000000010000000100000001")), walBuffer1);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/000000010000000100000001")), walBuffer1);
|
||||
|
||||
THROW_ON_SYS_ERROR(chdir(strPtr(cfgOptionStr(cfgOptPgPath))) != 0, PathMissingError, "unable to chdir()");
|
||||
|
||||
@ -225,7 +225,7 @@ testRun(void)
|
||||
memset(bufPtr(walBuffer1), 0, bufSize(walBuffer1));
|
||||
pgWalTestToBuffer((PgWal){.version = PG_VERSION_11, .systemId = 0xECAFECAFECAFECAF}, walBuffer1);
|
||||
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_wal/000000010000000100000001")), walBuffer1);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/000000010000000100000001")), walBuffer1);
|
||||
|
||||
TEST_ERROR(
|
||||
cmdArchivePush(), ArchiveMismatchError,
|
||||
@ -240,13 +240,13 @@ testRun(void)
|
||||
memset(bufPtr(walBuffer1), 0, bufSize(walBuffer1));
|
||||
pgWalTestToBuffer((PgWal){.version = PG_VERSION_11, .systemId = 0xFACEFACEFACEFACE}, walBuffer1);
|
||||
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_wal/000000010000000100000001")), walBuffer1);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/000000010000000100000001")), walBuffer1);
|
||||
|
||||
TEST_RESULT_VOID(cmdArchivePush(), "push the WAL segment");
|
||||
harnessLogResult("P00 INFO: pushed WAL file '000000010000000100000001' to the archive");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(
|
||||
storageExistsP(
|
||||
storageTest,
|
||||
strNewFmt(
|
||||
"repo/archive/test/11-1/0000000100000001/000000010000000100000001-%s.gz",
|
||||
@ -265,7 +265,7 @@ testRun(void)
|
||||
memset(bufPtr(walBuffer2), 0xFF, bufSize(walBuffer2));
|
||||
pgWalTestToBuffer((PgWal){.version = PG_VERSION_11, .systemId = 0xFACEFACEFACEFACE}, walBuffer2);
|
||||
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_wal/000000010000000100000001")), walBuffer2);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/000000010000000100000001")), walBuffer2);
|
||||
|
||||
TEST_ERROR(cmdArchivePush(), ArchiveDuplicateError, "WAL file '000000010000000100000001' already exists in the archive");
|
||||
|
||||
@ -274,13 +274,13 @@ testRun(void)
|
||||
strLstAddZ(argListTemp, "pg_wal/000000010000000100000002");
|
||||
harnessCfgLoad(cfgCmdArchivePush, argListTemp);
|
||||
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_wal/000000010000000100000002")), walBuffer2);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/000000010000000100000002")), walBuffer2);
|
||||
|
||||
TEST_RESULT_VOID(cmdArchivePush(), "push the WAL segment");
|
||||
harnessLogResult("P00 INFO: pushed WAL file '000000010000000100000002' to the archive");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(
|
||||
storageExistsP(
|
||||
storageTest,
|
||||
strNewFmt(
|
||||
"repo/archive/test/11-1/0000000100000001/000000010000000100000002-%s.gz",
|
||||
@ -293,18 +293,18 @@ testRun(void)
|
||||
strLstAddZ(argListTemp, "pg_wal/00000001.history");
|
||||
harnessCfgLoad(cfgCmdArchivePush, argListTemp);
|
||||
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_wal/00000001.history")), BUFSTRDEF("FAKEHISTORY"));
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/00000001.history")), BUFSTRDEF("FAKEHISTORY"));
|
||||
|
||||
TEST_RESULT_VOID(cmdArchivePush(), "push a history file");
|
||||
harnessLogResult("P00 INFO: pushed WAL file '00000001.history' to the archive");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageTest, strNew("repo/archive/test/11-1/00000001.history")), true, "check repo for history file");
|
||||
storageExistsP(storageTest, strNew("repo/archive/test/11-1/00000001.history")), true, "check repo for history file");
|
||||
|
||||
// Check drop functionality
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_wal/archive_status/000000010000000100000001.ready")), NULL);
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_wal/archive_status/000000010000000100000002.ready")), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/archive_status/000000010000000100000001.ready")), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/archive_status/000000010000000100000002.ready")), NULL);
|
||||
|
||||
argListTemp = strLstDup(argList);
|
||||
strLstAddZ(argListTemp, "--archive-push-queue-max=16m");
|
||||
@ -356,13 +356,13 @@ testRun(void)
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePathRemoveP(storageTest, strNew("repo"), .errorOnMissing = true, .recurse = true);
|
||||
|
||||
StorageWrite *infoWrite = storageNewWriteNP(storageTest, strNew("repo/archive/test/archive.info"));
|
||||
StorageWrite *infoWrite = storageNewWriteP(storageTest, strNew("repo/archive/test/archive.info"));
|
||||
|
||||
ioFilterGroupAdd(
|
||||
ioWriteFilterGroup(storageWriteIo(infoWrite)), cipherBlockNew(cipherModeEncrypt, cipherTypeAes256Cbc,
|
||||
BUFSTRDEF("badpassphrase"), NULL));
|
||||
|
||||
storagePutNP(
|
||||
storagePutP(
|
||||
infoWrite,
|
||||
harnessInfoChecksumZ(
|
||||
"[cipher]\n"
|
||||
@ -387,7 +387,7 @@ testRun(void)
|
||||
harnessLogResult("P00 INFO: pushed WAL file '000000010000000100000002' to the archive");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(
|
||||
storageExistsP(
|
||||
storageTest,
|
||||
strNewFmt(
|
||||
"repo/archive/test/11-1/0000000100000001/000000010000000100000002-%s",
|
||||
@ -432,12 +432,12 @@ testRun(void)
|
||||
strLstAdd(argList, strNewFmt("--repo1-path=%s/repo", testPath()));
|
||||
strLstAddZ(argList, "--log-subprocess");
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNew("pg/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNew("pg/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_94, .systemId = 0xAAAABBBBCCCCDDDD}));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNew("repo/archive/test/archive.info")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNew("repo/archive/test/archive.info")),
|
||||
harnessInfoChecksumZ(
|
||||
"[db]\n"
|
||||
"db-id=1\n"
|
||||
@ -451,10 +451,10 @@ testRun(void)
|
||||
strLstAdd(argListTemp, strNewFmt("%s/pg/pg_xlog/000000010000000100000001", testPath()));
|
||||
harnessCfgLoad(cfgCmdArchivePush, argListTemp);
|
||||
|
||||
storagePathCreateNP(storagePgWrite(), strNew("pg_xlog/archive_status"));
|
||||
storagePathCreateP(storagePgWrite(), strNew("pg_xlog/archive_status"));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000001.error")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageSpoolWrite(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000001.error")),
|
||||
BUFSTRDEF("25\nbogus error"));
|
||||
|
||||
TEST_ERROR(cmdArchivePush(), AssertError, "no WAL files to process");
|
||||
@ -518,20 +518,20 @@ testRun(void)
|
||||
strLstAdd(argListTemp, strNewFmt("%s/pg/pg_xlog/000000010000000100000001", testPath()));
|
||||
harnessCfgLoad(cfgCmdArchivePush, argListTemp);
|
||||
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_xlog/archive_status/000000010000000100000001.ready")), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_xlog/archive_status/000000010000000100000001.ready")), NULL);
|
||||
|
||||
Buffer *walBuffer1 = bufNew((size_t)16 * 1024 * 1024);
|
||||
bufUsedSet(walBuffer1, bufSize(walBuffer1));
|
||||
memset(bufPtr(walBuffer1), 0xFF, bufSize(walBuffer1));
|
||||
pgWalTestToBuffer((PgWal){.version = PG_VERSION_94, .systemId = 0xAAAABBBBCCCCDDDD}, walBuffer1);
|
||||
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_xlog/000000010000000100000001")), walBuffer1);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_xlog/000000010000000100000001")), walBuffer1);
|
||||
|
||||
TEST_RESULT_VOID(cmdArchivePush(), "push the WAL segment");
|
||||
harnessLogResult("P00 INFO: pushed WAL file '000000010000000100000001' to the archive asynchronously");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(
|
||||
storageExistsP(
|
||||
storageTest,
|
||||
strNewFmt(
|
||||
"repo/archive/test/9.4-1/0000000100000001/000000010000000100000001-%s",
|
||||
@ -555,13 +555,13 @@ testRun(void)
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
// Remove data from prior tests
|
||||
storagePathRemoveP(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT_STR, .recurse = true);
|
||||
storagePathCreateNP(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT_STR);
|
||||
storagePathCreateP(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT_STR);
|
||||
|
||||
storagePathRemoveP(storageRepoWrite(), strNew(STORAGE_REPO_ARCHIVE "/9.4-1"), .recurse = true);
|
||||
storagePathCreateNP(storageRepoWrite(), strNew(STORAGE_REPO_ARCHIVE "/9.4-1"));
|
||||
storagePathCreateP(storageRepoWrite(), strNew(STORAGE_REPO_ARCHIVE "/9.4-1"));
|
||||
|
||||
storagePathRemoveP(storagePgWrite(), strNew("pg_xlog/archive_status"), .recurse = true);
|
||||
storagePathCreateNP(storagePgWrite(), strNew("pg_xlog/archive_status"));
|
||||
storagePathCreateP(storagePgWrite(), strNew("pg_xlog/archive_status"));
|
||||
|
||||
strLstAdd(argList, strNewFmt("%s/pg/pg_xlog", testPath()));
|
||||
harnessCfgLoad(cfgCmdArchivePushAsync, argList);
|
||||
@ -569,20 +569,20 @@ testRun(void)
|
||||
TEST_ERROR(cmdArchivePushAsync(), AssertError, "no WAL files to process");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/global.error"))))),
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/global.error"))))),
|
||||
"25\nno WAL files to process", "check global.error");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|")),
|
||||
strPtr(strLstJoin(strLstSort(storageListP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|")),
|
||||
"global.error", "check status files");
|
||||
|
||||
// Push WAL
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
// Recreate ready file for WAL 1
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_xlog/archive_status/000000010000000100000001.ready")), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_xlog/archive_status/000000010000000100000001.ready")), NULL);
|
||||
|
||||
// Create a ready file for WAL 2 but don't create the segment yet -- this will test the file error
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_xlog/archive_status/000000010000000100000002.ready")), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_xlog/archive_status/000000010000000100000002.ready")), NULL);
|
||||
|
||||
TEST_RESULT_VOID(cmdArchivePushAsync(), "push WAL segments");
|
||||
harnessLogResult(
|
||||
@ -595,7 +595,7 @@ testRun(void)
|
||||
strPtr(strNewFmt("%s/pg/pg_xlog/000000010000000100000002", testPath())))));
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(
|
||||
storageExistsP(
|
||||
storageTest,
|
||||
strNewFmt(
|
||||
"repo/archive/test/9.4-1/0000000100000001/000000010000000100000001-%s",
|
||||
@ -603,7 +603,7 @@ testRun(void)
|
||||
true, "check repo for WAL 1 file");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|")),
|
||||
strPtr(strLstJoin(strLstSort(storageListP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|")),
|
||||
"000000010000000100000001.ok|000000010000000100000002.error", "check status files");
|
||||
|
||||
// Create WAL 2 segment
|
||||
@ -612,7 +612,7 @@ testRun(void)
|
||||
memset(bufPtr(walBuffer2), 0x0C, bufSize(walBuffer2));
|
||||
pgWalTestToBuffer((PgWal){.version = PG_VERSION_94, .systemId = 0xAAAABBBBCCCCDDDD}, walBuffer2);
|
||||
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("pg_xlog/000000010000000100000002")), walBuffer2);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_xlog/000000010000000100000002")), walBuffer2);
|
||||
|
||||
argListTemp = strLstDup(argList);
|
||||
strLstAddZ(argListTemp, "--archive-push-queue-max=1gb");
|
||||
@ -624,7 +624,7 @@ testRun(void)
|
||||
"P01 DETAIL: pushed WAL file '000000010000000100000002' to the archive");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(
|
||||
storageExistsP(
|
||||
storageTest,
|
||||
strNewFmt(
|
||||
"repo/archive/test/9.4-1/0000000100000001/000000010000000100000002-%s",
|
||||
@ -632,14 +632,14 @@ testRun(void)
|
||||
true, "check repo for WAL 2 file");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|")),
|
||||
strPtr(strLstJoin(strLstSort(storageListP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|")),
|
||||
"000000010000000100000001.ok|000000010000000100000002.ok", "check status files");
|
||||
|
||||
// Check that drop functionality works
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
// Remove status files
|
||||
storagePathRemoveP(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT_STR, .recurse = true);
|
||||
storagePathCreateNP(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT_STR);
|
||||
storagePathCreateP(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT_STR);
|
||||
|
||||
argListTemp = strLstDup(argList);
|
||||
strLstAddZ(argListTemp, "--archive-push-queue-max=16m");
|
||||
@ -654,19 +654,19 @@ testRun(void)
|
||||
TEST_RESULT_STR(
|
||||
strPtr(
|
||||
strNewBuf(
|
||||
storageGetNP(
|
||||
storageNewReadNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000001.ok"))))),
|
||||
storageGetP(
|
||||
storageNewReadP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000001.ok"))))),
|
||||
"0\ndropped WAL file '000000010000000100000001' because archive queue exceeded 16MB", "check WAL 1 warning");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(
|
||||
strNewBuf(
|
||||
storageGetNP(
|
||||
storageNewReadNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000002.ok"))))),
|
||||
storageGetP(
|
||||
storageNewReadP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000002.ok"))))),
|
||||
"0\ndropped WAL file '000000010000000100000002' because archive queue exceeded 16MB", "check WAL 2 warning");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|")),
|
||||
strPtr(strLstJoin(strLstSort(storageListP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|")),
|
||||
"000000010000000100000001.ok|000000010000000100000002.ok", "check status files");
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ testRun(void)
|
||||
FileMissingError, "unable to open missing file '%s/pg/missing' for read", testPath());
|
||||
|
||||
// Create a pg file to backup
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), pgFile), BUFSTRDEF("atestfile"));
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), pgFile), BUFSTRDEF("atestfile"));
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
// No prior checksum, no compression, no pageChecksum, no delta, no hasReference
|
||||
@ -113,10 +113,10 @@ testRun(void)
|
||||
TEST_RESULT_UINT(result.backupCopyResult, backupCopyResultCopy, " copy file");
|
||||
TEST_RESULT_BOOL(
|
||||
(strEqZ(result.copyChecksum, "9bc8ab2dda60ef4beed07d1e19ce0676d5edde67") &&
|
||||
storageExistsNP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
storageExistsP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
true, " copy file to repo success");
|
||||
|
||||
TEST_RESULT_VOID(storageRemoveNP(storageRepoWrite(), backupPathFile), " remove repo file");
|
||||
TEST_RESULT_VOID(storageRemoveP(storageRepoWrite(), backupPathFile), " remove repo file");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
// Test pagechecksum
|
||||
@ -130,12 +130,12 @@ testRun(void)
|
||||
TEST_RESULT_UINT(result.backupCopyResult, backupCopyResultCopy, " copy file");
|
||||
TEST_RESULT_BOOL(
|
||||
(strEqZ(result.copyChecksum, "9bc8ab2dda60ef4beed07d1e19ce0676d5edde67") &&
|
||||
storageExistsNP(storageRepo(), backupPathFile)),
|
||||
storageExistsP(storageRepo(), backupPathFile)),
|
||||
true," copy file to repo success");
|
||||
TEST_RESULT_PTR_NE(result.pageChecksumResult, NULL, " pageChecksumResult is set");
|
||||
TEST_RESULT_BOOL(
|
||||
varBool(kvGet(result.pageChecksumResult, VARSTRDEF("valid"))), false, " pageChecksumResult valid=false");
|
||||
TEST_RESULT_VOID(storageRemoveNP(storageRepoWrite(), backupPathFile), " remove repo file");
|
||||
TEST_RESULT_VOID(storageRemoveP(storageRepoWrite(), backupPathFile), " remove repo file");
|
||||
|
||||
// Check protocol function directly
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -176,7 +176,7 @@ testRun(void)
|
||||
TEST_RESULT_UINT(result.backupCopyResult, backupCopyResultNoOp, " noop file");
|
||||
TEST_RESULT_BOOL(
|
||||
(strEqZ(result.copyChecksum, "9bc8ab2dda60ef4beed07d1e19ce0676d5edde67") &&
|
||||
storageExistsNP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
storageExistsP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
true, " noop");
|
||||
|
||||
// Check protocol function directly
|
||||
@ -216,7 +216,7 @@ testRun(void)
|
||||
TEST_RESULT_UINT(result.backupCopyResult, backupCopyResultCopy, " copy file");
|
||||
TEST_RESULT_BOOL(
|
||||
(strEqZ(result.copyChecksum, "9bc8ab2dda60ef4beed07d1e19ce0676d5edde67") &&
|
||||
storageExistsNP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
storageExistsP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
true, " copy");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -231,13 +231,13 @@ testRun(void)
|
||||
TEST_RESULT_UINT(result.backupCopyResult, backupCopyResultCopy, " copy file");
|
||||
TEST_RESULT_BOOL(
|
||||
(strEqZ(result.copyChecksum, "9bc8ab2dda60ef4beed07d1e19ce0676d5edde67") &&
|
||||
storageExistsNP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
storageExistsP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
true, " copy");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
// File exists in repo and db, checksum not same in repo, delta set, ignoreMissing false, no hasReference - RECOPY
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageRepoWrite(), backupPathFile), BUFSTRDEF("adifferentfile")),
|
||||
storagePutP(storageNewWriteP(storageRepoWrite(), backupPathFile), BUFSTRDEF("adifferentfile")),
|
||||
"create different file (size and checksum) with same name in repo");
|
||||
TEST_ASSIGN(
|
||||
result,
|
||||
@ -249,13 +249,13 @@ testRun(void)
|
||||
TEST_RESULT_UINT(result.backupCopyResult, backupCopyResultReCopy, " recopy file");
|
||||
TEST_RESULT_BOOL(
|
||||
(strEqZ(result.copyChecksum, "9bc8ab2dda60ef4beed07d1e19ce0676d5edde67") &&
|
||||
storageExistsNP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
storageExistsP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
true, " recopy");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
// File exists in repo but missing from db, checksum same in repo, delta set, ignoreMissing true, no hasReference - SKIP
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageRepoWrite(), backupPathFile), BUFSTRDEF("adifferentfile")),
|
||||
storagePutP(storageNewWriteP(storageRepoWrite(), backupPathFile), BUFSTRDEF("adifferentfile")),
|
||||
"create different file with same name in repo");
|
||||
TEST_ASSIGN(
|
||||
result,
|
||||
@ -266,7 +266,7 @@ testRun(void)
|
||||
TEST_RESULT_UINT(result.copySize + result.repoSize, 0, " copy=repo=0 size");
|
||||
TEST_RESULT_UINT(result.backupCopyResult, backupCopyResultSkip, " skip file");
|
||||
TEST_RESULT_BOOL(
|
||||
(result.copyChecksum == NULL && !storageExistsNP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
(result.copyChecksum == NULL && !storageExistsP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
true, " skip and remove file from repo");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -281,7 +281,7 @@ testRun(void)
|
||||
TEST_RESULT_UINT(result.backupCopyResult, backupCopyResultCopy, " copy file");
|
||||
TEST_RESULT_BOOL(
|
||||
(strEqZ(result.copyChecksum, "9bc8ab2dda60ef4beed07d1e19ce0676d5edde67") &&
|
||||
storageExistsNP(storageRepo(), strNewFmt(STORAGE_REPO_BACKUP "/%s/%s.gz", strPtr(backupLabel), strPtr(pgFile))) &&
|
||||
storageExistsP(storageRepo(), strNewFmt(STORAGE_REPO_BACKUP "/%s/%s.gz", strPtr(backupLabel), strPtr(pgFile))) &&
|
||||
result.pageChecksumResult == NULL),
|
||||
true, " copy file to repo compress success");
|
||||
|
||||
@ -299,7 +299,7 @@ testRun(void)
|
||||
TEST_RESULT_UINT(result.backupCopyResult, backupCopyResultChecksum, " checksum file");
|
||||
TEST_RESULT_BOOL(
|
||||
(strEqZ(result.copyChecksum, "9bc8ab2dda60ef4beed07d1e19ce0676d5edde67") &&
|
||||
storageExistsNP(storageRepo(), strNewFmt(STORAGE_REPO_BACKUP "/%s/%s.gz", strPtr(backupLabel), strPtr(pgFile))) &&
|
||||
storageExistsP(storageRepo(), strNewFmt(STORAGE_REPO_BACKUP "/%s/%s.gz", strPtr(backupLabel), strPtr(pgFile))) &&
|
||||
result.pageChecksumResult == NULL),
|
||||
true, " compressed repo file matches");
|
||||
|
||||
@ -330,7 +330,7 @@ testRun(void)
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
// Create a zero sized file - checksum will be set but in backupManifestUpdate it will not be copied
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("zerofile")), BUFSTRDEF(""));
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("zerofile")), BUFSTRDEF(""));
|
||||
|
||||
// No prior checksum, no compression, no pageChecksum, no delta, no hasReference
|
||||
TEST_ASSIGN(
|
||||
@ -343,7 +343,7 @@ testRun(void)
|
||||
TEST_RESULT_UINT(result.backupCopyResult, backupCopyResultCopy, " copy file");
|
||||
TEST_RESULT_PTR_NE(result.copyChecksum, NULL, " checksum set");
|
||||
TEST_RESULT_BOOL(
|
||||
(storageExistsNP(storageRepo(), strNewFmt(STORAGE_REPO_BACKUP "/%s/zerofile", strPtr(backupLabel))) &&
|
||||
(storageExistsP(storageRepo(), strNewFmt(STORAGE_REPO_BACKUP "/%s/zerofile", strPtr(backupLabel))) &&
|
||||
result.pageChecksumResult == NULL),
|
||||
true, " copy zero file to repo success");
|
||||
|
||||
@ -370,7 +370,7 @@ testRun(void)
|
||||
storagePathCreateP(storagePgWrite(), NULL, .mode = 0700);
|
||||
|
||||
// Create a pg file to backup
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), pgFile), BUFSTRDEF("atestfile"));
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), pgFile), BUFSTRDEF("atestfile"));
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
// No prior checksum, no compression, no pageChecksum, no delta, no hasReference
|
||||
@ -386,7 +386,7 @@ testRun(void)
|
||||
TEST_RESULT_UINT(result.backupCopyResult, backupCopyResultCopy, " copy file");
|
||||
TEST_RESULT_BOOL(
|
||||
(strEqZ(result.copyChecksum, "9bc8ab2dda60ef4beed07d1e19ce0676d5edde67") &&
|
||||
storageExistsNP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
storageExistsP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
true, " copy file to encrypted repo success");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -402,7 +402,7 @@ testRun(void)
|
||||
TEST_RESULT_UINT(result.backupCopyResult, backupCopyResultCopy, " copy file");
|
||||
TEST_RESULT_BOOL(
|
||||
(strEqZ(result.copyChecksum, "9bc8ab2dda60ef4beed07d1e19ce0676d5edde67") &&
|
||||
storageExistsNP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
storageExistsP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
true, " copy file (size missmatch) to encrypted repo success");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -419,7 +419,7 @@ testRun(void)
|
||||
TEST_RESULT_UINT(result.backupCopyResult, backupCopyResultReCopy, " recopy file");
|
||||
TEST_RESULT_BOOL(
|
||||
(strEqZ(result.copyChecksum, "9bc8ab2dda60ef4beed07d1e19ce0676d5edde67") &&
|
||||
storageExistsNP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
storageExistsP(storageRepo(), backupPathFile) && result.pageChecksumResult == NULL),
|
||||
true, " recopy file to encrypted repo success");
|
||||
|
||||
// Check protocol function directly
|
||||
|
@ -143,8 +143,8 @@ testRun(void)
|
||||
// Standby and primary database
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
// Create pg_control for standby
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(pg1))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(pg1))),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_92, .systemId = 6569239123849665679}));
|
||||
|
||||
argList = strLstNew();
|
||||
@ -203,13 +203,13 @@ testRun(void)
|
||||
// Standby - Stanza created
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
// Create pg_control for primary
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(pg8))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(pg8))),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_92, .systemId = 6569239123849665679}));
|
||||
|
||||
// Create info files
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageRepoWrite(), INFO_ARCHIVE_PATH_FILE_STR),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageRepoWrite(), INFO_ARCHIVE_PATH_FILE_STR),
|
||||
harnessInfoChecksum(
|
||||
strNew(
|
||||
"[db]\n"
|
||||
@ -220,8 +220,8 @@ testRun(void)
|
||||
"[db:history]\n"
|
||||
"1={\"db-id\":6569239123849665679,\"db-version\":\"9.2\"}\n")));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageRepoWrite(), INFO_BACKUP_PATH_FILE_STR),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageRepoWrite(), INFO_BACKUP_PATH_FILE_STR),
|
||||
harnessInfoChecksum(
|
||||
strNew(
|
||||
"[db]\n"
|
||||
@ -290,8 +290,8 @@ testRun(void)
|
||||
HRNPQ_MACRO_DONE()
|
||||
});
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageRepoWrite(),
|
||||
strNew(STORAGE_REPO_ARCHIVE "/9.2-1/000000010000000100000001-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")),
|
||||
buffer);
|
||||
@ -504,8 +504,8 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdStanzaCreate, argList);
|
||||
|
||||
// Create pg_control
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(stanza))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(stanza))),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_96, .systemId = 6569239123849665679}));
|
||||
|
||||
// Create info files
|
||||
|
@ -44,9 +44,9 @@ testRun(void)
|
||||
TEST_RESULT_VOID(cmdStart(), " cmdStart - no stanza, no stop files");
|
||||
harnessLogResult("P00 WARN: stop file does not exist");
|
||||
|
||||
TEST_RESULT_VOID(storagePutNP(storageNewWriteNP(storageData, strNew("lock/all" STOP_FILE_EXT)), NULL), "create stop file");
|
||||
TEST_RESULT_VOID(storagePutP(storageNewWriteP(storageData, strNew("lock/all" STOP_FILE_EXT)), NULL), "create stop file");
|
||||
TEST_RESULT_VOID(cmdStart(), " cmdStart - no stanza, stop file exists");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageData, strNew("lock/all" STOP_FILE_EXT)), false, " stop file removed");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageData, strNew("lock/all" STOP_FILE_EXT)), false, " stop file removed");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
argList = strLstNew();
|
||||
@ -57,15 +57,15 @@ testRun(void)
|
||||
TEST_RESULT_VOID(cmdStart(), " cmdStart - stanza, no stop files");
|
||||
harnessLogResult("P00 WARN: stop file does not exist for stanza db");
|
||||
|
||||
storagePutNP(storageNewWriteNP(storageData, strNew("lock/all" STOP_FILE_EXT)), NULL);
|
||||
storagePutP(storageNewWriteP(storageData, strNew("lock/all" STOP_FILE_EXT)), NULL);
|
||||
TEST_ERROR(lockStopTest(), StopError, "stop file exists for all stanzas");
|
||||
|
||||
storagePutNP(storageNewWriteNP(storageData, strNew("lock/db" STOP_FILE_EXT)), NULL);
|
||||
storagePutP(storageNewWriteP(storageData, strNew("lock/db" STOP_FILE_EXT)), NULL);
|
||||
TEST_ERROR(lockStopTest(), StopError, "stop file exists for stanza db");
|
||||
|
||||
TEST_RESULT_VOID(cmdStart(), "cmdStart - stanza, stop file exists");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageData, strNew("lock/db" STOP_FILE_EXT)), false, " stanza stop file removed");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageData, strNew("lock/all" STOP_FILE_EXT)), true, " all stop file not removed");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageData, strNew("lock/db" STOP_FILE_EXT)), false, " stanza stop file removed");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageData, strNew("lock/all" STOP_FILE_EXT)), true, " all stop file not removed");
|
||||
}
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
@ -77,12 +77,12 @@ testRun(void)
|
||||
|
||||
TEST_RESULT_VOID(cmdStop(), "no stanza, create stop file");
|
||||
StorageInfo info = {0};
|
||||
TEST_ASSIGN(info, storageInfoNP(storageData, lockPath), " get path info");
|
||||
TEST_ASSIGN(info, storageInfoP(storageData, lockPath), " get path info");
|
||||
TEST_RESULT_INT(info.mode, 0770, " check path mode");
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageData, strNewFmt("%s/all" STOP_FILE_EXT, strPtr(lockPath))), true, " all stop file created");
|
||||
storageExistsP(storageData, strNewFmt("%s/all" STOP_FILE_EXT, strPtr(lockPath))), true, " all stop file created");
|
||||
TEST_ASSIGN(
|
||||
info, storageInfoNP(storageData, strNewFmt("%s/all" STOP_FILE_EXT, strPtr(lockPath))), " get file info");
|
||||
info, storageInfoP(storageData, strNewFmt("%s/all" STOP_FILE_EXT, strPtr(lockPath))), " get file info");
|
||||
TEST_RESULT_INT(info.mode, 0640, " check file mode");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -90,7 +90,7 @@ testRun(void)
|
||||
harnessLogResult("P00 WARN: stop file already exists for all stanzas");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(storageRemoveNP(storageData, strNew("lockpath/all" STOP_FILE_EXT)), "remove stop file");
|
||||
TEST_RESULT_VOID(storageRemoveP(storageData, strNew("lockpath/all" STOP_FILE_EXT)), "remove stop file");
|
||||
TEST_RESULT_INT(system(strPtr(strNewFmt("chmod 444 %s", strPtr(lockPath)))), 0, "change perms");
|
||||
TEST_ERROR_FMT(
|
||||
cmdStop(), FileOpenError, "unable to stat '%s/all.stop': [13] Permission denied", strPtr(lockPath));
|
||||
@ -104,7 +104,7 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdStop, argList);
|
||||
|
||||
TEST_RESULT_VOID(cmdStop(), "stanza, create stop file");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageData, stanzaStopFile), true, " stanza stop file created");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageData, stanzaStopFile), true, " stanza stop file created");
|
||||
|
||||
StringList *lockPathList = NULL;
|
||||
TEST_ASSIGN(lockPathList, storageListP(storageData, strNew("lock"), .errorOnMissing = true), " get file list");
|
||||
@ -114,17 +114,17 @@ testRun(void)
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(cmdStop(), "stanza, stop file already exists");
|
||||
harnessLogResult("P00 WARN: stop file already exists for stanza db");
|
||||
TEST_RESULT_VOID(storageRemoveNP(storageData, stanzaStopFile), " remove stop file");
|
||||
TEST_RESULT_VOID(storageRemoveP(storageData, stanzaStopFile), " remove stop file");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
strLstAddZ(argList, "--force");
|
||||
harnessCfgLoad(cfgCmdStop, argList);
|
||||
TEST_RESULT_VOID(cmdStop(), "stanza, create stop file, force");
|
||||
TEST_RESULT_VOID(storageRemoveNP(storageData, stanzaStopFile), " remove stop file");
|
||||
TEST_RESULT_VOID(storageRemoveP(storageData, stanzaStopFile), " remove stop file");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(storageData, strNewFmt("%s/bad" LOCK_FILE_EXT, strPtr(lockPath)), .modeFile = 0222), NULL),
|
||||
"create a lock file that cannot be opened");
|
||||
TEST_RESULT_VOID(cmdStop(), " stanza, create stop file but unable to open lock file");
|
||||
@ -134,19 +134,19 @@ testRun(void)
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageData, strNewFmt("%s/empty" LOCK_FILE_EXT, strPtr(lockPath))), NULL),
|
||||
storagePutP(storageNewWriteP(storageData, strNewFmt("%s/empty" LOCK_FILE_EXT, strPtr(lockPath))), NULL),
|
||||
"create empty lock file");
|
||||
TEST_RESULT_VOID(cmdStop(), " stanza, create stop file, force - empty lock file");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageData, stanzaStopFile), true, " stanza stop file created");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageData, stanzaStopFile), true, " stanza stop file created");
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageData, strNewFmt("%s/empty" LOCK_FILE_EXT, strPtr(lockPath))), false,
|
||||
storageExistsP(storageData, strNewFmt("%s/empty" LOCK_FILE_EXT, strPtr(lockPath))), false,
|
||||
" no other process lock, lock file was removed");
|
||||
|
||||
// empty lock file with another process lock, processId == NULL
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(storageRemoveNP(storageData, stanzaStopFile), "remove stop file");
|
||||
TEST_RESULT_VOID(storageRemoveP(storageData, stanzaStopFile), "remove stop file");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageData, strNewFmt("%s/empty" LOCK_FILE_EXT, strPtr(lockPath))), NULL),
|
||||
storagePutP(storageNewWriteP(storageData, strNewFmt("%s/empty" LOCK_FILE_EXT, strPtr(lockPath))), NULL),
|
||||
" create empty lock file");
|
||||
|
||||
HARNESS_FORK_BEGIN()
|
||||
@ -188,7 +188,7 @@ testRun(void)
|
||||
cmdStop(),
|
||||
" stanza, create stop file, force - empty lock file with another process lock, processId == NULL");
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageData, strNewFmt("%s/empty" LOCK_FILE_EXT, strPtr(lockPath))), false,
|
||||
storageExistsP(storageData, strNewFmt("%s/empty" LOCK_FILE_EXT, strPtr(lockPath))), false,
|
||||
" lock file was removed");
|
||||
|
||||
// Notify the child to release the lock
|
||||
@ -201,9 +201,9 @@ testRun(void)
|
||||
|
||||
// not empty lock file with another process lock, processId size trimmed to 0
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(storageRemoveNP(storageData, stanzaStopFile), "remove stop file");
|
||||
TEST_RESULT_VOID(storageRemoveP(storageData, stanzaStopFile), "remove stop file");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageData, strNewFmt("%s/empty" LOCK_FILE_EXT, strPtr(lockPath))), BUFSTRDEF(" ")),
|
||||
storagePutP(storageNewWriteP(storageData, strNewFmt("%s/empty" LOCK_FILE_EXT, strPtr(lockPath))), BUFSTRDEF(" ")),
|
||||
" create non-empty lock file");
|
||||
|
||||
HARNESS_FORK_BEGIN()
|
||||
@ -244,7 +244,7 @@ testRun(void)
|
||||
TEST_RESULT_VOID(
|
||||
cmdStop(), " stanza, create stop file, force - empty lock file with another process lock, processId size 0");
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageData, strNewFmt("%s/empty" LOCK_FILE_EXT, strPtr(lockPath))), false,
|
||||
storageExistsP(storageData, strNewFmt("%s/empty" LOCK_FILE_EXT, strPtr(lockPath))), false,
|
||||
" lock file was removed");
|
||||
|
||||
// Notify the child to release the lock
|
||||
@ -257,7 +257,7 @@ testRun(void)
|
||||
|
||||
// lock file with another process lock, processId is valid
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(storageRemoveNP(storageData, stanzaStopFile), "remove stop file");
|
||||
TEST_RESULT_VOID(storageRemoveP(storageData, stanzaStopFile), "remove stop file");
|
||||
HARNESS_FORK_BEGIN()
|
||||
{
|
||||
HARNESS_FORK_CHILD_BEGIN(0, true)
|
||||
@ -301,10 +301,10 @@ testRun(void)
|
||||
|
||||
// lock file with another process lock, processId is invalid
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(storageRemoveNP(storageData, stanzaStopFile), "remove stop file");
|
||||
TEST_RESULT_VOID(storageRemoveP(storageData, stanzaStopFile), "remove stop file");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageData, strNewFmt("%s/badpid" LOCK_FILE_EXT, strPtr(lockPath))), BUFSTRDEF("-32768")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageData, strNewFmt("%s/badpid" LOCK_FILE_EXT, strPtr(lockPath))), BUFSTRDEF("-32768")),
|
||||
"create lock file with invalid PID");
|
||||
|
||||
HARNESS_FORK_BEGIN()
|
||||
@ -328,7 +328,7 @@ testRun(void)
|
||||
ioReadLine(read);
|
||||
|
||||
// Remove the file and close the handle
|
||||
storageRemoveNP(storageData, strNewFmt("%s/badpid" LOCK_FILE_EXT, strPtr(lockPath)));
|
||||
storageRemoveP(storageData, strNewFmt("%s/badpid" LOCK_FILE_EXT, strPtr(lockPath)));
|
||||
close(lockHandle);
|
||||
}
|
||||
HARNESS_FORK_CHILD_END();
|
||||
@ -346,7 +346,7 @@ testRun(void)
|
||||
TEST_RESULT_VOID(
|
||||
cmdStop(), " stanza, create stop file, force - lock file with another process lock, processId is invalid");
|
||||
harnessLogResult("P00 WARN: unable to send term signal to process -32768");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageData, stanzaStopFile), true, " stanza stop file not removed");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageData, stanzaStopFile), true, " stanza stop file not removed");
|
||||
|
||||
// Notify the child to release the lock
|
||||
ioWriteLine(write, bufNew(0));
|
||||
|
@ -27,8 +27,8 @@ archiveGenerate(
|
||||
else
|
||||
wal = strNewFmt("%s000000%u-9baedd24b61aa15305732ac678c4e2c102435a09", majorWal, i);
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/%s/%s/%s", strPtr(archiveStanzaPath), archiveId, majorWal, strPtr(wal))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/%s/%s/%s", strPtr(archiveStanzaPath), archiveId, majorWal, strPtr(wal))),
|
||||
BUFSTRDEF(BOGUS_STR));
|
||||
}
|
||||
}
|
||||
@ -150,7 +150,7 @@ testRun(void)
|
||||
if (testBegin("expireBackup()"))
|
||||
{
|
||||
// Create backup.info
|
||||
storagePutNP(storageNewWriteNP(storageTest, backupInfoFileName), harnessInfoChecksum(backupInfoBase));
|
||||
storagePutP(storageNewWriteP(storageTest, backupInfoFileName), harnessInfoChecksum(backupInfoBase));
|
||||
|
||||
InfoBackup *infoBackup = NULL;
|
||||
TEST_ASSIGN(infoBackup, infoBackupLoadFile(storageTest, backupInfoFileName, cipherTypeNone, NULL), "get backup.info");
|
||||
@ -166,24 +166,24 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdExpire, argList);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/%s", strPtr(full1Path), BACKUP_MANIFEST_FILE)), BUFSTRDEF(BOGUS_STR)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/%s", strPtr(full1Path), BACKUP_MANIFEST_FILE)), BUFSTRDEF(BOGUS_STR)),
|
||||
"full1 put manifest");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageTest, strNewFmt("%s/%s", strPtr(full1Path), BACKUP_MANIFEST_FILE ".copy")), BUFSTRDEF(BOGUS_STR)),
|
||||
"full1 put manifest copy");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageTest, strNewFmt("%s/%s", strPtr(full1Path), "bogus")),
|
||||
storagePutP(storageNewWriteP(storageTest, strNewFmt("%s/%s", strPtr(full1Path), "bogus")),
|
||||
BUFSTRDEF(BOGUS_STR)), "full1 put extra file");
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageTest, full2Path), "full2 empty");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageTest, full2Path), "full2 empty");
|
||||
|
||||
String *backupExpired = strNew("");
|
||||
|
||||
TEST_RESULT_VOID(expireBackup(infoBackup, full1, backupExpired), "expire backup with both manifest files");
|
||||
TEST_RESULT_BOOL(
|
||||
(strLstSize(storageListNP(storageTest, full1Path)) && strLstExistsZ(storageListNP(storageTest, full1Path), "bogus")),
|
||||
(strLstSize(storageListP(storageTest, full1Path)) && strLstExistsZ(storageListP(storageTest, full1Path), "bogus")),
|
||||
true, " full1 - only manifest files removed");
|
||||
|
||||
TEST_RESULT_VOID(expireBackup(infoBackup, full2, backupExpired), "expire backup with no manifest - does not error");
|
||||
@ -199,7 +199,7 @@ testRun(void)
|
||||
if (testBegin("expireFullBackup()"))
|
||||
{
|
||||
// Create backup.info
|
||||
storagePutNP(storageNewWriteNP(storageTest, backupInfoFileName), harnessInfoChecksum(backupInfoBase));
|
||||
storagePutP(storageNewWriteP(storageTest, backupInfoFileName), harnessInfoChecksum(backupInfoBase));
|
||||
|
||||
InfoBackup *infoBackup = NULL;
|
||||
TEST_ASSIGN(infoBackup, infoBackupLoadFile(storageTest, backupInfoFileName, cipherTypeNone, NULL), "get backup.info");
|
||||
@ -251,7 +251,7 @@ testRun(void)
|
||||
if (testBegin("expireDiffBackup()"))
|
||||
{
|
||||
// Create backup.info
|
||||
storagePutNP(storageNewWriteNP(storageTest, backupInfoFileName), harnessInfoChecksum(backupInfoBase));
|
||||
storagePutP(storageNewWriteP(storageTest, backupInfoFileName), harnessInfoChecksum(backupInfoBase));
|
||||
|
||||
InfoBackup *infoBackup = NULL;
|
||||
TEST_ASSIGN(infoBackup, infoBackupLoadFile(storageTest, backupInfoFileName, cipherTypeNone, NULL), "get backup.info");
|
||||
@ -290,8 +290,8 @@ testRun(void)
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
// Create backup.info with two diff - oldest to be expired - no "set:"
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, backupInfoFileName),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, backupInfoFileName),
|
||||
harnessInfoChecksumZ(
|
||||
"[backup:current]\n"
|
||||
"20181119-152800F={"
|
||||
@ -350,8 +350,8 @@ testRun(void)
|
||||
if (testBegin("removeExpiredBackup()"))
|
||||
{
|
||||
// Create backup.info
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, backupInfoFileName),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, backupInfoFileName),
|
||||
harnessInfoChecksumZ(
|
||||
"[backup:current]\n"
|
||||
"20181119-152138F={"
|
||||
@ -385,15 +385,15 @@ testRun(void)
|
||||
String *full1 = strNewFmt("%s/%s", strPtr(backupStanzaPath), "20181119-152138F");
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageTest, strNewFmt("%s/%s", strPtr(full), "bogus")),
|
||||
storagePutP(storageNewWriteP(storageTest, strNewFmt("%s/%s", strPtr(full), "bogus")),
|
||||
BUFSTRDEF(BOGUS_STR)), "put file");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageTest, strNewFmt("%s/%s", strPtr(full1), "somefile")),
|
||||
storagePutP(storageNewWriteP(storageTest, strNewFmt("%s/%s", strPtr(full1), "somefile")),
|
||||
BUFSTRDEF(BOGUS_STR)), "put file");
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageTest, diff), "empty backup directory must not error on delete");
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageTest, otherPath), "other path must not be removed");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageTest, diff), "empty backup directory must not error on delete");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageTest, otherPath), "other path must not be removed");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageTest, otherFile),
|
||||
storagePutP(storageNewWriteP(storageTest, otherFile),
|
||||
BUFSTRDEF(BOGUS_STR)), "directory look-alike file must not be removed");
|
||||
|
||||
// Load Parameters
|
||||
@ -408,13 +408,13 @@ testRun(void)
|
||||
"P00 INFO: remove expired backup 20181119-152100F");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(storageTest, backupStanzaPath), sortOrderAsc), ", ")),
|
||||
strPtr(strLstJoin(strLstSort(storageListP(storageTest, backupStanzaPath), sortOrderAsc), ", ")),
|
||||
"20181118-152100F_20181119-152152D.save, 20181119-152138F, backup.info, bogus", " remaining file/directories correct");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
// Create backup.info without current backups
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, backupInfoFileName),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, backupInfoFileName),
|
||||
harnessInfoChecksumZ(
|
||||
"[db]\n"
|
||||
"db-catalog-version=201409291\n"
|
||||
@ -433,7 +433,7 @@ testRun(void)
|
||||
|
||||
harnessLogResult("P00 INFO: remove expired backup 20181119-152138F");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(storageTest, backupStanzaPath), sortOrderAsc), ", ")),
|
||||
strPtr(strLstJoin(strLstSort(storageListP(storageTest, backupStanzaPath), sortOrderAsc), ", ")),
|
||||
"20181118-152100F_20181119-152152D.save, backup.info, bogus", " remaining file/directories correct");
|
||||
}
|
||||
|
||||
@ -445,8 +445,8 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdExpire, argList);
|
||||
|
||||
// Create backup.info without current backups
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, backupInfoFileName),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, backupInfoFileName),
|
||||
harnessInfoChecksumZ(
|
||||
"[db]\n"
|
||||
"db-catalog-version=201409291\n"
|
||||
@ -482,7 +482,7 @@ testRun(void)
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
// Create backup.info with current backups spread over different timelines
|
||||
storagePutNP(storageNewWriteNP(storageTest, backupInfoFileName),
|
||||
storagePutP(storageNewWriteP(storageTest, backupInfoFileName),
|
||||
harnessInfoChecksumZ(
|
||||
"[backup:current]\n"
|
||||
"20181119-152138F={"
|
||||
@ -558,8 +558,8 @@ testRun(void)
|
||||
|
||||
TEST_ASSIGN(infoBackup, infoBackupLoadFile(storageTest, backupInfoFileName, cipherTypeNone, NULL), "get backup.info");
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, archiveInfoFileName),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, archiveInfoFileName),
|
||||
harnessInfoChecksumZ(
|
||||
"[db]\n"
|
||||
"db-id=2\n"
|
||||
@ -580,17 +580,17 @@ testRun(void)
|
||||
TEST_RESULT_VOID(removeExpiredArchive(infoBackup), "archive retention type = full (default), repo1-retention-archive=4");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "9.4-1", "0000000100000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(2, 10, "0000000100000000")),
|
||||
" only 9.4-1/0000000100000000/000000010000000000000001 removed");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "9.4-1", "0000000200000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(1, 10, "0000000200000000")),
|
||||
" none removed from 9.4-1/0000000200000000 - crossing timelines to play through PITR");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "10-2", "0000000100000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(3, 10, "0000000100000000")),
|
||||
" 000000010000000000000001 and 000000010000000000000002 removed from 10-2/0000000100000000");
|
||||
@ -606,17 +606,17 @@ testRun(void)
|
||||
TEST_RESULT_VOID(removeExpiredArchive(infoBackup), "archive retention type = full (default), repo1-retention-archive=2");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "9.4-1", "0000000100000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(2, 2, "0000000100000000")),
|
||||
" only 9.4-1/0000000100000000/000000010000000000000002 remains in major wal 1");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "9.4-1", "0000000200000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(2, 10, "0000000200000000")),
|
||||
" only 9.4-1/0000000200000000/000000010000000000000001 removed from major wal 2");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "10-2", "0000000100000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(3, 10, "0000000100000000")),
|
||||
" none removed from 10-2/0000000100000000");
|
||||
@ -629,17 +629,17 @@ testRun(void)
|
||||
TEST_RESULT_VOID(removeExpiredArchive(infoBackup), "archive retention type = full (default), repo1-retention-archive=1");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "9.4-1", "0000000100000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(2, 2, "0000000100000000")),
|
||||
" only 9.4-1/0000000100000000/000000010000000000000002 remains in major wal 1");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "9.4-1", "0000000200000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(2, 10, "0000000200000000")),
|
||||
" nothing removed from 9.4-1/0000000200000000 major wal 2 - each archiveId must have one backup to play through PITR");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "10-2", "0000000100000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(3, 10, "0000000100000000")),
|
||||
" none removed from 10-2/0000000100000000");
|
||||
@ -665,17 +665,17 @@ testRun(void)
|
||||
strPtr(archiveExpectList(9, 10, "0000000200000000")));
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "9.4-1", "0000000100000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(2, 2, "0000000100000000")),
|
||||
" only 9.4-1/0000000100000000/000000010000000000000002 remains in major wal 1");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "9.4-1", "0000000200000000")), sortOrderAsc), ", ")),
|
||||
strPtr(result),
|
||||
" all in-between removed from 9.4-1/0000000200000000 major wal 2 - last backup able to play through PITR");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "10-2", "0000000100000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(3, 10, "0000000100000000")),
|
||||
" none removed from 10-2/0000000100000000");
|
||||
@ -700,17 +700,17 @@ testRun(void)
|
||||
strPtr(archiveExpectList(7, 10, "0000000200000000")));
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "9.4-1", "0000000100000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(2, 2, "0000000100000000")),
|
||||
" only 9.4-1/0000000100000000/000000010000000000000002 remains in major wal 1");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "9.4-1", "0000000200000000")), sortOrderAsc), ", ")),
|
||||
strPtr(result),
|
||||
" incremental and after remain in 9.4-1/0000000200000000 major wal 2");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "10-2", "0000000100000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(3, 10, "0000000100000000")),
|
||||
" none removed from 10-2/0000000100000000");
|
||||
@ -724,31 +724,31 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdExpire, argList);
|
||||
|
||||
// Write backup.manifest so infoBackup reconstruct produces same results as backup.info on disk
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/20181119-152138F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/20181119-152138F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
BUFSTRDEF("tmp"));
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/20181119-152800F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/20181119-152800F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
BUFSTRDEF("tmp"));
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/20181119-152800F_20181119-152152D/" BACKUP_MANIFEST_FILE,
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/20181119-152800F_20181119-152152D/" BACKUP_MANIFEST_FILE,
|
||||
strPtr(backupStanzaPath))), BUFSTRDEF("tmp"));
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/20181119-152800F_20181119-152155I/" BACKUP_MANIFEST_FILE,
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/20181119-152800F_20181119-152155I/" BACKUP_MANIFEST_FILE,
|
||||
strPtr(backupStanzaPath))), BUFSTRDEF("tmp"));
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/20181119-152800F_20181119-152252D/" BACKUP_MANIFEST_FILE,
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/20181119-152800F_20181119-152252D/" BACKUP_MANIFEST_FILE,
|
||||
strPtr(backupStanzaPath))), BUFSTRDEF("tmp"));
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/20181119-152900F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/20181119-152900F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
BUFSTRDEF("tmp"));
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/20181119-152900F_20181119-152500I/" BACKUP_MANIFEST_FILE,
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/20181119-152900F_20181119-152500I/" BACKUP_MANIFEST_FILE,
|
||||
strPtr(backupStanzaPath))), BUFSTRDEF("tmp"));
|
||||
|
||||
TEST_RESULT_VOID(cmdExpire(), "expire last backup in archive sub path and remove sub path");
|
||||
TEST_RESULT_BOOL(
|
||||
storagePathExistsNP(storageTest, strNewFmt("%s/%s", strPtr(archiveStanzaPath), "9.4-1/0000000100000000")),
|
||||
storagePathExistsP(storageTest, strNewFmt("%s/%s", strPtr(archiveStanzaPath), "9.4-1/0000000100000000")),
|
||||
false, " archive sub path removed");
|
||||
harnessLogResult(
|
||||
"P00 INFO: expire full backup 20181119-152138F\n"
|
||||
@ -761,7 +761,7 @@ testRun(void)
|
||||
|
||||
TEST_RESULT_VOID(cmdExpire(), "expire last backup in archive path and remove path");
|
||||
TEST_RESULT_BOOL(
|
||||
storagePathExistsNP(storageTest, strNewFmt("%s/%s", strPtr(archiveStanzaPath), "9.4-1")),
|
||||
storagePathExistsP(storageTest, strNewFmt("%s/%s", strPtr(archiveStanzaPath), "9.4-1")),
|
||||
false, " archive path removed");
|
||||
|
||||
harnessLogResult(strPtr(strNewFmt(
|
||||
@ -780,7 +780,7 @@ testRun(void)
|
||||
"20181119-152900F, 20181119-152900F_20181119-152500I", " remaining current backups correct");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(storageNewWriteNP(storageTest, backupInfoFileName),
|
||||
storagePutP(storageNewWriteP(storageTest, backupInfoFileName),
|
||||
harnessInfoChecksumZ(
|
||||
"[backup:current]\n"
|
||||
"20181119-152138F={"
|
||||
@ -832,7 +832,7 @@ testRun(void)
|
||||
TEST_RESULT_VOID(
|
||||
removeExpiredArchive(infoBackup), "backup selected for retention does not have archive-start so do nothing");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "9.4-1", "0000000100000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(1, 5, "0000000100000000")),
|
||||
" nothing removed from 9.4-1/0000000100000000");
|
||||
@ -845,7 +845,7 @@ testRun(void)
|
||||
TEST_RESULT_VOID(
|
||||
removeExpiredArchive(infoBackup), "full count as incr but not enough backups, retention set to first full");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "9.4-1", "0000000100000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(2, 5, "0000000100000000")),
|
||||
" only removed archive prior to first full");
|
||||
@ -878,7 +878,7 @@ testRun(void)
|
||||
|
||||
// archive.info has only current db with different db history id as backup.info
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(storageNewWriteNP(storageTest, backupInfoFileName),
|
||||
storagePutP(storageNewWriteP(storageTest, backupInfoFileName),
|
||||
harnessInfoChecksumZ(
|
||||
"[backup:current]\n"
|
||||
"20181119-152138F={"
|
||||
@ -921,18 +921,18 @@ testRun(void)
|
||||
|
||||
// Write backup.manifest so infoBackup reconstruct produces same results as backup.info on disk and removeExpiredBackup
|
||||
// will find backup directories to remove
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/20181119-152138F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/20181119-152138F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
BUFSTRDEF("tmp"));
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/20181119-152800F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/20181119-152800F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
BUFSTRDEF("tmp"));
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/20181119-152900F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/20181119-152900F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
BUFSTRDEF("tmp"));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, archiveInfoFileName),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, archiveInfoFileName),
|
||||
harnessInfoChecksumZ(
|
||||
"[db]\n"
|
||||
"db-id=1\n"
|
||||
@ -952,20 +952,20 @@ testRun(void)
|
||||
"P00 INFO: expire full backup 20181119-152138F\n"
|
||||
"P00 INFO: remove expired backup 20181119-152138F");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "10-1", "0000000100000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(1, 7, "0000000100000000")),
|
||||
" none removed from 10-1/0000000100000000");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "10-2", "0000000100000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(1, 7, "0000000100000000")),
|
||||
" none removed from 10-2/0000000100000000");
|
||||
|
||||
// archive.info old history db system id not the same as backup.info
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, archiveInfoFileName),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, archiveInfoFileName),
|
||||
harnessInfoChecksumZ(
|
||||
"[db]\n"
|
||||
"db-id=2\n"
|
||||
@ -980,8 +980,8 @@ testRun(void)
|
||||
|
||||
// archive.info old history db version not the same as backup.info
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, archiveInfoFileName),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, archiveInfoFileName),
|
||||
harnessInfoChecksumZ(
|
||||
"[db]\n"
|
||||
"db-id=2\n"
|
||||
@ -996,7 +996,7 @@ testRun(void)
|
||||
|
||||
// archive.info has only current db with same db history id as backup.info
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(storageNewWriteNP(storageTest, backupInfoFileName),
|
||||
storagePutP(storageNewWriteP(storageTest, backupInfoFileName),
|
||||
harnessInfoChecksumZ(
|
||||
"[backup:current]\n"
|
||||
"20181119-152138F={"
|
||||
@ -1039,18 +1039,18 @@ testRun(void)
|
||||
|
||||
// Write backup.manifest so infoBackup reconstruct produces same results as backup.info on disk and removeExpiredBackup
|
||||
// will find backup directories to remove
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/20181119-152138F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/20181119-152138F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
BUFSTRDEF("tmp"));
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/20181119-152800F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/20181119-152800F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
BUFSTRDEF("tmp"));
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/20181119-152900F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/20181119-152900F/" BACKUP_MANIFEST_FILE, strPtr(backupStanzaPath))),
|
||||
BUFSTRDEF("tmp"));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, archiveInfoFileName),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, archiveInfoFileName),
|
||||
harnessInfoChecksumZ(
|
||||
"[db]\n"
|
||||
"db-id=2\n"
|
||||
@ -1075,12 +1075,12 @@ testRun(void)
|
||||
"P00 INFO: remove expired backup 20181119-152800F\n"
|
||||
"P00 INFO: remove expired backup 20181119-152138F");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "10-1", "0000000100000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(1, 7, "0000000100000000")),
|
||||
" none removed from 10-1/0000000100000000");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(
|
||||
storageTest, strNewFmt("%s/%s/%s", strPtr(archiveStanzaPath), "10-2", "0000000100000000")), sortOrderAsc), ", ")),
|
||||
strPtr(archiveExpectList(6, 7, "0000000100000000")),
|
||||
" all prior to 000000010000000000000006 removed from 10-2/0000000100000000");
|
||||
|
@ -416,7 +416,7 @@ testRun(void)
|
||||
|
||||
Storage *storage = storagePosixNew(
|
||||
strNew(testPath()), STORAGE_MODE_FILE_DEFAULT, STORAGE_MODE_PATH_DEFAULT, false, NULL);
|
||||
TEST_RESULT_STR(strPtr(strNewBuf(storageGetNP(storageNewReadNP(storage, stdoutFile)))), generalHelp, " check text");
|
||||
TEST_RESULT_STR(strPtr(strNewBuf(storageGetP(storageNewReadP(storage, stdoutFile)))), generalHelp, " check text");
|
||||
}
|
||||
|
||||
FUNCTION_HARNESS_RESULT_VOID();
|
||||
|
@ -41,13 +41,13 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdInfo, argListText);
|
||||
TEST_RESULT_STR(strPtr(infoRender()), "No stanzas exist in the repository.\n", "text - no stanzas");
|
||||
|
||||
storagePathCreateNP(storageLocalWrite(), archivePath);
|
||||
storagePathCreateNP(storageLocalWrite(), backupPath);
|
||||
storagePathCreateP(storageLocalWrite(), archivePath);
|
||||
storagePathCreateP(storageLocalWrite(), backupPath);
|
||||
|
||||
// Empty stanza
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageLocalWrite(), backupStanza1Path), "backup stanza1 directory");
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageLocalWrite(), archiveStanza1Path), "archive stanza1 directory");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageLocalWrite(), backupStanza1Path), "backup stanza1 directory");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageLocalWrite(), archiveStanza1Path), "archive stanza1 directory");
|
||||
TEST_RESULT_STR(strPtr(infoRender()),
|
||||
"stanza: stanza1\n"
|
||||
" status: error (missing stanza data)\n"
|
||||
@ -91,7 +91,7 @@ testRun(void)
|
||||
);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageLocalWrite(), strNewFmt("%s/backup.info", strPtr(backupStanza1Path))),
|
||||
storagePutP(storageNewWriteP(storageLocalWrite(), strNewFmt("%s/backup.info", strPtr(backupStanza1Path))),
|
||||
harnessInfoChecksum(content)), "put backup info to file");
|
||||
|
||||
TEST_ERROR_FMT(infoRender(), FileMissingError,
|
||||
@ -123,7 +123,7 @@ testRun(void)
|
||||
);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageLocalWrite(), strNewFmt("%s/archive.info", strPtr(archiveStanza1Path))),
|
||||
storagePutP(storageNewWriteP(storageLocalWrite(), strNewFmt("%s/archive.info", strPtr(archiveStanza1Path))),
|
||||
harnessInfoChecksum(content)), "put archive info to file");
|
||||
|
||||
// archive section will cross reference backup db-id 2 to archive db-id 3 but db section will only use the db-ids from
|
||||
@ -176,11 +176,11 @@ testRun(void)
|
||||
// Add WAL segments
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
String *archiveDb3 = strNewFmt("%s/9.4-3/0000000100000000", strPtr(archiveStanza1Path));
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageLocalWrite(), archiveDb3), "create db3 archive WAL1 directory");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageLocalWrite(), archiveDb3), "create db3 archive WAL1 directory");
|
||||
|
||||
String *archiveDb3Wal = strNewFmt(
|
||||
"%s/000000010000000000000004-47dff2b7552a9d66e4bae1a762488a6885e7082c.gz", strPtr(archiveDb3));
|
||||
TEST_RESULT_VOID(storagePutNP(storageNewWriteNP(storageLocalWrite(), archiveDb3Wal), bufNew(0)), "touch WAL3 file");
|
||||
TEST_RESULT_VOID(storagePutP(storageNewWriteP(storageLocalWrite(), archiveDb3Wal), bufNew(0)), "touch WAL3 file");
|
||||
|
||||
StringList *argList2 = strLstDup(argListText);
|
||||
strLstAddZ(argList2, "--stanza=stanza1");
|
||||
@ -200,7 +200,7 @@ testRun(void)
|
||||
// Coverage for stanzaStatus branches
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
String *archiveDb1_1 = strNewFmt("%s/9.4-1/0000000100000000", strPtr(archiveStanza1Path));
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageLocalWrite(), archiveDb1_1), "create db1 archive WAL1 directory");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageLocalWrite(), archiveDb1_1), "create db1 archive WAL1 directory");
|
||||
TEST_RESULT_INT(system(
|
||||
strPtr(strNewFmt("touch %s", strPtr(strNewFmt("%s/000000010000000000000002-ac61b8f1ec7b1e6c3eaee9345214595eb7daa9a1.gz",
|
||||
strPtr(archiveDb1_1)))))), 0, "touch WAL1 file");
|
||||
@ -209,13 +209,13 @@ testRun(void)
|
||||
strPtr(archiveDb1_1)))))), 0, "touch WAL1 file");
|
||||
|
||||
String *archiveDb1_2 = strNewFmt("%s/9.4-1/0000000200000000", strPtr(archiveStanza1Path));
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageLocalWrite(), archiveDb1_2), "create db1 archive WAL2 directory");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageLocalWrite(), archiveDb1_2), "create db1 archive WAL2 directory");
|
||||
TEST_RESULT_INT(system(
|
||||
strPtr(strNewFmt("touch %s", strPtr(strNewFmt("%s/000000020000000000000003-37dff2b7552a9d66e4bae1a762488a6885e7082c.gz",
|
||||
strPtr(archiveDb1_2)))))), 0, "touch WAL2 file");
|
||||
|
||||
String *archiveDb1_3 = strNewFmt("%s/9.4-1/0000000300000000", strPtr(archiveStanza1Path));
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageLocalWrite(), archiveDb1_3), "create db1 archive WAL3 directory");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageLocalWrite(), archiveDb1_3), "create db1 archive WAL3 directory");
|
||||
|
||||
harnessCfgLoad(cfgCmdInfo, argList);
|
||||
content = strNew
|
||||
@ -246,7 +246,7 @@ testRun(void)
|
||||
);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageLocalWrite(), strNewFmt("%s/backup.info", strPtr(backupStanza1Path))),
|
||||
storagePutP(storageNewWriteP(storageLocalWrite(), strNewFmt("%s/backup.info", strPtr(backupStanza1Path))),
|
||||
harnessInfoChecksum(content)), "put backup info to file");
|
||||
|
||||
TEST_RESULT_STR(strPtr(infoRender()),
|
||||
@ -361,7 +361,7 @@ testRun(void)
|
||||
);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageLocalWrite(), strNewFmt("%s/archive.info", strPtr(archiveStanza1Path))),
|
||||
storagePutP(storageNewWriteP(storageLocalWrite(), strNewFmt("%s/archive.info", strPtr(archiveStanza1Path))),
|
||||
harnessInfoChecksum(content)), "put archive info to file - stanza1");
|
||||
|
||||
content = strNew
|
||||
@ -408,7 +408,7 @@ testRun(void)
|
||||
);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageLocalWrite(), strNewFmt("%s/backup.info", strPtr(backupStanza1Path))),
|
||||
storagePutP(storageNewWriteP(storageLocalWrite(), strNewFmt("%s/backup.info", strPtr(backupStanza1Path))),
|
||||
harnessInfoChecksum(content)), "put backup info to file - stanza1");
|
||||
|
||||
// Manifest with all features
|
||||
@ -531,14 +531,14 @@ testRun(void)
|
||||
);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageLocalWrite(),
|
||||
storagePutP(storageNewWriteP(storageLocalWrite(),
|
||||
strNewFmt("%s/20181119-152138F_20181119-152152I/" BACKUP_MANIFEST_FILE, strPtr(backupStanza1Path))), contentLoad),
|
||||
"write manifest - stanza1");
|
||||
|
||||
String *archiveStanza2Path = strNewFmt("%s/stanza2", strPtr(archivePath));
|
||||
String *backupStanza2Path = strNewFmt("%s/stanza2", strPtr(backupPath));
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageLocalWrite(), backupStanza1Path), "backup stanza2 directory");
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageLocalWrite(), archiveStanza1Path), "archive stanza2 directory");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageLocalWrite(), backupStanza1Path), "backup stanza2 directory");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageLocalWrite(), archiveStanza1Path), "archive stanza2 directory");
|
||||
|
||||
content = strNew
|
||||
(
|
||||
@ -552,7 +552,7 @@ testRun(void)
|
||||
);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageLocalWrite(), strNewFmt("%s/archive.info", strPtr(archiveStanza2Path))),
|
||||
storagePutP(storageNewWriteP(storageLocalWrite(), strNewFmt("%s/archive.info", strPtr(archiveStanza2Path))),
|
||||
harnessInfoChecksum(content)), "put archive info to file - stanza2");
|
||||
|
||||
content = strNew
|
||||
@ -570,7 +570,7 @@ testRun(void)
|
||||
);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageLocalWrite(), strNewFmt("%s/backup.info", strPtr(backupStanza2Path))),
|
||||
storagePutP(storageNewWriteP(storageLocalWrite(), strNewFmt("%s/backup.info", strPtr(backupStanza2Path))),
|
||||
harnessInfoChecksum(content)), "put backup info to file - stanza2");
|
||||
|
||||
harnessCfgLoad(cfgCmdInfo, argList);
|
||||
@ -838,8 +838,8 @@ testRun(void)
|
||||
);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageRepoWrite(), strNew(STORAGE_REPO_BACKUP "/20181119-152138F_20181119-152152I/" BACKUP_MANIFEST_FILE)),
|
||||
contentLoad),
|
||||
"write manifest");
|
||||
@ -889,8 +889,8 @@ testRun(void)
|
||||
);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageRepoWrite(), strNew(STORAGE_REPO_BACKUP "/20181119-152138F_20181119-152152I/" BACKUP_MANIFEST_FILE)),
|
||||
contentLoad),
|
||||
"write manifest");
|
||||
@ -992,7 +992,7 @@ testRun(void)
|
||||
);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageLocalWrite(), strNewFmt("%s/pgbackrest.conf", testPath())),
|
||||
storagePutP(storageNewWriteP(storageLocalWrite(), strNewFmt("%s/pgbackrest.conf", testPath())),
|
||||
BUFSTR(content)), "put pgbackrest.conf file");
|
||||
strLstAddZ(argListText, "--repo-cipher-type=aes-256-cbc");
|
||||
strLstAdd(argListText, strNewFmt("--config=%s/pgbackrest.conf", testPath()));
|
||||
@ -1070,8 +1070,8 @@ testRun(void)
|
||||
strLstAdd(argList, strNewFmt("--repo-path=%s", strPtr(repoPath)));
|
||||
harnessCfgLoad(cfgCmdInfo, argList);
|
||||
|
||||
storagePathCreateNP(storageLocalWrite(), archivePath);
|
||||
storagePathCreateNP(storageLocalWrite(), backupPath);
|
||||
storagePathCreateP(storageLocalWrite(), archivePath);
|
||||
storagePathCreateP(storageLocalWrite(), backupPath);
|
||||
|
||||
// Redirect stdout to a file
|
||||
int stdoutSave = dup(STDOUT_FILENO);
|
||||
@ -1088,7 +1088,7 @@ testRun(void)
|
||||
Storage *storage = storagePosixNew(
|
||||
strNew(testPath()), STORAGE_MODE_FILE_DEFAULT, STORAGE_MODE_PATH_DEFAULT, false, NULL);
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storage, stdoutFile)))), "No stanzas exist in the repository.\n",
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(storage, stdoutFile)))), "No stanzas exist in the repository.\n",
|
||||
" check text");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -152,7 +152,7 @@ testRun(void)
|
||||
protocolClientNoOp(client);
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(
|
||||
storageExistsP(
|
||||
storagePosixNew(strNew(testDataPath()), STORAGE_MODE_FILE_DEFAULT, STORAGE_MODE_PATH_DEFAULT, false, NULL),
|
||||
STRDEF("lock/test-archive" LOCK_FILE_EXT)),
|
||||
true, "lock exists");
|
||||
|
@ -177,24 +177,24 @@ testRun(void)
|
||||
repoFile1, repoFileReferenceFull, false, strNew("sparse-zero"), strNew("9bc8ab2dda60ef4beed07d1e19ce0676d5edde67"),
|
||||
true, 0x10000000000UL, 1557432154, 0600, strNew(testUser()), strNew(testGroup()), 0, true, false, NULL),
|
||||
false, "zero sparse 1TB file");
|
||||
TEST_RESULT_UINT(storageInfoNP(storagePg(), strNew("sparse-zero")).size, 0x10000000000UL, " check size");
|
||||
TEST_RESULT_UINT(storageInfoP(storagePg(), strNew("sparse-zero")).size, 0x10000000000UL, " check size");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
restoreFile(
|
||||
repoFile1, repoFileReferenceFull, false, strNew("normal-zero"), strNew("9bc8ab2dda60ef4beed07d1e19ce0676d5edde67"),
|
||||
false, 0, 1557432154, 0600, strNew(testUser()), strNew(testGroup()), 0, false, false, NULL),
|
||||
true, "zero-length file");
|
||||
TEST_RESULT_UINT(storageInfoNP(storagePg(), strNew("normal-zero")).size, 0, " check size");
|
||||
TEST_RESULT_UINT(storageInfoP(storagePg(), strNew("normal-zero")).size, 0, " check size");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
// Create a compressed encrypted repo file
|
||||
StorageWrite *ceRepoFile = storageNewWriteNP(
|
||||
StorageWrite *ceRepoFile = storageNewWriteP(
|
||||
storageRepoWrite(), strNewFmt(STORAGE_REPO_BACKUP "/%s/%s.gz", strPtr(repoFileReferenceFull), strPtr(repoFile1)));
|
||||
IoFilterGroup *filterGroup = ioWriteFilterGroup(storageWriteIo(ceRepoFile));
|
||||
ioFilterGroupAdd(filterGroup, gzipCompressNew(3, false));
|
||||
ioFilterGroupAdd(filterGroup, cipherBlockNew(cipherModeEncrypt, cipherTypeAes256Cbc, BUFSTRDEF("badpass"), NULL));
|
||||
|
||||
storagePutNP(ceRepoFile, BUFSTRDEF("acefile"));
|
||||
storagePutP(ceRepoFile, BUFSTRDEF("acefile"));
|
||||
|
||||
TEST_ERROR(
|
||||
restoreFile(
|
||||
@ -210,7 +210,7 @@ testRun(void)
|
||||
false, 7, 1557432154, 0600, strNew(testUser()), strNew(testGroup()), 0, false, false, strNew("badpass")),
|
||||
true, "copy file");
|
||||
|
||||
StorageInfo info = storageInfoNP(storagePg(), strNew("normal"));
|
||||
StorageInfo info = storageInfoP(storagePg(), strNew("normal"));
|
||||
TEST_RESULT_BOOL(info.exists, true, " check exists");
|
||||
TEST_RESULT_UINT(info.size, 7, " check size");
|
||||
TEST_RESULT_UINT(info.mode, 0600, " check mode");
|
||||
@ -218,12 +218,12 @@ testRun(void)
|
||||
TEST_RESULT_STR(strPtr(info.user), testUser(), " check user");
|
||||
TEST_RESULT_STR(strPtr(info.group), testGroup(), " check group");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storagePg(), strNew("normal"))))), "acefile", " check contents");
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(storagePg(), strNew("normal"))))), "acefile", " check contents");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
// Create a repo file
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageRepoWrite(), strNewFmt(STORAGE_REPO_BACKUP "/%s/%s", strPtr(repoFileReferenceFull), strPtr(repoFile1))),
|
||||
BUFSTRDEF("atestfile"));
|
||||
|
||||
@ -233,7 +233,7 @@ testRun(void)
|
||||
false, 9, 1557432154, 0600, strNew(testUser()), strNew(testGroup()), 0, true, false, NULL),
|
||||
true, "sha1 delta missing");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storagePg(), strNew("delta"))))), "atestfile", " check contents");
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(storagePg(), strNew("delta"))))), "atestfile", " check contents");
|
||||
|
||||
size_t oldBufferSize = ioBufferSize();
|
||||
ioBufferSizeSet(4);
|
||||
@ -253,7 +253,7 @@ testRun(void)
|
||||
false, "sha1 delta force existing");
|
||||
|
||||
// Change the existing file so it no longer matches by size
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("delta")), BUFSTRDEF("atestfile2"));
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("delta")), BUFSTRDEF("atestfile2"));
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
restoreFile(
|
||||
@ -261,9 +261,9 @@ testRun(void)
|
||||
false, 9, 1557432154, 0600, strNew(testUser()), strNew(testGroup()), 0, true, false, NULL),
|
||||
true, "sha1 delta existing, size differs");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storagePg(), strNew("delta"))))), "atestfile", " check contents");
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(storagePg(), strNew("delta"))))), "atestfile", " check contents");
|
||||
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("delta")), BUFSTRDEF("atestfile2"));
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("delta")), BUFSTRDEF("atestfile2"));
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
restoreFile(
|
||||
@ -271,10 +271,10 @@ testRun(void)
|
||||
false, 9, 1557432154, 0600, strNew(testUser()), strNew(testGroup()), 1557432155, true, true, NULL),
|
||||
true, "delta force existing, size differs");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storagePg(), strNew("delta"))))), "atestfile", " check contents");
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(storagePg(), strNew("delta"))))), "atestfile", " check contents");
|
||||
|
||||
// Change the existing file so it no longer matches by content
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("delta")), BUFSTRDEF("btestfile"));
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("delta")), BUFSTRDEF("btestfile"));
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
restoreFile(
|
||||
@ -282,9 +282,9 @@ testRun(void)
|
||||
false, 9, 1557432154, 0600, strNew(testUser()), strNew(testGroup()), 0, true, false, NULL),
|
||||
true, "sha1 delta existing, content differs");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storagePg(), strNew("delta"))))), "atestfile", " check contents");
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(storagePg(), strNew("delta"))))), "atestfile", " check contents");
|
||||
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("delta")), BUFSTRDEF("btestfile"));
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("delta")), BUFSTRDEF("btestfile"));
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
restoreFile(
|
||||
@ -299,7 +299,7 @@ testRun(void)
|
||||
true, "delta force existing, timestamp after copy time");
|
||||
|
||||
// Change the existing file to zero-length
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("delta")), BUFSTRDEF(""));
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("delta")), BUFSTRDEF(""));
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
restoreFile(
|
||||
@ -330,7 +330,7 @@ testRun(void)
|
||||
TEST_RESULT_STR(strPtr(strNewBuf(serverWrite)), "{\"out\":true}\n", " check result");
|
||||
bufUsedSet(serverWrite, 0);
|
||||
|
||||
info = storageInfoNP(storagePg(), strNew("protocol"));
|
||||
info = storageInfoP(storagePg(), strNew("protocol"));
|
||||
TEST_RESULT_BOOL(info.exists, true, " check exists");
|
||||
TEST_RESULT_UINT(info.size, 9, " check size");
|
||||
TEST_RESULT_UINT(info.mode, 0677, " check mode");
|
||||
@ -338,7 +338,7 @@ testRun(void)
|
||||
TEST_RESULT_STR(strPtr(info.user), testUser(), " check user");
|
||||
TEST_RESULT_STR(strPtr(info.group), testGroup(), " check group");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storagePg(), strNew("protocol"))))), "atestfile", " check contents");
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(storagePg(), strNew("protocol"))))), "atestfile", " check contents");
|
||||
|
||||
paramList = varLstNew();
|
||||
varLstAdd(paramList, varNewStr(repoFile1));
|
||||
@ -384,12 +384,12 @@ testRun(void)
|
||||
TEST_ERROR_FMT(restorePathValidate(), PathMissingError, "$PGDATA directory '%s/pg' does not exist", testPath());
|
||||
|
||||
// Create PGDATA
|
||||
storagePathCreateNP(storagePgWrite(), NULL);
|
||||
storagePathCreateP(storagePgWrite(), NULL);
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("error on postmaster.pid is present");
|
||||
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("postmaster.pid")), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("postmaster.pid")), NULL);
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
restorePathValidate(), PostmasterRunningError,
|
||||
@ -418,7 +418,7 @@ testRun(void)
|
||||
" exist in the destination directories the restore will be aborted.");
|
||||
|
||||
harnessCfgLoad(cfgCmdRestore, argList);
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew("backup.manifest")), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("backup.manifest")), NULL);
|
||||
TEST_RESULT_VOID(restorePathValidate(), "restore --delta with valid PGDATA");
|
||||
storageRemoveP(storagePgWrite(), strNew("backup.manifest"), .errorOnMissing = true);
|
||||
|
||||
@ -437,7 +437,7 @@ testRun(void)
|
||||
" exist in the destination directories the restore will be aborted.");
|
||||
|
||||
harnessCfgLoad(cfgCmdRestore, argList);
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), strNew(PG_FILE_PGVERSION)), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew(PG_FILE_PGVERSION)), NULL);
|
||||
TEST_RESULT_VOID(restorePathValidate(), "restore --force with valid PGDATA");
|
||||
storageRemoveP(storagePgWrite(), strNew(PG_FILE_PGVERSION), .errorOnMissing = true);
|
||||
}
|
||||
@ -901,13 +901,13 @@ testRun(void)
|
||||
|
||||
TEST_RESULT_LOG("P00 DETAIL: check '{[path]}/pg' exists");
|
||||
|
||||
storagePathRemoveNP(storagePgWrite(), NULL);
|
||||
storagePathRemoveP(storagePgWrite(), NULL);
|
||||
storagePathCreateP(storagePgWrite(), NULL, .mode = 0700);
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("fail on restore with directory not empty");
|
||||
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), PG_FILE_RECOVERYCONF_STR), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), PG_FILE_RECOVERYCONF_STR), NULL);
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
restoreCleanBuild(manifest), PathNotEmptyError,
|
||||
@ -920,7 +920,7 @@ testRun(void)
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("succeed when all directories empty");
|
||||
|
||||
storageRemoveNP(storagePgWrite(), PG_FILE_RECOVERYCONF_STR);
|
||||
storageRemoveP(storagePgWrite(), PG_FILE_RECOVERYCONF_STR);
|
||||
|
||||
manifestTargetAdd(
|
||||
manifest, &(ManifestTarget){
|
||||
@ -941,8 +941,8 @@ testRun(void)
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("error when linked file already exists without delta");
|
||||
|
||||
storageRemoveNP(storagePgWrite(), STRDEF("pg_hba.conf"));
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), STRDEF("../conf/pg_hba.conf")), NULL);
|
||||
storageRemoveP(storagePgWrite(), STRDEF("pg_hba.conf"));
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), STRDEF("../conf/pg_hba.conf")), NULL);
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
restoreCleanBuild(manifest), FileExistsError,
|
||||
@ -977,7 +977,7 @@ testRun(void)
|
||||
|
||||
TEST_SYSTEM_FMT("rm -rf %s/*", strPtr(pgPath));
|
||||
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), PG_FILE_RECOVERYCONF_STR), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), PG_FILE_RECOVERYCONF_STR), NULL);
|
||||
TEST_RESULT_VOID(restoreCleanBuild(manifest), "normal restore ignore recovery.conf");
|
||||
|
||||
TEST_RESULT_LOG(
|
||||
@ -1006,9 +1006,9 @@ testRun(void)
|
||||
|
||||
manifestFileAdd(manifest, &(ManifestFile){.name = STRDEF(MANIFEST_TARGET_PGDATA "/" PG_FILE_POSTGRESQLAUTOCONF)});
|
||||
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), PG_FILE_POSTGRESQLAUTOCONF_STR), NULL);
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), PG_FILE_RECOVERYSIGNAL_STR), NULL);
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), PG_FILE_STANDBYSIGNAL_STR), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), PG_FILE_POSTGRESQLAUTOCONF_STR), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), PG_FILE_RECOVERYSIGNAL_STR), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), PG_FILE_STANDBYSIGNAL_STR), NULL);
|
||||
|
||||
TEST_RESULT_VOID(restoreCleanBuild(manifest), "restore");
|
||||
|
||||
@ -1420,10 +1420,10 @@ testRun(void)
|
||||
restoreRecoveryWriteAutoConf(PG_VERSION_12, restoreLabel);
|
||||
|
||||
TEST_RESULT_STR_Z(
|
||||
strNewBuf(storageGetNP(storageNewReadNP(storagePg(), PG_FILE_POSTGRESQLAUTOCONF_STR))),
|
||||
strNewBuf(storageGetP(storageNewReadP(storagePg(), PG_FILE_POSTGRESQLAUTOCONF_STR))),
|
||||
"", "check postgresql.auto.conf");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storagePg(), PG_FILE_RECOVERYSIGNAL_STR), true, "recovery.signal exists");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storagePg(), PG_FILE_STANDBYSIGNAL_STR), false, "standby.signal missing");
|
||||
TEST_RESULT_BOOL(storageExistsP(storagePg(), PG_FILE_RECOVERYSIGNAL_STR), true, "recovery.signal exists");
|
||||
TEST_RESULT_BOOL(storageExistsP(storagePg(), PG_FILE_STANDBYSIGNAL_STR), false, "standby.signal missing");
|
||||
|
||||
TEST_RESULT_LOG(
|
||||
"P00 WARN: postgresql.auto.conf does not exist -- creating to contain recovery settings\n"
|
||||
@ -1434,8 +1434,8 @@ testRun(void)
|
||||
|
||||
TEST_SYSTEM_FMT("rm -rf %s/*", strPtr(pgPath));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storagePgWrite(), PG_FILE_POSTGRESQLAUTOCONF_STR),
|
||||
storagePutP(
|
||||
storageNewWriteP(storagePgWrite(), PG_FILE_POSTGRESQLAUTOCONF_STR),
|
||||
BUFSTRDEF(
|
||||
"# DO NOT MODIFY\n"
|
||||
"\t recovery_target_action='promote'\n\n"));
|
||||
@ -1443,12 +1443,12 @@ testRun(void)
|
||||
restoreRecoveryWriteAutoConf(PG_VERSION_12, restoreLabel);
|
||||
|
||||
TEST_RESULT_STR_Z(
|
||||
strNewBuf(storageGetNP(storageNewReadNP(storagePg(), PG_FILE_POSTGRESQLAUTOCONF_STR))),
|
||||
strNewBuf(storageGetP(storageNewReadP(storagePg(), PG_FILE_POSTGRESQLAUTOCONF_STR))),
|
||||
"# DO NOT MODIFY\n"
|
||||
RECOVERY_SETTING_PREFIX "\t recovery_target_action='promote'\n\n",
|
||||
"check postgresql.auto.conf");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storagePg(), PG_FILE_RECOVERYSIGNAL_STR), true, "recovery.signal exists");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storagePg(), PG_FILE_STANDBYSIGNAL_STR), false, "standby.signal missing");
|
||||
TEST_RESULT_BOOL(storageExistsP(storagePg(), PG_FILE_RECOVERYSIGNAL_STR), true, "recovery.signal exists");
|
||||
TEST_RESULT_BOOL(storageExistsP(storagePg(), PG_FILE_STANDBYSIGNAL_STR), false, "standby.signal missing");
|
||||
|
||||
TEST_RESULT_LOG("P00 INFO: write updated {[path]}/pg/postgresql.auto.conf");
|
||||
|
||||
@ -1457,8 +1457,8 @@ testRun(void)
|
||||
|
||||
TEST_SYSTEM_FMT("rm -rf %s/*", strPtr(pgPath));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storagePgWrite(), PG_FILE_POSTGRESQLAUTOCONF_STR),
|
||||
storagePutP(
|
||||
storageNewWriteP(storagePgWrite(), PG_FILE_POSTGRESQLAUTOCONF_STR),
|
||||
BUFSTRDEF(
|
||||
"# DO NOT MODIFY\n"
|
||||
"recovery_target_name\t='name'\n"
|
||||
@ -1475,7 +1475,7 @@ testRun(void)
|
||||
restoreRecoveryWriteAutoConf(PG_VERSION_12, restoreLabel);
|
||||
|
||||
TEST_RESULT_STR_Z(
|
||||
strNewBuf(storageGetNP(storageNewReadNP(storagePg(), PG_FILE_POSTGRESQLAUTOCONF_STR))),
|
||||
strNewBuf(storageGetP(storageNewReadP(storagePg(), PG_FILE_POSTGRESQLAUTOCONF_STR))),
|
||||
"# DO NOT MODIFY\n"
|
||||
RECOVERY_SETTING_PREFIX "recovery_target_name\t='name'\n"
|
||||
RECOVERY_SETTING_PREFIX "recovery_target_inclusive = false\n"
|
||||
@ -1483,8 +1483,8 @@ testRun(void)
|
||||
RECOVERY_SETTING_HEADER
|
||||
"restore_command = 'my_restore_command'\n",
|
||||
"check postgresql.auto.conf");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storagePg(), PG_FILE_RECOVERYSIGNAL_STR), true, "recovery.signal exists");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storagePg(), PG_FILE_STANDBYSIGNAL_STR), true, "standby.signal missing");
|
||||
TEST_RESULT_BOOL(storageExistsP(storagePg(), PG_FILE_RECOVERYSIGNAL_STR), true, "recovery.signal exists");
|
||||
TEST_RESULT_BOOL(storageExistsP(storagePg(), PG_FILE_STANDBYSIGNAL_STR), true, "standby.signal missing");
|
||||
|
||||
TEST_RESULT_LOG("P00 INFO: write updated {[path]}/pg/postgresql.auto.conf");
|
||||
|
||||
@ -1495,8 +1495,8 @@ testRun(void)
|
||||
|
||||
TEST_SYSTEM_FMT("rm -rf %s/*", strPtr(pgPath));
|
||||
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), PG_FILE_POSTGRESQLAUTOCONF_STR), BUFSTRDEF("# DO NOT MODIFY\n"));
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), PG_FILE_STANDBYSIGNAL_STR), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), PG_FILE_POSTGRESQLAUTOCONF_STR), BUFSTRDEF("# DO NOT MODIFY\n"));
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), PG_FILE_STANDBYSIGNAL_STR), NULL);
|
||||
|
||||
argList = strLstNew();
|
||||
strLstAddZ(argList, "--stanza=test1");
|
||||
@ -1508,18 +1508,18 @@ testRun(void)
|
||||
restoreRecoveryWrite(manifest);
|
||||
|
||||
TEST_RESULT_STR_Z(
|
||||
strNewBuf(storageGetNP(storageNewReadNP(storagePg(), PG_FILE_POSTGRESQLAUTOCONF_STR))), "# DO NOT MODIFY\n",
|
||||
strNewBuf(storageGetP(storageNewReadP(storagePg(), PG_FILE_POSTGRESQLAUTOCONF_STR))), "# DO NOT MODIFY\n",
|
||||
"check postgresql.auto.conf");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storagePg(), PG_FILE_RECOVERYSIGNAL_STR), false, "recovery.signal missing");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storagePg(), PG_FILE_STANDBYSIGNAL_STR), true, "standby.signal exists");
|
||||
TEST_RESULT_BOOL(storageExistsP(storagePg(), PG_FILE_RECOVERYSIGNAL_STR), false, "recovery.signal missing");
|
||||
TEST_RESULT_BOOL(storageExistsP(storagePg(), PG_FILE_STANDBYSIGNAL_STR), true, "standby.signal exists");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("PG12 restore type default");
|
||||
|
||||
TEST_SYSTEM_FMT("rm -rf %s/*", strPtr(pgPath));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storagePgWrite(), PG_FILE_POSTGRESQLAUTOCONF_STR),
|
||||
storagePutP(
|
||||
storageNewWriteP(storagePgWrite(), PG_FILE_POSTGRESQLAUTOCONF_STR),
|
||||
BUFSTRDEF("# DO NOT MODIFY\n"));
|
||||
|
||||
argList = strLstNew();
|
||||
@ -1531,10 +1531,10 @@ testRun(void)
|
||||
restoreRecoveryWrite(manifest);
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
bufEq(storageGetNP(storageNewReadNP(storagePg(), PG_FILE_POSTGRESQLAUTOCONF_STR)), BUFSTRDEF("# DO NOT MODIFY\n")),
|
||||
bufEq(storageGetP(storageNewReadP(storagePg(), PG_FILE_POSTGRESQLAUTOCONF_STR)), BUFSTRDEF("# DO NOT MODIFY\n")),
|
||||
false, "check postgresql.auto.conf has changed");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storagePg(), PG_FILE_RECOVERYSIGNAL_STR), true, "recovery.signal exists");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storagePg(), PG_FILE_STANDBYSIGNAL_STR), false, "standby.signal missing");
|
||||
TEST_RESULT_BOOL(storageExistsP(storagePg(), PG_FILE_RECOVERYSIGNAL_STR), true, "recovery.signal exists");
|
||||
TEST_RESULT_BOOL(storageExistsP(storagePg(), PG_FILE_STANDBYSIGNAL_STR), false, "standby.signal missing");
|
||||
|
||||
TEST_RESULT_LOG("P00 INFO: write updated {[path]}/pg/postgresql.auto.conf");
|
||||
}
|
||||
@ -1572,8 +1572,8 @@ testRun(void)
|
||||
|
||||
// Write backup info
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageRepoWrite(), INFO_BACKUP_PATH_FILE_STR),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageRepoWrite(), INFO_BACKUP_PATH_FILE_STR),
|
||||
harnessInfoChecksumZ(TEST_RESTORE_BACKUP_INFO "\n" TEST_RESTORE_BACKUP_INFO_DB));
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -1606,7 +1606,7 @@ testRun(void)
|
||||
manifestPathAdd(
|
||||
manifest,
|
||||
&(ManifestPath){.name = MANIFEST_TARGET_PGDATA_STR, .mode = 0700, .group = groupName(), .user = userName()});
|
||||
storagePathCreateNP(storagePgWrite(), NULL);
|
||||
storagePathCreateP(storagePgWrite(), NULL);
|
||||
|
||||
// Global directory
|
||||
manifestPathAdd(
|
||||
@ -1621,8 +1621,8 @@ testRun(void)
|
||||
.name = STRDEF(TEST_PGDATA PG_FILE_PGVERSION), .size = 4, .timestamp = 1482182860,
|
||||
.mode = 0600, .group = groupName(), .user = userName(),
|
||||
.checksumSha1 = "797e375b924134687cbf9eacd37a4355f3d825e4"});
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageRepoWrite(), STRDEF(TEST_REPO_PATH PG_FILE_PGVERSION)), BUFSTRDEF(PG_VERSION_84_STR "\n"));
|
||||
storagePutP(
|
||||
storageNewWriteP(storageRepoWrite(), STRDEF(TEST_REPO_PATH PG_FILE_PGVERSION)), BUFSTRDEF(PG_VERSION_84_STR "\n"));
|
||||
|
||||
// pg_tblspc/1
|
||||
manifestTargetAdd(
|
||||
@ -1661,7 +1661,7 @@ testRun(void)
|
||||
manifestSave(
|
||||
manifest,
|
||||
storageWriteIo(
|
||||
storageNewWriteNP(storageRepoWrite(),
|
||||
storageNewWriteP(storageRepoWrite(),
|
||||
strNew(STORAGE_REPO_BACKUP "/" TEST_LABEL "/" BACKUP_MANIFEST_FILE))));
|
||||
|
||||
TEST_RESULT_VOID(cmdRestore(), "successful restore");
|
||||
@ -1713,10 +1713,10 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdRestore, argList);
|
||||
|
||||
// Make sure existing backup.manifest file is ignored
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), BACKUP_MANIFEST_FILE_STR), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), BACKUP_MANIFEST_FILE_STR), NULL);
|
||||
|
||||
// Add a bogus file that will be removed
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), STRDEF("bogus-file")), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), STRDEF("bogus-file")), NULL);
|
||||
|
||||
// Add a special file that will be removed
|
||||
TEST_SYSTEM_FMT("mkfifo %s/pipe", strPtr(pgPath));
|
||||
@ -1735,7 +1735,7 @@ testRun(void)
|
||||
&(ManifestFile){
|
||||
.name = STRDEF(TEST_PGDATA PG_FILE_TABLESPACEMAP), .size = 0, .timestamp = 1482182860,
|
||||
.mode = 0600, .group = groupName(), .user = userName(), .checksumSha1 = HASH_TYPE_SHA1_ZERO});
|
||||
storagePutNP(storageNewWriteNP(storageRepoWrite(), STRDEF(TEST_REPO_PATH PG_FILE_TABLESPACEMAP)), NULL);
|
||||
storagePutP(storageNewWriteP(storageRepoWrite(), STRDEF(TEST_REPO_PATH PG_FILE_TABLESPACEMAP)), NULL);
|
||||
|
||||
// pg_tblspc/1/16384/PG_VERSION
|
||||
manifestFileAdd(
|
||||
@ -1744,8 +1744,8 @@ testRun(void)
|
||||
.name = STRDEF(MANIFEST_TARGET_PGTBLSPC "/1/16384/" PG_FILE_PGVERSION), .size = 4,
|
||||
.timestamp = 1482182860, .mode = 0600, .group = groupName(), .user = userName(),
|
||||
.checksumSha1 = "797e375b924134687cbf9eacd37a4355f3d825e4"});
|
||||
storagePutNP(
|
||||
storageNewWriteNP(
|
||||
storagePutP(
|
||||
storageNewWriteP(
|
||||
storageRepoWrite(),
|
||||
STRDEF(STORAGE_REPO_BACKUP "/" TEST_LABEL "/" MANIFEST_TARGET_PGTBLSPC "/1/16384/" PG_FILE_PGVERSION)),
|
||||
BUFSTRDEF(PG_VERSION_84_STR "\n"));
|
||||
@ -1761,7 +1761,7 @@ testRun(void)
|
||||
manifestSave(
|
||||
manifest,
|
||||
storageWriteIo(
|
||||
storageNewWriteNP(storageRepoWrite(),
|
||||
storageNewWriteP(storageRepoWrite(),
|
||||
strNew(STORAGE_REPO_BACKUP "/" TEST_LABEL "/" BACKUP_MANIFEST_FILE))));
|
||||
|
||||
#undef TEST_LABEL
|
||||
@ -1840,7 +1840,7 @@ testRun(void)
|
||||
manifestPathAdd(
|
||||
manifest,
|
||||
&(ManifestPath){.name = MANIFEST_TARGET_PGDATA_STR, .mode = 0700, .group = groupName(), .user = userName()});
|
||||
storagePathCreateNP(storagePgWrite(), NULL);
|
||||
storagePathCreateP(storagePgWrite(), NULL);
|
||||
|
||||
// global directory
|
||||
manifestPathAdd(
|
||||
@ -1859,8 +1859,8 @@ testRun(void)
|
||||
.name = STRDEF(TEST_PGDATA PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL), .size = 8192, .timestamp = 1482182860,
|
||||
.mode = 0600, .group = groupName(), .user = userName(),
|
||||
.checksumSha1 = "5e2b96c19c4f5c63a5afa2de504d29fe64a4c908"});
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageRepoWrite(), STRDEF(TEST_REPO_PATH PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)), fileBuffer);
|
||||
storagePutP(
|
||||
storageNewWriteP(storageRepoWrite(), STRDEF(TEST_REPO_PATH PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)), fileBuffer);
|
||||
|
||||
// global/999
|
||||
manifestFileAdd(
|
||||
@ -1869,7 +1869,7 @@ testRun(void)
|
||||
.name = STRDEF(TEST_PGDATA PG_PATH_GLOBAL "/999"), .size = 0, .timestamp = 1482182860,
|
||||
.mode = 0600, .group = groupName(), .user = userName(),
|
||||
.checksumSha1 = HASH_TYPE_SHA1_ZERO, .reference = STRDEF(TEST_LABEL)});
|
||||
storagePutNP(storageNewWriteNP(storageRepoWrite(), STRDEF(TEST_REPO_PATH PG_PATH_GLOBAL "/999")), NULL);
|
||||
storagePutP(storageNewWriteP(storageRepoWrite(), STRDEF(TEST_REPO_PATH PG_PATH_GLOBAL "/999")), NULL);
|
||||
|
||||
// PG_VERSION
|
||||
manifestFileAdd(
|
||||
@ -1878,8 +1878,8 @@ testRun(void)
|
||||
.name = STRDEF(TEST_PGDATA PG_FILE_PGVERSION), .size = 4, .timestamp = 1482182860,
|
||||
.mode = 0600, .group = groupName(), .user = userName(),
|
||||
.checksumSha1 = "8dbabb96e032b8d9f1993c0e4b9141e71ade01a1"});
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageRepoWrite(), STRDEF(TEST_REPO_PATH PG_FILE_PGVERSION)), BUFSTRDEF(PG_VERSION_94_STR "\n"));
|
||||
storagePutP(
|
||||
storageNewWriteP(storageRepoWrite(), STRDEF(TEST_REPO_PATH PG_FILE_PGVERSION)), BUFSTRDEF(PG_VERSION_94_STR "\n"));
|
||||
|
||||
// base directory
|
||||
manifestPathAdd(
|
||||
@ -1900,8 +1900,8 @@ testRun(void)
|
||||
.name = STRDEF(TEST_PGDATA "base/1/" PG_FILE_PGVERSION), .size = 4, .timestamp = 1482182860,
|
||||
.mode = 0600, .group = groupName(), .user = userName(),
|
||||
.checksumSha1 = "8dbabb96e032b8d9f1993c0e4b9141e71ade01a1"});
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageRepoWrite(), STRDEF(TEST_REPO_PATH "base/1/" PG_FILE_PGVERSION)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageRepoWrite(), STRDEF(TEST_REPO_PATH "base/1/" PG_FILE_PGVERSION)),
|
||||
BUFSTRDEF(PG_VERSION_94_STR "\n"));
|
||||
|
||||
// base/1/2
|
||||
@ -1915,7 +1915,7 @@ testRun(void)
|
||||
.name = STRDEF(TEST_PGDATA "base/1/2"), .size = 8192, .timestamp = 1482182860,
|
||||
.mode = 0600, .group = groupName(), .user = userName(),
|
||||
.checksumSha1 = "4d7b2a36c5387decf799352a3751883b7ceb96aa"});
|
||||
storagePutNP(storageNewWriteNP(storageRepoWrite(), STRDEF(TEST_REPO_PATH "base/1/2")), fileBuffer);
|
||||
storagePutP(storageNewWriteP(storageRepoWrite(), STRDEF(TEST_REPO_PATH "base/1/2")), fileBuffer);
|
||||
|
||||
// base/16384 directory
|
||||
manifestPathAdd(
|
||||
@ -1930,8 +1930,8 @@ testRun(void)
|
||||
.name = STRDEF(TEST_PGDATA "base/16384/" PG_FILE_PGVERSION), .size = 4, .timestamp = 1482182860,
|
||||
.mode = 0600, .group = groupName(), .user = userName(),
|
||||
.checksumSha1 = "8dbabb96e032b8d9f1993c0e4b9141e71ade01a1"});
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageRepoWrite(), STRDEF(TEST_REPO_PATH "base/16384/" PG_FILE_PGVERSION)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageRepoWrite(), STRDEF(TEST_REPO_PATH "base/16384/" PG_FILE_PGVERSION)),
|
||||
BUFSTRDEF(PG_VERSION_94_STR "\n"));
|
||||
|
||||
// base/16384/16385
|
||||
@ -1945,7 +1945,7 @@ testRun(void)
|
||||
.name = STRDEF(TEST_PGDATA "base/16384/16385"), .size = 16384, .timestamp = 1482182860,
|
||||
.mode = 0600, .group = groupName(), .user = userName(),
|
||||
.checksumSha1 = "d74e5f7ebe52a3ed468ba08c5b6aefaccd1ca88f"});
|
||||
storagePutNP(storageNewWriteNP(storageRepoWrite(), STRDEF(TEST_REPO_PATH "base/16384/16385")), fileBuffer);
|
||||
storagePutP(storageNewWriteP(storageRepoWrite(), STRDEF(TEST_REPO_PATH "base/16384/16385")), fileBuffer);
|
||||
|
||||
// base/32768 directory
|
||||
manifestPathAdd(
|
||||
@ -1960,8 +1960,8 @@ testRun(void)
|
||||
.name = STRDEF(TEST_PGDATA "base/32768/" PG_FILE_PGVERSION), .size = 4, .timestamp = 1482182860,
|
||||
.mode = 0600, .group = groupName(), .user = userName(),
|
||||
.checksumSha1 = "8dbabb96e032b8d9f1993c0e4b9141e71ade01a1"});
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageRepoWrite(), STRDEF(TEST_REPO_PATH "base/32768/" PG_FILE_PGVERSION)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageRepoWrite(), STRDEF(TEST_REPO_PATH "base/32768/" PG_FILE_PGVERSION)),
|
||||
BUFSTRDEF(PG_VERSION_94_STR "\n"));
|
||||
|
||||
// base/32768/32769
|
||||
@ -1975,7 +1975,7 @@ testRun(void)
|
||||
.name = STRDEF(TEST_PGDATA "base/32768/32769"), .size = 32768, .timestamp = 1482182860,
|
||||
.mode = 0600, .group = groupName(), .user = userName(),
|
||||
.checksumSha1 = "a40f0986acb1531ce0cc75a23dcf8aa406ae9081"});
|
||||
storagePutNP(storageNewWriteNP(storageRepoWrite(), STRDEF(TEST_REPO_PATH "base/32768/32769")), fileBuffer);
|
||||
storagePutP(storageNewWriteP(storageRepoWrite(), STRDEF(TEST_REPO_PATH "base/32768/32769")), fileBuffer);
|
||||
|
||||
// File link to postgresql.conf
|
||||
const String *name = STRDEF(MANIFEST_TARGET_PGDATA "/postgresql.conf");
|
||||
@ -1992,8 +1992,8 @@ testRun(void)
|
||||
.name = STRDEF(TEST_PGDATA "postgresql.conf"), .size = 15, .timestamp = 1482182860,
|
||||
.mode = 0600, .group = groupName(), .user = userName(),
|
||||
.checksumSha1 = "98b8abb2e681e2a5a7d8ab082c0a79727887558d"});
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageRepoWrite(), STRDEF(TEST_REPO_PATH "postgresql.conf")), BUFSTRDEF("POSTGRESQL.CONF"));
|
||||
storagePutP(
|
||||
storageNewWriteP(storageRepoWrite(), STRDEF(TEST_REPO_PATH "postgresql.conf")), BUFSTRDEF("POSTGRESQL.CONF"));
|
||||
|
||||
// File link to pg_hba.conf
|
||||
name = STRDEF(MANIFEST_TARGET_PGDATA "/pg_hba.conf");
|
||||
@ -2010,8 +2010,8 @@ testRun(void)
|
||||
.name = STRDEF(TEST_PGDATA "pg_hba.conf"), .size = 11, .timestamp = 1482182860,
|
||||
.mode = 0600, .group = groupName(), .user = userName(),
|
||||
.checksumSha1 = "401215e092779574988a854d8c7caed7f91dba4b"});
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageRepoWrite(), STRDEF(TEST_REPO_PATH "pg_hba.conf")), BUFSTRDEF("PG_HBA.CONF"));
|
||||
storagePutP(
|
||||
storageNewWriteP(storageRepoWrite(), STRDEF(TEST_REPO_PATH "pg_hba.conf")), BUFSTRDEF("PG_HBA.CONF"));
|
||||
|
||||
// tablespace_map (will be ignored during restore)
|
||||
manifestFileAdd(
|
||||
@ -2019,7 +2019,7 @@ testRun(void)
|
||||
&(ManifestFile){
|
||||
.name = STRDEF(TEST_PGDATA PG_FILE_TABLESPACEMAP), .size = 0, .timestamp = 1482182860,
|
||||
.mode = 0600, .group = groupName(), .user = userName(), .checksumSha1 = HASH_TYPE_SHA1_ZERO});
|
||||
storagePutNP(storageNewWriteNP(storageRepoWrite(), STRDEF(TEST_REPO_PATH PG_FILE_TABLESPACEMAP)), NULL);
|
||||
storagePutP(storageNewWriteP(storageRepoWrite(), STRDEF(TEST_REPO_PATH PG_FILE_TABLESPACEMAP)), NULL);
|
||||
|
||||
// Path link to pg_wal
|
||||
name = STRDEF(MANIFEST_TARGET_PGDATA "/pg_wal");
|
||||
@ -2068,12 +2068,12 @@ testRun(void)
|
||||
manifestSave(
|
||||
manifest,
|
||||
storageWriteIo(
|
||||
storageNewWriteNP(storageRepoWrite(),
|
||||
storageNewWriteP(storageRepoWrite(),
|
||||
strNew(STORAGE_REPO_BACKUP "/" TEST_LABEL "/" BACKUP_MANIFEST_FILE))));
|
||||
|
||||
// Add a few bogus paths/files/links to be removed in delta
|
||||
storagePathCreateNP(storagePgWrite(), STRDEF("bogus1/bogus2"));
|
||||
storagePathCreateNP(storagePgWrite(), STRDEF(PG_PATH_GLOBAL "/bogus3"));
|
||||
storagePathCreateP(storagePgWrite(), STRDEF("bogus1/bogus2"));
|
||||
storagePathCreateP(storagePgWrite(), STRDEF(PG_PATH_GLOBAL "/bogus3"));
|
||||
|
||||
// Add a few bogus links to be deleted
|
||||
THROW_ON_SYS_ERROR(
|
||||
@ -2180,7 +2180,7 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdRestore, argList);
|
||||
|
||||
// Write recovery.conf so we don't get a preserve warning
|
||||
storagePutNP(storageNewWriteNP(storagePgWrite(), PG_FILE_RECOVERYCONF_STR), BUFSTRDEF("Some Settings"));
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), PG_FILE_RECOVERYCONF_STR), BUFSTRDEF("Some Settings"));
|
||||
|
||||
TEST_RESULT_VOID(cmdRestore(), "successful restore");
|
||||
|
||||
|
@ -50,20 +50,20 @@ testRun(void)
|
||||
|
||||
// Create the stop file
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), BUFSTRDEF("")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), BUFSTRDEF("")),
|
||||
"create stop file");
|
||||
TEST_ERROR_FMT(cmdStanzaCreate(), StopError, "stop file exists for stanza %s", strPtr(stanza));
|
||||
TEST_RESULT_VOID(
|
||||
storageRemoveNP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), " remove the stop file");
|
||||
storageRemoveP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), " remove the stop file");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
argList = strLstDup(argListBase);
|
||||
harnessCfgLoad(cfgCmdStanzaCreate, argList);
|
||||
|
||||
// Create pg_control
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(stanza))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(stanza))),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_96, .systemId = 6569239123849665679}));
|
||||
|
||||
TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - no files exist");
|
||||
@ -79,17 +79,17 @@ testRun(void)
|
||||
"1={\"db-id\":6569239123849665679,\"db-version\":\"9.6\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, fileName), harnessInfoChecksum(contentArchive)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, fileName), harnessInfoChecksum(contentArchive)),
|
||||
"put archive info to test file");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
(bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, archiveInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(archiveInfoFileName))))) &&
|
||||
storageGetP(storageNewReadP(storageTest, archiveInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(archiveInfoFileName))))) &&
|
||||
bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, archiveInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, fileName)))),
|
||||
storageGetP(storageNewReadP(storageTest, archiveInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, fileName)))),
|
||||
true, " test and stanza archive info files are equal");
|
||||
|
||||
String *contentBackup = strNew
|
||||
@ -106,17 +106,17 @@ testRun(void)
|
||||
"\"db-version\":\"9.6\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, fileName), harnessInfoChecksum(contentBackup)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, fileName), harnessInfoChecksum(contentBackup)),
|
||||
"put backup info to test file");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
(bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, backupInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(backupInfoFileName))))) &&
|
||||
storageGetP(storageNewReadP(storageTest, backupInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(backupInfoFileName))))) &&
|
||||
bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, backupInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, fileName)))),
|
||||
storageGetP(storageNewReadP(storageTest, backupInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, fileName)))),
|
||||
true, " test and stanza backup info files are equal");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
@ -128,8 +128,8 @@ testRun(void)
|
||||
TEST_RESULT_VOID(cmdStanzaCreate(), " stanza create - success with archive.info files and only backup.info.copy");
|
||||
TEST_RESULT_BOOL(
|
||||
bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, backupInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(backupInfoFileName))))),
|
||||
storageGetP(storageNewReadP(storageTest, backupInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(backupInfoFileName))))),
|
||||
true, "backup.info recreated from backup.info.copy");
|
||||
|
||||
// Remove archive.info
|
||||
@ -137,8 +137,8 @@ testRun(void)
|
||||
TEST_RESULT_VOID(cmdStanzaCreate(), " stanza create - success with backup.info files and only archive.info.copy");
|
||||
TEST_RESULT_BOOL(
|
||||
bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, archiveInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(archiveInfoFileName))))),
|
||||
storageGetP(storageNewReadP(storageTest, archiveInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(archiveInfoFileName))))),
|
||||
true, "archive.info recreated from archive.info.copy");
|
||||
|
||||
// Remove info files
|
||||
@ -147,11 +147,11 @@ testRun(void)
|
||||
TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - success with copy files only");
|
||||
TEST_RESULT_BOOL(
|
||||
(bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, backupInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(backupInfoFileName))))) &&
|
||||
storageGetP(storageNewReadP(storageTest, backupInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(backupInfoFileName))))) &&
|
||||
bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, archiveInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(archiveInfoFileName)))))),
|
||||
storageGetP(storageNewReadP(storageTest, archiveInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(archiveInfoFileName)))))),
|
||||
true, "info files recreated from copy files");
|
||||
|
||||
// Remove copy files
|
||||
@ -164,11 +164,11 @@ testRun(void)
|
||||
TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - success with info files only");
|
||||
TEST_RESULT_BOOL(
|
||||
(bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, backupInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(backupInfoFileName))))) &&
|
||||
storageGetP(storageNewReadP(storageTest, backupInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(backupInfoFileName))))) &&
|
||||
bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, archiveInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(archiveInfoFileName)))))),
|
||||
storageGetP(storageNewReadP(storageTest, archiveInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(archiveInfoFileName)))))),
|
||||
true, "info files recreated from info files");
|
||||
|
||||
// Errors
|
||||
@ -192,9 +192,9 @@ testRun(void)
|
||||
|
||||
// Archive files removed - backup.info exists
|
||||
TEST_RESULT_VOID(
|
||||
storageMoveNP(storageTest,
|
||||
storageNewReadNP(storageTest, backupInfoFileName),
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(backupInfoFileName)))),
|
||||
storageMoveP(storageTest,
|
||||
storageNewReadP(storageTest, backupInfoFileName),
|
||||
storageNewWriteP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(backupInfoFileName)))),
|
||||
"backup.info moved to backup.info.copy");
|
||||
TEST_ERROR_FMT(
|
||||
cmdStanzaCreate(), FileMissingError, "backup.info exists but archive.info is missing\n"
|
||||
@ -202,8 +202,8 @@ testRun(void)
|
||||
|
||||
// Backup files removed - archive.info file exists
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, archiveInfoFileName), harnessInfoChecksum(contentArchive)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, archiveInfoFileName), harnessInfoChecksum(contentArchive)),
|
||||
"put archive info to file");
|
||||
TEST_RESULT_VOID(
|
||||
storageRemoveP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(backupInfoFileName)), .errorOnMissing = true),
|
||||
@ -214,9 +214,9 @@ testRun(void)
|
||||
|
||||
// Backup files removed - archive.info.copy file exists
|
||||
TEST_RESULT_VOID(
|
||||
storageMoveNP(storageTest,
|
||||
storageNewReadNP(storageTest, archiveInfoFileName),
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(archiveInfoFileName)))),
|
||||
storageMoveP(storageTest,
|
||||
storageNewReadP(storageTest, archiveInfoFileName),
|
||||
storageNewWriteP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(archiveInfoFileName)))),
|
||||
"archive.info moved to archive.info.copy");
|
||||
TEST_ERROR_FMT(
|
||||
cmdStanzaCreate(), FileMissingError, "archive.info exists but backup.info is missing\n"
|
||||
@ -224,8 +224,8 @@ testRun(void)
|
||||
|
||||
// Backup files removed - archive.info and archive.info.copy exist
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, archiveInfoFileName), harnessInfoChecksum(contentArchive)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, archiveInfoFileName), harnessInfoChecksum(contentArchive)),
|
||||
"put archive info to file");
|
||||
TEST_ERROR_FMT(
|
||||
cmdStanzaCreate(), FileMissingError, "archive.info exists but backup.info is missing\n"
|
||||
@ -248,8 +248,8 @@ testRun(void)
|
||||
"\"db-version\":\"9.6\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, backupInfoFileName), harnessInfoChecksum(contentBackup)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, backupInfoFileName), harnessInfoChecksum(contentBackup)),
|
||||
"put backup info to file - bad db-id");
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
@ -260,8 +260,8 @@ testRun(void)
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
// Copy files may or may not exist - remove
|
||||
storageRemoveNP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(archiveInfoFileName)));
|
||||
storageRemoveNP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(backupInfoFileName)));
|
||||
storageRemoveP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(archiveInfoFileName)));
|
||||
storageRemoveP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(backupInfoFileName)));
|
||||
|
||||
// Create an archive.info file and backup.info files that match but do not match the current database version
|
||||
contentBackup = strNew
|
||||
@ -278,8 +278,8 @@ testRun(void)
|
||||
"\"db-version\":\"9.5\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, backupInfoFileName), harnessInfoChecksum(contentBackup)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, backupInfoFileName), harnessInfoChecksum(contentBackup)),
|
||||
"put backup info to file");
|
||||
|
||||
contentArchive = strNew
|
||||
@ -293,8 +293,8 @@ testRun(void)
|
||||
"1={\"db-id\":6569239123849665679,\"db-version\":\"9.5\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, archiveInfoFileName), harnessInfoChecksum(contentArchive)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, archiveInfoFileName), harnessInfoChecksum(contentArchive)),
|
||||
"put archive info file");
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
@ -314,8 +314,8 @@ testRun(void)
|
||||
"1={\"db-id\":6569239123849665999,\"db-version\":\"9.6\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, archiveInfoFileName), harnessInfoChecksum(contentArchive)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, archiveInfoFileName), harnessInfoChecksum(contentArchive)),
|
||||
"put archive info to file");
|
||||
|
||||
contentBackup = strNew
|
||||
@ -332,8 +332,8 @@ testRun(void)
|
||||
"\"db-version\":\"9.6\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, backupInfoFileName), harnessInfoChecksum(contentBackup)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, backupInfoFileName), harnessInfoChecksum(contentBackup)),
|
||||
"put backup info to file");
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
@ -346,20 +346,20 @@ testRun(void)
|
||||
TEST_RESULT_VOID(storageRemoveP(storageTest, backupInfoFileName, .errorOnMissing = true), "backup.info removed");
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePathCreateNP(storageTest, strNewFmt("%s/backup.history", strPtr(backupStanzaPath))),
|
||||
storagePathCreateP(storageTest, strNewFmt("%s/backup.history", strPtr(backupStanzaPath))),
|
||||
"create directory in backup");
|
||||
TEST_ERROR_FMT(cmdStanzaCreate(), PathNotEmptyError, "backup directory not empty");
|
||||
|
||||
// File in archive, directory in backup
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/somefile", strPtr(archiveStanzaPath))), BUFSTRDEF("some content")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/somefile", strPtr(archiveStanzaPath))), BUFSTRDEF("some content")),
|
||||
"create file in archive");
|
||||
TEST_ERROR_FMT(cmdStanzaCreate(), PathNotEmptyError, "backup directory and/or archive directory not empty");
|
||||
|
||||
// File in archive, backup empty
|
||||
TEST_RESULT_VOID(
|
||||
storagePathRemoveNP(storageTest, strNewFmt("%s/backup.history", strPtr(backupStanzaPath))), "remove backup subdir");
|
||||
storagePathRemoveP(storageTest, strNewFmt("%s/backup.history", strPtr(backupStanzaPath))), "remove backup subdir");
|
||||
TEST_ERROR_FMT(cmdStanzaCreate(), PathNotEmptyError, "archive directory not empty");
|
||||
|
||||
// Repeat last test using --force (deprecated)
|
||||
@ -386,8 +386,8 @@ testRun(void)
|
||||
// pgControl and database match
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
// Create pg_control
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(pg1))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(pg1))),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_92, .systemId = 6569239123849665699}));
|
||||
|
||||
harnessPqScriptSet((HarnessPq [])
|
||||
@ -399,7 +399,7 @@ testRun(void)
|
||||
|
||||
TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - db online");
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageTest, strNewFmt("repo/archive/%s/archive.info", strPtr(stanza))), true, " stanza created");
|
||||
storageExistsP(storageTest, strNewFmt("repo/archive/%s/archive.info", strPtr(stanza))), true, " stanza created");
|
||||
|
||||
harnessPqScriptSet((HarnessPq [])
|
||||
{
|
||||
@ -414,8 +414,8 @@ testRun(void)
|
||||
// Version mismatch
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
// Create pg_control with different version
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(pg1))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(pg1))),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_91, .systemId = 6569239123849665699}));
|
||||
|
||||
harnessPqScriptSet((HarnessPq [])
|
||||
@ -435,8 +435,8 @@ testRun(void)
|
||||
// Path mismatch
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
// Create pg_control
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(pg1))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(pg1))),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_92, .systemId = 6569239123849665699}));
|
||||
|
||||
harnessPqScriptSet((HarnessPq [])
|
||||
@ -464,13 +464,13 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdStanzaCreate, argList);
|
||||
|
||||
// Create pg_control for master
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(pg1))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(pg1))),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_92, .systemId = 6569239123849665699}));
|
||||
|
||||
// Create pg_control for standby
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, testPath())),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, testPath())),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_94, .systemId = 6569239123849665700}));
|
||||
|
||||
harnessPqScriptSet((HarnessPq [])
|
||||
@ -497,8 +497,8 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdStanzaCreate, argList);
|
||||
|
||||
// Create pg_control
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(stanza))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(stanza))),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_96, .systemId = 6569239123849665679}));
|
||||
|
||||
TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - encryption");
|
||||
@ -537,12 +537,12 @@ testRun(void)
|
||||
|
||||
// Create the stop file
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), BUFSTRDEF("")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), BUFSTRDEF("")),
|
||||
"create stop file");
|
||||
TEST_ERROR_FMT(cmdStanzaUpgrade(), StopError, "stop file exists for stanza %s", strPtr(stanza));
|
||||
TEST_RESULT_VOID(
|
||||
storageRemoveNP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), " remove the stop file");
|
||||
storageRemoveP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), " remove the stop file");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
// Load Parameters
|
||||
@ -550,8 +550,8 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdStanzaCreate, argList);
|
||||
|
||||
// Create pg_control
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(stanza))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(stanza))),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_96, .systemId = 6569239123849665679}));
|
||||
|
||||
TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create");
|
||||
@ -580,8 +580,8 @@ testRun(void)
|
||||
"2={\"db-id\":6569239123849665679,\"db-version\":\"9.6\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, archiveInfoFileName), harnessInfoChecksum(contentArchive)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, archiveInfoFileName), harnessInfoChecksum(contentArchive)),
|
||||
"put archive info to file");
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
@ -608,8 +608,8 @@ testRun(void)
|
||||
"\"db-version\":\"9.6\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, backupInfoFileName), harnessInfoChecksum(contentBackup)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, backupInfoFileName), harnessInfoChecksum(contentBackup)),
|
||||
"put backup info to file");
|
||||
|
||||
contentArchive = strNew
|
||||
@ -623,8 +623,8 @@ testRun(void)
|
||||
"1={\"db-id\":6569239123849665679,\"db-version\":\"9.5\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, archiveInfoFileName), harnessInfoChecksum(contentArchive)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, archiveInfoFileName), harnessInfoChecksum(contentArchive)),
|
||||
"put archive info to file");
|
||||
|
||||
TEST_RESULT_VOID(cmdStanzaUpgrade(), "stanza upgrade - archive.info file upgraded - version");
|
||||
@ -640,16 +640,16 @@ testRun(void)
|
||||
"2={\"db-id\":6569239123849665679,\"db-version\":\"9.6\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, fileName), harnessInfoChecksum(contentArchive)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, fileName), harnessInfoChecksum(contentArchive)),
|
||||
" put archive info to test file");
|
||||
TEST_RESULT_BOOL(
|
||||
(bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, archiveInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(archiveInfoFileName))))) &&
|
||||
storageGetP(storageNewReadP(storageTest, archiveInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(archiveInfoFileName))))) &&
|
||||
bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, archiveInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, fileName)))),
|
||||
storageGetP(storageNewReadP(storageTest, archiveInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, fileName)))),
|
||||
true, " test and stanza archive info files are equal");
|
||||
|
||||
// archive info up to date but backup info version is not
|
||||
@ -668,8 +668,8 @@ testRun(void)
|
||||
"\"db-version\":\"9.5\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, backupInfoFileName), harnessInfoChecksum(contentBackup)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, backupInfoFileName), harnessInfoChecksum(contentBackup)),
|
||||
"put backup info to file");
|
||||
|
||||
TEST_RESULT_VOID(cmdStanzaUpgrade(), "stanza upgrade - backup.info file upgraded - version");
|
||||
@ -689,17 +689,17 @@ testRun(void)
|
||||
"\"db-version\":\"9.6\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, fileName), harnessInfoChecksum(contentBackup)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, fileName), harnessInfoChecksum(contentBackup)),
|
||||
" put backup info to test file");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
(bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, backupInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(backupInfoFileName))))) &&
|
||||
storageGetP(storageNewReadP(storageTest, backupInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(backupInfoFileName))))) &&
|
||||
bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, backupInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, fileName)))),
|
||||
storageGetP(storageNewReadP(storageTest, backupInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, fileName)))),
|
||||
true, " test and stanza backup info files are equal");
|
||||
|
||||
// backup info up to date but archive info system-id is not
|
||||
@ -720,8 +720,8 @@ testRun(void)
|
||||
"\"db-version\":\"9.6\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, backupInfoFileName), harnessInfoChecksum(contentBackup)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, backupInfoFileName), harnessInfoChecksum(contentBackup)),
|
||||
"put backup info to file");
|
||||
|
||||
contentArchive = strNew
|
||||
@ -735,8 +735,8 @@ testRun(void)
|
||||
"1={\"db-id\":6569239123849665999,\"db-version\":\"9.6\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, archiveInfoFileName), harnessInfoChecksum(contentArchive)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, archiveInfoFileName), harnessInfoChecksum(contentArchive)),
|
||||
"put archive info to file");
|
||||
|
||||
TEST_RESULT_VOID(cmdStanzaUpgrade(), "stanza upgrade - archive.info file upgraded - system-id");
|
||||
@ -752,16 +752,16 @@ testRun(void)
|
||||
"2={\"db-id\":6569239123849665679,\"db-version\":\"9.6\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, fileName), harnessInfoChecksum(contentArchive)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, fileName), harnessInfoChecksum(contentArchive)),
|
||||
" put archive info to test file");
|
||||
TEST_RESULT_BOOL(
|
||||
(bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, archiveInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(archiveInfoFileName))))) &&
|
||||
storageGetP(storageNewReadP(storageTest, archiveInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(archiveInfoFileName))))) &&
|
||||
bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, archiveInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, fileName)))),
|
||||
storageGetP(storageNewReadP(storageTest, archiveInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, fileName)))),
|
||||
true, " test and stanza archive info files are equal");
|
||||
|
||||
// archive info up to date but backup info system-id is not
|
||||
@ -780,8 +780,8 @@ testRun(void)
|
||||
"\"db-version\":\"9.6\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, backupInfoFileName), harnessInfoChecksum(contentBackup)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, backupInfoFileName), harnessInfoChecksum(contentBackup)),
|
||||
"put backup info to file");
|
||||
|
||||
TEST_RESULT_VOID(cmdStanzaUpgrade(), "stanza upgrade - backup.info file upgraded - system-id");
|
||||
@ -801,17 +801,17 @@ testRun(void)
|
||||
"\"db-version\":\"9.6\"}\n"
|
||||
);
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, fileName), harnessInfoChecksum(contentBackup)),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, fileName), harnessInfoChecksum(contentBackup)),
|
||||
" put backup info to test file");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
(bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, backupInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(backupInfoFileName))))) &&
|
||||
storageGetP(storageNewReadP(storageTest, backupInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, strNewFmt("%s" INFO_COPY_EXT, strPtr(backupInfoFileName))))) &&
|
||||
bufEq(
|
||||
storageGetNP(storageNewReadNP(storageTest, backupInfoFileName)),
|
||||
storageGetNP(storageNewReadNP(storageTest, fileName)))),
|
||||
storageGetP(storageNewReadP(storageTest, backupInfoFileName)),
|
||||
storageGetP(storageNewReadP(storageTest, fileName)))),
|
||||
true, " test and stanza backup info files are equal");
|
||||
}
|
||||
|
||||
@ -842,8 +842,8 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdStanzaCreate, argList);
|
||||
|
||||
// Create pg_control for stanza-create
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(stanzaOther))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(stanzaOther))),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_96, .systemId = 6569239123849665679}));
|
||||
|
||||
TEST_RESULT_VOID(cmdStanzaCreate(), "create a stanza that will not be deleted");
|
||||
@ -870,13 +870,13 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdStanzaCreate, argList);
|
||||
|
||||
// Create pg_control for stanza-create
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(stanza))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(stanza))),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_96, .systemId = 6569239123849665679}));
|
||||
|
||||
TEST_RESULT_VOID(cmdStanzaCreate(), "create a stanza to be deleted");
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageTest, strNewFmt("repo/archive/%s/archive.info", strPtr(stanza))), true, " stanza created");
|
||||
storageExistsP(storageTest, strNewFmt("repo/archive/%s/archive.info", strPtr(stanza))), true, " stanza created");
|
||||
|
||||
argList = strLstDup(argListCmd);
|
||||
strLstAdd(argList, strNewFmt("--stanza=%s", strPtr(stanza)));
|
||||
@ -889,127 +889,127 @@ testRun(void)
|
||||
|
||||
// Create the stop file
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), BUFSTRDEF("")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), BUFSTRDEF("")),
|
||||
"create stop file");
|
||||
|
||||
TEST_RESULT_VOID(cmdStanzaDelete(), "stanza delete");
|
||||
TEST_RESULT_BOOL(
|
||||
storagePathExistsNP(storageTest, strNewFmt("repo/archive/%s", strPtr(stanza))), false, " stanza deleted");
|
||||
storagePathExistsP(storageTest, strNewFmt("repo/archive/%s", strPtr(stanza))), false, " stanza deleted");
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageLocal(), lockStopFileName(cfgOptionStr(cfgOptStanza))), false, " stop file removed");
|
||||
storageExistsP(storageLocal(), lockStopFileName(cfgOptionStr(cfgOptStanza))), false, " stop file removed");
|
||||
|
||||
// Create stanza with directories only
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(
|
||||
storagePathCreateNP(storageTest, strNewFmt("repo/archive/%s/9.6-1/1234567812345678", strPtr(stanza))),
|
||||
storagePathCreateP(storageTest, strNewFmt("repo/archive/%s/9.6-1/1234567812345678", strPtr(stanza))),
|
||||
"create archive sub directory");
|
||||
TEST_RESULT_VOID(
|
||||
storagePathCreateNP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F", strPtr(stanza))),
|
||||
storagePathCreateP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F", strPtr(stanza))),
|
||||
"create backup sub directory");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), BUFSTRDEF("")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), BUFSTRDEF("")),
|
||||
"create stop file");
|
||||
TEST_RESULT_VOID(cmdStanzaDelete(), " stanza delete - sub directories only");
|
||||
TEST_RESULT_BOOL(
|
||||
storagePathExistsNP(storageTest, strNewFmt("repo/archive/%s", strPtr(stanza))), false, " stanza archive deleted");
|
||||
storagePathExistsP(storageTest, strNewFmt("repo/archive/%s", strPtr(stanza))), false, " stanza archive deleted");
|
||||
TEST_RESULT_BOOL(
|
||||
storagePathExistsNP(storageTest, strNewFmt("repo/backup/%s", strPtr(stanza))), false, " stanza backup deleted");
|
||||
storagePathExistsP(storageTest, strNewFmt("repo/backup/%s", strPtr(stanza))), false, " stanza backup deleted");
|
||||
|
||||
// Create stanza archive only
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("repo/archive/%s/archive.info", strPtr(stanza))), BUFSTRDEF("")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("repo/archive/%s/archive.info", strPtr(stanza))), BUFSTRDEF("")),
|
||||
"create archive.info");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), BUFSTRDEF("")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), BUFSTRDEF("")),
|
||||
"create stop file");
|
||||
TEST_RESULT_VOID(cmdStanzaDelete(), " stanza delete - archive only");
|
||||
TEST_RESULT_BOOL(
|
||||
storagePathExistsNP(storageTest, strNewFmt("repo/archive/%s", strPtr(stanza))), false, " stanza deleted");
|
||||
storagePathExistsP(storageTest, strNewFmt("repo/archive/%s", strPtr(stanza))), false, " stanza deleted");
|
||||
|
||||
// Create stanza backup only
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("repo/backup/%s/backup.info", strPtr(stanza))), BUFSTRDEF("")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("repo/backup/%s/backup.info", strPtr(stanza))), BUFSTRDEF("")),
|
||||
"create backup.info");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), BUFSTRDEF("")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), BUFSTRDEF("")),
|
||||
"create stop file");
|
||||
TEST_RESULT_VOID(cmdStanzaDelete(), " stanza delete - backup only");
|
||||
TEST_RESULT_BOOL(
|
||||
storagePathExistsNP(storageTest, strNewFmt("repo/backup/%s", strPtr(stanza))), false, " stanza deleted");
|
||||
storagePathExistsP(storageTest, strNewFmt("repo/backup/%s", strPtr(stanza))), false, " stanza deleted");
|
||||
|
||||
// Create a backup file that matches the regex for a backup directory
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F", strPtr(stanza))), BUFSTRDEF("")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F", strPtr(stanza))), BUFSTRDEF("")),
|
||||
"backup file that looks like a directory");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), BUFSTRDEF("")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), BUFSTRDEF("")),
|
||||
"create stop file");
|
||||
TEST_ERROR_FMT(
|
||||
cmdStanzaDelete(), FileRemoveError,
|
||||
"unable to remove '%s/repo/backup/%s/20190708-154306F/backup.manifest': [20] Not a directory", testPath(),
|
||||
strPtr(stanza));
|
||||
TEST_RESULT_VOID(
|
||||
storageRemoveNP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F", strPtr(stanza))), "remove backup directory");
|
||||
storageRemoveP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F", strPtr(stanza))), "remove backup directory");
|
||||
|
||||
// Create backup manifest
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F/backup.manifest", strPtr(stanza))),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F/backup.manifest", strPtr(stanza))),
|
||||
BUFSTRDEF("")), "create backup.manifest only");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F_20190716-191726I/backup.manifest.copy",
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F_20190716-191726I/backup.manifest.copy",
|
||||
strPtr(stanza))), BUFSTRDEF("")), "create backup.manifest.copy only");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F_20190716-191800D/backup.manifest",
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F_20190716-191800D/backup.manifest",
|
||||
strPtr(stanza))), BUFSTRDEF("")), "create backup.manifest");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F_20190716-191800D/backup.manifest.copy",
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F_20190716-191800D/backup.manifest.copy",
|
||||
strPtr(stanza))), BUFSTRDEF("")), "create backup.manifest.copy");
|
||||
TEST_RESULT_VOID(manifestDelete(storageRepoWrite()), "delete manifests");
|
||||
TEST_RESULT_BOOL(
|
||||
(storageExistsNP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F/backup.manifest", strPtr(stanza))) &&
|
||||
storageExistsNP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F_20190716-191726I/backup.manifest.copy",
|
||||
(storageExistsP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F/backup.manifest", strPtr(stanza))) &&
|
||||
storageExistsP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F_20190716-191726I/backup.manifest.copy",
|
||||
strPtr(stanza))) &&
|
||||
storageExistsNP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F_20190716-191800D/backup.manifest",
|
||||
storageExistsP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F_20190716-191800D/backup.manifest",
|
||||
strPtr(stanza))) &&
|
||||
storageExistsNP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F_20190716-191800D/backup.manifest.copy",
|
||||
storageExistsP(storageTest, strNewFmt("repo/backup/%s/20190708-154306F_20190716-191800D/backup.manifest.copy",
|
||||
strPtr(stanza)))), false, " all manifests deleted");
|
||||
|
||||
// Create only stanza paths
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(cmdStanzaDelete(), "stanza delete");
|
||||
TEST_RESULT_VOID(
|
||||
storagePathCreateNP(storageTest, strNewFmt("repo/archive/%s", strPtr(stanza))), "create empty stanza archive path");
|
||||
storagePathCreateP(storageTest, strNewFmt("repo/archive/%s", strPtr(stanza))), "create empty stanza archive path");
|
||||
TEST_RESULT_VOID(
|
||||
storagePathCreateNP(storageTest, strNewFmt("repo/backup/%s", strPtr(stanza))), "create empty stanza backup path");
|
||||
storagePathCreateP(storageTest, strNewFmt("repo/backup/%s", strPtr(stanza))), "create empty stanza backup path");
|
||||
TEST_RESULT_VOID(cmdStanzaDelete(), " stanza delete - empty directories");
|
||||
|
||||
// Create postmaster.pid
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, strNewFmt("repo/backup/%s/backup.info", strPtr(stanza))), BUFSTRDEF("")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, strNewFmt("repo/backup/%s/backup.info", strPtr(stanza))), BUFSTRDEF("")),
|
||||
"create backup.info");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), BUFSTRDEF("")),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageLocalWrite(), lockStopFileName(cfgOptionStr(cfgOptStanza))), BUFSTRDEF("")),
|
||||
"create stop file");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageTest, strNewFmt("%s/" PG_FILE_POSTMASTERPID, strPtr(stanza))), BUFSTRDEF("")),
|
||||
storagePutP(storageNewWriteP(storageTest, strNewFmt("%s/" PG_FILE_POSTMASTERPID, strPtr(stanza))), BUFSTRDEF("")),
|
||||
"create postmaster file");
|
||||
TEST_ERROR_FMT(
|
||||
cmdStanzaDelete(), PostmasterRunningError, PG_FILE_POSTMASTERPID " exists - looks like the postmaster is running. "
|
||||
@ -1020,12 +1020,12 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdStanzaDelete, argList);
|
||||
TEST_RESULT_VOID(cmdStanzaDelete(), "stanza delete --force");
|
||||
TEST_RESULT_BOOL(
|
||||
storagePathExistsNP(storageTest, strNewFmt("repo/backup/%s", strPtr(stanza))), false, " stanza deleted");
|
||||
storagePathExistsP(storageTest, strNewFmt("repo/backup/%s", strPtr(stanza))), false, " stanza deleted");
|
||||
|
||||
// Ensure other stanza never deleted
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageTest, strNewFmt("repo/archive/%s/archive.info", strPtr(stanzaOther))), true,
|
||||
storageExistsP(storageTest, strNewFmt("repo/archive/%s/archive.info", strPtr(stanzaOther))), true,
|
||||
"otherstanza exists");
|
||||
}
|
||||
|
||||
|
@ -62,9 +62,9 @@ testRun(void)
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
cfgOptionSet(cfgOptSort, cfgSourceParam, VARSTRDEF("asc"));
|
||||
|
||||
storagePathCreateNP(storageTest, strNew("repo/bbb"));
|
||||
storagePutNP(storageNewWriteNP(storageTest, strNew("repo/aaa")), BUFSTRDEF("TESTDATA"));
|
||||
storagePutNP(storageNewWriteNP(storageTest, strNew("repo/bbb/ccc")), BUFSTRDEF("TESTDATA2"));
|
||||
storagePathCreateP(storageTest, strNew("repo/bbb"));
|
||||
storagePutP(storageNewWriteP(storageTest, strNew("repo/aaa")), BUFSTRDEF("TESTDATA"));
|
||||
storagePutP(storageNewWriteP(storageTest, strNew("repo/bbb/ccc")), BUFSTRDEF("TESTDATA2"));
|
||||
|
||||
ASSERT(system(strPtr(strNewFmt("ln -s ../bbb %s/repo/link", testPath()))) == 0);
|
||||
ASSERT(system(strPtr(strNewFmt("mkfifo %s/repo/pipe", testPath()))) == 0);
|
||||
@ -141,7 +141,7 @@ testRun(void)
|
||||
// Restore normal stdout
|
||||
dup2(stdoutSave, STDOUT_FILENO);
|
||||
|
||||
TEST_RESULT_STR(strPtr(strNewBuf(storageGetNP(storageNewReadNP(storageTest, stdoutFile)))), "ccc\n", " check text");
|
||||
TEST_RESULT_STR(strPtr(strNewBuf(storageGetP(storageNewReadP(storageTest, stdoutFile)))), "ccc\n", " check text");
|
||||
|
||||
// Too many paths
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -27,7 +27,7 @@ testRun(void)
|
||||
TEST_RESULT_INT(system(strPtr(strNewFmt("touch %s", strPtr(archiveLock)))), 0, "touch lock file");
|
||||
TEST_ASSIGN(lockHandleTest, lockAcquireFile(archiveLock, 0, true), "get lock");
|
||||
TEST_RESULT_BOOL(lockHandleTest != -1, true, "lock succeeds");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, archiveLock), true, "lock file was created");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, archiveLock), true, "lock file was created");
|
||||
TEST_ERROR(lockAcquireFile(archiveLock, 0, true), LockAcquireError,
|
||||
strPtr(
|
||||
strNewFmt(
|
||||
@ -44,17 +44,17 @@ testRun(void)
|
||||
TEST_RESULT_VOID(lockReleaseFile(lockHandleTest, archiveLock), "release lock");
|
||||
|
||||
TEST_RESULT_VOID(lockReleaseFile(lockHandleTest, archiveLock), "release lock");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, archiveLock), false, "lock file was removed");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, archiveLock), false, "lock file was removed");
|
||||
TEST_RESULT_VOID(lockReleaseFile(lockHandleTest, archiveLock), "release lock again without error");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
String *subPathLock = strNewFmt("%s/sub1/sub2/db-backup" LOCK_FILE_EXT, testPath());
|
||||
|
||||
TEST_ASSIGN(lockHandleTest, lockAcquireFile(subPathLock, 0, true), "get lock in subpath");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, subPathLock), true, "lock file was created");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, subPathLock), true, "lock file was created");
|
||||
TEST_RESULT_BOOL(lockHandleTest != -1, true, "lock succeeds");
|
||||
TEST_RESULT_VOID(lockReleaseFile(lockHandleTest, subPathLock), "release lock");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, subPathLock), false, "lock file was removed");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, subPathLock), false, "lock file was removed");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
String *dirLock = strNewFmt("%s/dir" LOCK_FILE_EXT, testPath());
|
||||
@ -139,7 +139,7 @@ testRun(void)
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_BOOL(lockAcquire(lockPath, stanza, lockTypeArchive, 0, true), true, "archive lock");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, archiveLockFile), true, "archive lock file was created");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, archiveLockFile), true, "archive lock file was created");
|
||||
TEST_ERROR(lockAcquire(lockPath, stanza, lockTypeArchive, 0, false), AssertError, "lock is already held by this process");
|
||||
TEST_RESULT_VOID(lockRelease(true), "release archive lock");
|
||||
|
||||
@ -160,8 +160,8 @@ testRun(void)
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_BOOL(lockAcquire(lockPath, stanza, lockTypeAll, 0, true), true, "all lock");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, archiveLockFile), true, "archive lock file was created");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, backupLockFile), true, "backup lock file was created");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, archiveLockFile), true, "archive lock file was created");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, backupLockFile), true, "backup lock file was created");
|
||||
TEST_ERROR(
|
||||
lockAcquire(lockPath, stanza, lockTypeAll, 0, false), AssertError,
|
||||
"assertion 'failOnNoLock || lockType != lockTypeAll' failed");
|
||||
@ -174,14 +174,14 @@ testRun(void)
|
||||
String *lockFileTest = strDup(lockFile[lockTypeBackup]);
|
||||
|
||||
TEST_RESULT_VOID(lockClear(true), "clear backup lock");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, backupLockFile), true, "backup lock file still exists");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, backupLockFile), true, "backup lock file still exists");
|
||||
lockReleaseFile(lockHandleTest, lockFileTest);
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_BOOL(lockAcquire(lockPath, stanza, lockTypeAll, 0, true), true, "all lock");
|
||||
TEST_RESULT_VOID(lockClear(true), "clear all lock");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, archiveLockFile), true, "archive lock file still exists");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, backupLockFile), true, "backup lock file still exists");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, archiveLockFile), true, "archive lock file still exists");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, backupLockFile), true, "backup lock file still exists");
|
||||
}
|
||||
|
||||
FUNCTION_HARNESS_RESULT_VOID();
|
||||
|
@ -66,14 +66,14 @@ testRun(void)
|
||||
strLstAdd(argList, strNew(TEST_COMMAND_BACKUP));
|
||||
|
||||
storagePut(
|
||||
storageNewWriteNP(storageLocalWrite(), configFile),
|
||||
storageNewWriteP(storageLocalWrite(), configFile),
|
||||
BUFSTRDEF(
|
||||
"[global]\n"
|
||||
"compress-level=3\n"
|
||||
"spool-path=/path/to/spool\n"));
|
||||
|
||||
storagePut(
|
||||
storageNewWriteNP(storageLocalWrite(), strNewFmt("%s/global-backup.conf", strPtr(configIncludePath))),
|
||||
storageNewWriteP(storageLocalWrite(), strNewFmt("%s/global-backup.conf", strPtr(configIncludePath))),
|
||||
BUFSTRDEF(
|
||||
"[global:backup]\n"
|
||||
"repo1-hardlink=y\n"
|
||||
@ -87,14 +87,14 @@ testRun(void)
|
||||
"buffer-size=65536\n"));
|
||||
|
||||
storagePut(
|
||||
storageNewWriteNP(storageLocalWrite(), strNewFmt("%s/db-backup.conf", strPtr(configIncludePath))),
|
||||
storageNewWriteP(storageLocalWrite(), strNewFmt("%s/db-backup.conf", strPtr(configIncludePath))),
|
||||
BUFSTRDEF(
|
||||
"[db:backup]\n"
|
||||
"compress=n\n"
|
||||
"recovery-option=a=b\n"));
|
||||
|
||||
storagePut(
|
||||
storageNewWriteNP(storageLocalWrite(), strNewFmt("%s/stanza.db.conf", strPtr(configIncludePath))),
|
||||
storageNewWriteP(storageLocalWrite(), strNewFmt("%s/stanza.db.conf", strPtr(configIncludePath))),
|
||||
BUFSTRDEF(
|
||||
"[db]\n"
|
||||
"pg1-host=db\n"
|
||||
@ -246,7 +246,7 @@ testRun(void)
|
||||
|
||||
mkdir(strPtr(strPath(oldConfigDefault)), 0750);
|
||||
storagePut(
|
||||
storageNewWriteNP(storageLocalWrite(), oldConfigDefault),
|
||||
storageNewWriteP(storageLocalWrite(), oldConfigDefault),
|
||||
BUFSTRDEF(
|
||||
"[global:backup]\n"
|
||||
"buffer-size=65536\n"));
|
||||
@ -1009,8 +1009,8 @@ testRun(void)
|
||||
strLstAdd(argList, strNewFmt("--config=%s", strPtr(configFile)));
|
||||
strLstAdd(argList, strNew(TEST_COMMAND_BACKUP));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageLocalWrite(), configFile),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageLocalWrite(), configFile),
|
||||
BUFSTRDEF(
|
||||
"[global]\n"
|
||||
"compress=bogus\n"));
|
||||
@ -1026,8 +1026,8 @@ testRun(void)
|
||||
strLstAdd(argList, strNewFmt("--config=%s", strPtr(configFile)));
|
||||
strLstAdd(argList, strNew(TEST_COMMAND_BACKUP));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageLocalWrite(), configFile),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageLocalWrite(), configFile),
|
||||
BUFSTRDEF(
|
||||
"[global]\n"
|
||||
"compress=\n"));
|
||||
@ -1043,8 +1043,8 @@ testRun(void)
|
||||
strLstAdd(argList, strNewFmt("--config=%s", strPtr(configFile)));
|
||||
strLstAdd(argList, strNew(TEST_COMMAND_BACKUP));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageLocalWrite(), configFile),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageLocalWrite(), configFile),
|
||||
BUFSTRDEF(
|
||||
"[db]\n"
|
||||
"pg1-path=/path/to/db\n"
|
||||
@ -1061,8 +1061,8 @@ testRun(void)
|
||||
strLstAdd(argList, strNewFmt("--config=%s", strPtr(configFile)));
|
||||
strLstAdd(argList, strNew(TEST_COMMAND_BACKUP));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageLocalWrite(), configFile),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageLocalWrite(), configFile),
|
||||
BUFSTRDEF(
|
||||
"[db]\n"
|
||||
"pg1-path=/path/to/db\n"
|
||||
@ -1073,8 +1073,8 @@ testRun(void)
|
||||
"option 'pg1-path' cannot be set multiple times");
|
||||
|
||||
// Also test with a boolean option since this gets converted immediately and will blow up if it is multi
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageLocalWrite(), configFile),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageLocalWrite(), configFile),
|
||||
BUFSTRDEF(
|
||||
"[db]\n"
|
||||
"start-fast=y\n"
|
||||
@ -1201,8 +1201,8 @@ testRun(void)
|
||||
setenv("PGBACKREST_START_FAST", "n", true);
|
||||
setenv("PGBACKREST_PG1_SOCKET_PATH", "/path/to/socket", true);
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageLocalWrite(), configFile),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageLocalWrite(), configFile),
|
||||
BUFSTRDEF(
|
||||
"[global]\n"
|
||||
"compress-level=3\n"
|
||||
@ -1287,8 +1287,8 @@ testRun(void)
|
||||
strLstAdd(argList, strNew("--buffer-size=2MB"));
|
||||
strLstAdd(argList, strNew("archive-push"));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageLocalWrite(), configFile),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageLocalWrite(), configFile),
|
||||
BUFSTRDEF(
|
||||
"[global]\n"
|
||||
"spool-path=/path/to/spool\n"));
|
||||
@ -1361,8 +1361,8 @@ testRun(void)
|
||||
strLstAdd(argList, strNew("--stanza=db"));
|
||||
strLstAdd(argList, strNew(TEST_COMMAND_RESTORE));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageLocalWrite(), configFile),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageLocalWrite(), configFile),
|
||||
BUFSTRDEF(
|
||||
"[global:restore]\n"
|
||||
"recovery-option=f=g\n"
|
||||
@ -1407,8 +1407,8 @@ testRun(void)
|
||||
strLstAdd(argList, strNewFmt("--config=%s", strPtr(configFile)));
|
||||
strLstAdd(argList, strNew("info"));
|
||||
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageLocalWrite(), configFile),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageLocalWrite(), configFile),
|
||||
BUFSTRDEF(
|
||||
"[global]\n"
|
||||
"repo1-path=/path/to/repo\n"
|
||||
|
@ -492,7 +492,7 @@ testRun(void)
|
||||
);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageRepoWrite(),
|
||||
storagePutP(storageNewWriteP(storageRepoWrite(),
|
||||
strNew(STORAGE_REPO_BACKUP "/20190923-164324F/" BACKUP_MANIFEST_FILE)), manifestContent),
|
||||
"write main manifest for pgId=2 - valid backup to add");
|
||||
|
||||
@ -531,7 +531,7 @@ testRun(void)
|
||||
);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageRepoWrite(),
|
||||
storagePutP(storageNewWriteP(storageRepoWrite(),
|
||||
strNew(STORAGE_REPO_BACKUP "/20190818-084444F/" BACKUP_MANIFEST_FILE INFO_COPY_EXT)),
|
||||
manifestContent), "write manifest copy for pgId=1");
|
||||
|
||||
@ -574,7 +574,7 @@ testRun(void)
|
||||
);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageRepoWrite(),
|
||||
storagePutP(storageNewWriteP(storageRepoWrite(),
|
||||
strNew(STORAGE_REPO_BACKUP "/20190818-084555F/" BACKUP_MANIFEST_FILE)),
|
||||
manifestContent), "write manifest - invalid backup pgId mismatch");
|
||||
|
||||
@ -617,7 +617,7 @@ testRun(void)
|
||||
);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageRepoWrite(),
|
||||
storagePutP(storageNewWriteP(storageRepoWrite(),
|
||||
strNew(STORAGE_REPO_BACKUP "/20190818-084666F/" BACKUP_MANIFEST_FILE)),
|
||||
manifestContent), "write manifest - invalid backup system-id mismatch");
|
||||
|
||||
@ -660,12 +660,12 @@ testRun(void)
|
||||
);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageRepoWrite(),
|
||||
storagePutP(storageNewWriteP(storageRepoWrite(),
|
||||
strNew(STORAGE_REPO_BACKUP "/20190818-084777F/" BACKUP_MANIFEST_FILE)),
|
||||
manifestContent), "write manifest - invalid backup version mismatch");
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePathCreateNP(storageRepoWrite(), strNew(STORAGE_REPO_BACKUP "/20190818-084502F")),
|
||||
storagePathCreateP(storageRepoWrite(), strNew(STORAGE_REPO_BACKUP "/20190818-084502F")),
|
||||
"create backup on disk that is in current but no manifest");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
@ -702,9 +702,9 @@ testRun(void)
|
||||
"P00 WARN: backup '20190818-084502F_20190820-084502I' missing manifest removed from backup.info");
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storageCopyNP(
|
||||
storageNewReadNP(storageRepo(), strNew(STORAGE_REPO_BACKUP "/20190818-084444F/" BACKUP_MANIFEST_FILE INFO_COPY_EXT)),
|
||||
storageNewWriteNP(storageRepoWrite(), strNew(STORAGE_REPO_BACKUP "/20190818-084444F/" BACKUP_MANIFEST_FILE))),
|
||||
storageCopyP(
|
||||
storageNewReadP(storageRepo(), strNew(STORAGE_REPO_BACKUP "/20190818-084444F/" BACKUP_MANIFEST_FILE INFO_COPY_EXT)),
|
||||
storageNewWriteP(storageRepoWrite(), strNew(STORAGE_REPO_BACKUP "/20190818-084444F/" BACKUP_MANIFEST_FILE))),
|
||||
"write manifest from copy-only for pgId=1");
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
|
@ -414,7 +414,7 @@ testRun(void)
|
||||
);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageTest, strNew(BACKUP_MANIFEST_FILE INFO_COPY_EXT)), content), "write copy");
|
||||
storagePutP(storageNewWriteP(storageTest, strNew(BACKUP_MANIFEST_FILE INFO_COPY_EXT)), content), "write copy");
|
||||
TEST_ASSIGN(manifest, manifestLoadFile(storageTest, STRDEF(BACKUP_MANIFEST_FILE), cipherTypeNone, NULL), "load copy");
|
||||
TEST_RESULT_UINT(manifestData(manifest)->pgSystemId, 1000000000000000094, " check file loaded");
|
||||
TEST_RESULT_STR(strPtr(manifestData(manifest)->backrestVersion), PROJECT_VERSION, " check backrest version");
|
||||
@ -422,7 +422,7 @@ testRun(void)
|
||||
storageRemoveP(storageTest, strNew(BACKUP_MANIFEST_FILE INFO_COPY_EXT), .errorOnMissing = true);
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageTest, BACKUP_MANIFEST_FILE_STR), content), "write main");
|
||||
storagePutP(storageNewWriteP(storageTest, BACKUP_MANIFEST_FILE_STR), content), "write main");
|
||||
TEST_ASSIGN(manifest, manifestLoadFile(storageTest, STRDEF(BACKUP_MANIFEST_FILE), cipherTypeNone, NULL), "load main");
|
||||
TEST_RESULT_UINT(manifestData(manifest)->pgSystemId, 1000000000000000094, " check file loaded");
|
||||
}
|
||||
|
@ -67,8 +67,8 @@ testRun(void)
|
||||
TEST_ERROR(pgControlTestToBuffer((PgControl){.version = 0}), AssertError, "invalid PostgreSQL version 0");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, controlFile),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, controlFile),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_11, .systemId = 0xFACEFACE, .walSegmentSize = 1024 * 1024}));
|
||||
|
||||
PgControl info = {0};
|
||||
@ -77,23 +77,23 @@ testRun(void)
|
||||
TEST_RESULT_INT(info.version, PG_VERSION_11, " check version");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, controlFile),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, controlFile),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_93, .walSegmentSize = 1024 * 1024}));
|
||||
|
||||
TEST_ERROR(
|
||||
pgControlFromFile(storageTest), FormatError, "wal segment size is 1048576 but must be 16777216 for PostgreSQL <= 10");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, controlFile),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, controlFile),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_95, .pageSize = 32 * 1024}));
|
||||
|
||||
TEST_ERROR(pgControlFromFile(storageTest), FormatError, "page size is 32768 but must be 8192");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(
|
||||
storageNewWriteNP(storageTest, controlFile),
|
||||
storagePutP(
|
||||
storageNewWriteP(storageTest, controlFile),
|
||||
pgControlTestToBuffer((PgControl){.version = PG_VERSION_83, .systemId = 0xEFEFEFEFEF}));
|
||||
|
||||
TEST_ASSIGN(info, pgControlFromFile(storageTest), "get control info v83");
|
||||
@ -143,7 +143,7 @@ testRun(void)
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
memset(bufPtr(result), 0, bufSize(result));
|
||||
pgWalTestToBuffer((PgWal){.version = PG_VERSION_11, .systemId = 0xECAFECAF}, result);
|
||||
storagePutNP(storageNewWriteNP(storageTest, walFile), result);
|
||||
storagePutP(storageNewWriteP(storageTest, walFile), result);
|
||||
|
||||
PgWal info = {0};
|
||||
TEST_ASSIGN(info, pgWalFromFile(walFile), "get wal info v11");
|
||||
@ -153,7 +153,7 @@ testRun(void)
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
memset(bufPtr(result), 0, bufSize(result));
|
||||
pgWalTestToBuffer((PgWal){.version = PG_VERSION_83, .systemId = 0xEAEAEAEA}, result);
|
||||
storagePutNP(storageNewWriteNP(storageTest, walFile), result);
|
||||
storagePutP(storageNewWriteP(storageTest, walFile), result);
|
||||
|
||||
TEST_ASSIGN(info, pgWalFromFile(walFile), "get wal info v8.3");
|
||||
TEST_RESULT_INT(info.systemId, 0xEAEAEAEA, " check system id");
|
||||
|
@ -187,7 +187,7 @@ testRun(void)
|
||||
// *****************************************************************************************************************************
|
||||
if (testBegin("protocolRemoteParam()"))
|
||||
{
|
||||
storagePutNP(storageNewWriteNP(storageTest, strNew("pgbackrest.conf")), bufNew(0));
|
||||
storagePutP(storageNewWriteP(storageTest, strNew("pgbackrest.conf")), bufNew(0));
|
||||
|
||||
StringList *argList = strLstNew();
|
||||
strLstAddZ(argList, "pgbackrest");
|
||||
@ -859,7 +859,7 @@ testRun(void)
|
||||
// Start protocol with local encryption settings
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePut(
|
||||
storageNewWriteNP(storageTest, strNew("pgbackrest.conf")),
|
||||
storageNewWriteP(storageTest, strNew("pgbackrest.conf")),
|
||||
BUFSTRDEF(
|
||||
"[global]\n"
|
||||
"repo1-cipher-type=aes-256-cbc\n"
|
||||
@ -888,7 +888,7 @@ testRun(void)
|
||||
// Start protocol with remote encryption settings
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePut(
|
||||
storageNewWriteNP(storageTest, strNew("pgbackrest.conf")),
|
||||
storageNewWriteP(storageTest, strNew("pgbackrest.conf")),
|
||||
BUFSTRDEF(
|
||||
"[global]\n"
|
||||
"repo1-cipher-type=aes-256-cbc\n"
|
||||
|
@ -36,7 +36,7 @@ testRun(void)
|
||||
|
||||
// Test the path sync function -- pass a bogus path to ensure that this is a noop
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(storagePathSyncNP(storage, strNew(BOGUS_STR)), "path sync is a noop");
|
||||
TEST_RESULT_VOID(storagePathSyncP(storage, strNew(BOGUS_STR)), "path sync is a noop");
|
||||
}
|
||||
|
||||
FUNCTION_HARNESS_RESULT_VOID();
|
||||
|
@ -96,27 +96,27 @@ testRun(void)
|
||||
TEST_CREATE_NOPERM();
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, strNew("missing")), false, "file does not exist");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, strNew("missing")), false, "file does not exist");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, strNew("missing"), .timeout = 100), false, "file does not exist");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_BOOL(storagePathExistsNP(storageTest, strNew("missing")), false, "path does not exist");
|
||||
TEST_RESULT_BOOL(storagePathExistsNP(storageTest, NULL), true, "test path exists");
|
||||
TEST_RESULT_BOOL(storagePathExistsP(storageTest, strNew("missing")), false, "path does not exist");
|
||||
TEST_RESULT_BOOL(storagePathExistsP(storageTest, NULL), true, "test path exists");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_ERROR_FMT(
|
||||
storageExistsNP(storageTest, fileNoPerm), FileOpenError,
|
||||
storageExistsP(storageTest, fileNoPerm), FileOpenError,
|
||||
"unable to stat '%s': [13] Permission denied", strPtr(fileNoPerm));
|
||||
TEST_ERROR_FMT(
|
||||
storagePathExistsNP(storageTest, fileNoPerm), PathOpenError,
|
||||
storagePathExistsP(storageTest, fileNoPerm), PathOpenError,
|
||||
"unable to stat '%s': [13] Permission denied", strPtr(fileNoPerm));
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
String *fileExists = strNewFmt("%s/exists", testPath());
|
||||
TEST_RESULT_INT(system(strPtr(strNewFmt("touch %s", strPtr(fileExists)))), 0, "create exists file");
|
||||
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, fileExists), true, "file exists");
|
||||
TEST_RESULT_BOOL(storagePathExistsNP(storageTest, fileExists), false, "not a path");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, fileExists), true, "file exists");
|
||||
TEST_RESULT_BOOL(storagePathExistsP(storageTest, fileExists), false, "not a path");
|
||||
TEST_RESULT_INT(system(strPtr(strNewFmt("sudo rm %s", strPtr(fileExists)))), 0, "remove exists file");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -146,14 +146,14 @@ testRun(void)
|
||||
TEST_CREATE_NOPERM();
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
storageInfoNP(storageTest, fileNoPerm), FileOpenError, STORAGE_ERROR_INFO ": [13] Permission denied",
|
||||
storageInfoP(storageTest, fileNoPerm), FileOpenError, STORAGE_ERROR_INFO ": [13] Permission denied",
|
||||
strPtr(fileNoPerm));
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
String *fileName = strNewFmt("%s/fileinfo", testPath());
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
storageInfoNP(storageTest, fileName), FileOpenError, STORAGE_ERROR_INFO_MISSING ": [2] No such file or directory",
|
||||
storageInfoP(storageTest, fileName), FileOpenError, STORAGE_ERROR_INFO_MISSING ": [2] No such file or directory",
|
||||
strPtr(fileName));
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -165,7 +165,7 @@ testRun(void)
|
||||
struct utimbuf utimeTest = {.actime = 1000000000, .modtime = 1555160000};
|
||||
THROW_ON_SYS_ERROR_FMT(utime(testPath(), &utimeTest) != 0, FileWriteError, "unable to set time for '%s'", testPath());
|
||||
|
||||
TEST_ASSIGN(info, storageInfoNP(storageTest, strNew(testPath())), "get path info");
|
||||
TEST_ASSIGN(info, storageInfoP(storageTest, strNew(testPath())), "get path info");
|
||||
TEST_RESULT_PTR(info.name, NULL, " name is not set");
|
||||
TEST_RESULT_BOOL(info.exists, true, " check exists");
|
||||
TEST_RESULT_INT(info.type, storageTypePath, " check type");
|
||||
@ -180,14 +180,14 @@ testRun(void)
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
const Buffer *buffer = BUFSTRDEF("TESTFILE");
|
||||
TEST_RESULT_VOID(storagePutNP(storageNewWriteNP(storageTest, fileName), buffer), "put test file");
|
||||
TEST_RESULT_VOID(storagePutP(storageNewWriteP(storageTest, fileName), buffer), "put test file");
|
||||
|
||||
utimeTest.modtime = 1555155555;
|
||||
THROW_ON_SYS_ERROR_FMT(utime(strPtr(fileName), &utimeTest) != 0, FileWriteError, "unable to set time for '%s'", testPath());
|
||||
|
||||
TEST_RESULT_INT(system(strPtr(strNewFmt("sudo chown 99999:99999 %s", strPtr(fileName)))), 0, "set invalid user/group");
|
||||
|
||||
TEST_ASSIGN(info, storageInfoNP(storageTest, fileName), "get file info");
|
||||
TEST_ASSIGN(info, storageInfoP(storageTest, fileName), "get file info");
|
||||
TEST_RESULT_PTR(info.name, NULL, " name is not set");
|
||||
TEST_RESULT_BOOL(info.exists, true, " check exists");
|
||||
TEST_RESULT_INT(info.type, storageTypeFile, " check type");
|
||||
@ -204,7 +204,7 @@ testRun(void)
|
||||
String *linkName = strNewFmt("%s/testlink", testPath());
|
||||
TEST_RESULT_INT(system(strPtr(strNewFmt("ln -s /tmp %s", strPtr(linkName)))), 0, "create link");
|
||||
|
||||
TEST_ASSIGN(info, storageInfoNP(storageTest, linkName), "get link info");
|
||||
TEST_ASSIGN(info, storageInfoP(storageTest, linkName), "get link info");
|
||||
TEST_RESULT_PTR(info.name, NULL, " name is not set");
|
||||
TEST_RESULT_BOOL(info.exists, true, " check exists");
|
||||
TEST_RESULT_INT(info.type, storageTypeLink, " check type");
|
||||
@ -230,7 +230,7 @@ testRun(void)
|
||||
String *pipeName = strNewFmt("%s/testpipe", testPath());
|
||||
TEST_RESULT_INT(system(strPtr(strNewFmt("mkfifo -m 666 %s", strPtr(pipeName)))), 0, "create pipe");
|
||||
|
||||
TEST_ASSIGN(info, storageInfoNP(storageTest, pipeName), "get info from pipe (special file)");
|
||||
TEST_ASSIGN(info, storageInfoP(storageTest, pipeName), "get info from pipe (special file)");
|
||||
TEST_RESULT_PTR(info.name, NULL, " name is not set");
|
||||
TEST_RESULT_BOOL(info.exists, true, " check exists");
|
||||
TEST_RESULT_INT(info.type, storageTypeSpecial, " check type");
|
||||
@ -254,15 +254,15 @@ testRun(void)
|
||||
PathMissingError, STORAGE_ERROR_LIST_INFO_MISSING, strPtr(strNewFmt("%s/BOGUS", testPath())));
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
storageInfoListNP(storageTest, strNew(BOGUS_STR), (StorageInfoListCallback)1, NULL), false, "ignore missing dir");
|
||||
storageInfoListP(storageTest, strNew(BOGUS_STR), (StorageInfoListCallback)1, NULL), false, "ignore missing dir");
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
storageInfoListNP(storageTest, pathNoPerm, (StorageInfoListCallback)1, NULL), PathOpenError,
|
||||
storageInfoListP(storageTest, pathNoPerm, (StorageInfoListCallback)1, NULL), PathOpenError,
|
||||
STORAGE_ERROR_LIST_INFO ": [13] Permission denied", strPtr(pathNoPerm));
|
||||
|
||||
// Should still error even when ignore missing
|
||||
TEST_ERROR_FMT(
|
||||
storageInfoListNP(storageTest, pathNoPerm, (StorageInfoListCallback)1, NULL), PathOpenError,
|
||||
storageInfoListP(storageTest, pathNoPerm, (StorageInfoListCallback)1, NULL), PathOpenError,
|
||||
STORAGE_ERROR_LIST_INFO ": [13] Permission denied", strPtr(pathNoPerm));
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -294,7 +294,7 @@ testRun(void)
|
||||
storagePathCreateP(storageTest, strNew("pg/.include"), .mode = 0755);
|
||||
ASSERT(system(strPtr(strNewFmt("sudo chown 77777:77777 %s/pg/.include", testPath()))) == 0);
|
||||
|
||||
storagePutNP(storageNewWriteP(storageTest, strNew("pg/file"), .modeFile = 0660), BUFSTRDEF("TESTDATA"));
|
||||
storagePutP(storageNewWriteP(storageTest, strNew("pg/file"), .modeFile = 0660), BUFSTRDEF("TESTDATA"));
|
||||
|
||||
ASSERT(system(strPtr(strNewFmt("ln -s ../file %s/pg/link", testPath()))) == 0);
|
||||
ASSERT(system(strPtr(strNewFmt("mkfifo -m 777 %s/pg/pipe", testPath()))) == 0);
|
||||
@ -325,7 +325,7 @@ testRun(void)
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
ASSERT(system(strPtr(strNewFmt("sudo rmdir %s/pg/.include", testPath()))) == 0);
|
||||
storagePathCreateP(storageTest, strNew("pg/path"), .mode = 0700);
|
||||
storagePutNP(storageNewWriteP(storageTest, strNew("pg/path/file"), .modeFile = 0600), BUFSTRDEF("TESTDATA"));
|
||||
storagePutP(storageNewWriteP(storageTest, strNew("pg/path/file"), .modeFile = 0600), BUFSTRDEF("TESTDATA"));
|
||||
|
||||
callbackData.content = strNew("");
|
||||
|
||||
@ -368,27 +368,27 @@ testRun(void)
|
||||
strPtr(strNewFmt("%s/BOGUS", testPath())));
|
||||
|
||||
TEST_RESULT_PTR(storageListP(storageTest, strNew(BOGUS_STR), .nullOnMissing = true), NULL, "null for missing dir");
|
||||
TEST_RESULT_UINT(strLstSize(storageListNP(storageTest, strNew(BOGUS_STR))), 0, "empty list for missing dir");
|
||||
TEST_RESULT_UINT(strLstSize(storageListP(storageTest, strNew(BOGUS_STR))), 0, "empty list for missing dir");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_ERROR_FMT(
|
||||
storageListNP(storageTest, pathNoPerm), PathOpenError,
|
||||
storageListP(storageTest, pathNoPerm), PathOpenError,
|
||||
STORAGE_ERROR_LIST ": [13] Permission denied", strPtr(pathNoPerm));
|
||||
|
||||
// Should still error even when ignore missing
|
||||
TEST_ERROR_FMT(
|
||||
storageListNP(storageTest, pathNoPerm), PathOpenError,
|
||||
storageListP(storageTest, pathNoPerm), PathOpenError,
|
||||
STORAGE_ERROR_LIST ": [13] Permission denied", strPtr(pathNoPerm));
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageTest, strNew(".aaa.txt")), BUFSTRDEF("aaa")), "write aaa.text");
|
||||
storagePutP(storageNewWriteP(storageTest, strNew(".aaa.txt")), BUFSTRDEF("aaa")), "write aaa.text");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(storageTest, NULL), sortOrderAsc), ", ")), ".aaa.txt, noperm",
|
||||
strPtr(strLstJoin(strLstSort(storageListP(storageTest, NULL), sortOrderAsc), ", ")), ".aaa.txt, noperm",
|
||||
"dir list");
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageTest, strNew("bbb.txt")), BUFSTRDEF("bbb")), "write bbb.text");
|
||||
storagePutP(storageNewWriteP(storageTest, strNew("bbb.txt")), BUFSTRDEF("bbb")), "write bbb.text");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(storageListP(storageTest, NULL, .expression = strNew("^bbb")), ", ")), "bbb.txt", "dir list");
|
||||
}
|
||||
@ -399,24 +399,24 @@ testRun(void)
|
||||
String *sourceFile = strNewFmt("%s/source.txt", testPath());
|
||||
String *destinationFile = strNewFmt("%s/destination.txt", testPath());
|
||||
|
||||
StorageRead *source = storageNewReadNP(storageTest, sourceFile);
|
||||
StorageWrite *destination = storageNewWriteNP(storageTest, destinationFile);
|
||||
StorageRead *source = storageNewReadP(storageTest, sourceFile);
|
||||
StorageWrite *destination = storageNewWriteP(storageTest, destinationFile);
|
||||
|
||||
TEST_ERROR_FMT(storageCopyNP(source, destination), FileMissingError, STORAGE_ERROR_READ_MISSING, strPtr(sourceFile));
|
||||
TEST_ERROR_FMT(storageCopyP(source, destination), FileMissingError, STORAGE_ERROR_READ_MISSING, strPtr(sourceFile));
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
source = storageNewReadP(storageTest, sourceFile, .ignoreMissing = true);
|
||||
|
||||
TEST_RESULT_BOOL(storageCopyNP(source, destination), false, "copy and ignore missing file");
|
||||
TEST_RESULT_BOOL(storageCopyP(source, destination), false, "copy and ignore missing file");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
const Buffer *expectedBuffer = BUFSTRDEF("TESTFILE\n");
|
||||
TEST_RESULT_VOID(storagePutNP(storageNewWriteNP(storageTest, sourceFile), expectedBuffer), "write source file");
|
||||
TEST_RESULT_VOID(storagePutP(storageNewWriteP(storageTest, sourceFile), expectedBuffer), "write source file");
|
||||
|
||||
source = storageNewReadNP(storageTest, sourceFile);
|
||||
source = storageNewReadP(storageTest, sourceFile);
|
||||
|
||||
TEST_RESULT_BOOL(storageCopyNP(source, destination), true, "copy file");
|
||||
TEST_RESULT_BOOL(bufEq(expectedBuffer, storageGetNP(storageNewReadNP(storageTest, destinationFile))), true, "check file");
|
||||
TEST_RESULT_BOOL(storageCopyP(source, destination), true, "copy file");
|
||||
TEST_RESULT_BOOL(bufEq(expectedBuffer, storageGetP(storageNewReadP(storageTest, destinationFile))), true, "check file");
|
||||
|
||||
storageRemoveP(storageTest, sourceFile, .errorOnMissing = true);
|
||||
storageRemoveP(storageTest, destinationFile, .errorOnMissing = true);
|
||||
@ -430,79 +430,79 @@ testRun(void)
|
||||
String *sourceFile = strNewFmt("%s/source.txt", testPath());
|
||||
String *destinationFile = strNewFmt("%s/sub/destination.txt", testPath());
|
||||
|
||||
StorageRead *source = storageNewReadNP(storageTest, sourceFile);
|
||||
StorageWrite *destination = storageNewWriteNP(storageTest, destinationFile);
|
||||
StorageRead *source = storageNewReadP(storageTest, sourceFile);
|
||||
StorageWrite *destination = storageNewWriteP(storageTest, destinationFile);
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
storageMoveNP(storageTest, source, destination), FileMissingError,
|
||||
storageMoveP(storageTest, source, destination), FileMissingError,
|
||||
"unable to move missing file '%s': [2] No such file or directory", strPtr(sourceFile));
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
source = storageNewReadNP(storageTest, fileNoPerm);
|
||||
source = storageNewReadP(storageTest, fileNoPerm);
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
storageMoveNP(storageTest, source, destination), FileMoveError,
|
||||
storageMoveP(storageTest, source, destination), FileMoveError,
|
||||
"unable to move '%s' to '%s': [13] Permission denied", strPtr(fileNoPerm), strPtr(destinationFile));
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
const Buffer *buffer = BUFSTRDEF("TESTFILE");
|
||||
storagePutNP(storageNewWriteNP(storageTest, sourceFile), buffer);
|
||||
storagePutP(storageNewWriteP(storageTest, sourceFile), buffer);
|
||||
|
||||
source = storageNewReadNP(storageTest, sourceFile);
|
||||
source = storageNewReadP(storageTest, sourceFile);
|
||||
destination = storageNewWriteP(storageTest, destinationFile, .noCreatePath = true);
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
storageMoveNP(storageTest, source, destination), PathMissingError,
|
||||
storageMoveP(storageTest, source, destination), PathMissingError,
|
||||
"unable to move '%s' to missing path '%s': [2] No such file or directory", strPtr(sourceFile),
|
||||
strPtr(strPath(destinationFile)));
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
destination = storageNewWriteNP(storageTest, destinationFile);
|
||||
destination = storageNewWriteP(storageTest, destinationFile);
|
||||
|
||||
TEST_RESULT_VOID(storageMoveNP(storageTest, source, destination), "move file to subpath");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, sourceFile), false, "check source file not exists");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, destinationFile), true, "check destination file exists");
|
||||
TEST_RESULT_VOID(storageMoveP(storageTest, source, destination), "move file to subpath");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, sourceFile), false, "check source file not exists");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, destinationFile), true, "check destination file exists");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storageTest, destinationFile)))), "TESTFILE",
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(storageTest, destinationFile)))), "TESTFILE",
|
||||
"check destination contents");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
sourceFile = destinationFile;
|
||||
source = storageNewReadNP(storageTest, sourceFile);
|
||||
source = storageNewReadP(storageTest, sourceFile);
|
||||
destinationFile = strNewFmt("%s/sub/destination2.txt", testPath());
|
||||
destination = storageNewWriteNP(storageTest, destinationFile);
|
||||
destination = storageNewWriteP(storageTest, destinationFile);
|
||||
|
||||
TEST_RESULT_VOID(storageMoveNP(storageTest, source, destination), "move file to same path");
|
||||
TEST_RESULT_VOID(storageMoveP(storageTest, source, destination), "move file to same path");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
sourceFile = destinationFile;
|
||||
source = storageNewReadNP(storageTest, sourceFile);
|
||||
source = storageNewReadP(storageTest, sourceFile);
|
||||
destinationFile = strNewFmt("%s/source.txt", testPath());
|
||||
destination = storageNewWriteP(storageTest, destinationFile, .noSyncPath = true);
|
||||
|
||||
TEST_RESULT_VOID(storageMoveNP(storageTest, source, destination), "move file to parent path (no sync)");
|
||||
TEST_RESULT_VOID(storageMoveP(storageTest, source, destination), "move file to parent path (no sync)");
|
||||
|
||||
// Move across filesystems
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
sourceFile = destinationFile;
|
||||
source = storageNewReadNP(storageTest, sourceFile);
|
||||
source = storageNewReadP(storageTest, sourceFile);
|
||||
destinationFile = strNewFmt("/tmp/destination.txt");
|
||||
destination = storageNewWriteNP(storageTmp, destinationFile);
|
||||
destination = storageNewWriteP(storageTmp, destinationFile);
|
||||
|
||||
TEST_RESULT_VOID(storageMoveNP(storageTest, source, destination), "move file to another filesystem");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, sourceFile), false, "check source file not exists");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTmp, destinationFile), true, "check destination file exists");
|
||||
TEST_RESULT_VOID(storageMoveP(storageTest, source, destination), "move file to another filesystem");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, sourceFile), false, "check source file not exists");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTmp, destinationFile), true, "check destination file exists");
|
||||
|
||||
// Move across filesystems without syncing the paths
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
sourceFile = destinationFile;
|
||||
source = storageNewReadNP(storageTmp, sourceFile);
|
||||
source = storageNewReadP(storageTmp, sourceFile);
|
||||
destinationFile = strNewFmt("%s/source.txt", testPath());
|
||||
destination = storageNewWriteP(storageTest, destinationFile, .noSyncPath = true);
|
||||
|
||||
TEST_RESULT_VOID(storageMoveNP(storageTest, source, destination), "move file to another filesystem without path sync");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTmp, sourceFile), false, "check source file not exists");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, destinationFile), true, "check destination file exists");
|
||||
TEST_RESULT_VOID(storageMoveP(storageTest, source, destination), "move file to another filesystem without path sync");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTmp, sourceFile), false, "check source file not exists");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, destinationFile), true, "check destination file exists");
|
||||
|
||||
storageRemoveP(storageTest, destinationFile, .errorOnMissing = true);
|
||||
}
|
||||
@ -513,65 +513,65 @@ testRun(void)
|
||||
Storage *storageTest = NULL;
|
||||
|
||||
TEST_ASSIGN(storageTest, storagePosixNew(strNew("/"), 0640, 0750, false, NULL), "new storage /");
|
||||
TEST_RESULT_STR(strPtr(storagePathNP(storageTest, NULL)), "/", " root dir");
|
||||
TEST_RESULT_STR(strPtr(storagePathNP(storageTest, strNew("/"))), "/", " same as root dir");
|
||||
TEST_RESULT_STR(strPtr(storagePathNP(storageTest, strNew("subdir"))), "/subdir", " simple subdir");
|
||||
TEST_RESULT_STR(strPtr(storagePathP(storageTest, NULL)), "/", " root dir");
|
||||
TEST_RESULT_STR(strPtr(storagePathP(storageTest, strNew("/"))), "/", " same as root dir");
|
||||
TEST_RESULT_STR(strPtr(storagePathP(storageTest, strNew("subdir"))), "/subdir", " simple subdir");
|
||||
|
||||
TEST_ERROR(
|
||||
storagePathNP(storageTest, strNew("<TEST>")), AssertError, "expression '<TEST>' not valid without callback function");
|
||||
storagePathP(storageTest, strNew("<TEST>")), AssertError, "expression '<TEST>' not valid without callback function");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_ASSIGN(
|
||||
storageTest, storagePosixNew(strNew("/path/to"), 0640, 0750, false, storageTestPathExpression),
|
||||
"new storage /path/to with expression");
|
||||
TEST_RESULT_STR(strPtr(storagePathNP(storageTest, NULL)), "/path/to", " root dir");
|
||||
TEST_RESULT_STR(strPtr(storagePathNP(storageTest, strNew("/path/to"))), "/path/to", " absolute root dir");
|
||||
TEST_RESULT_STR(strPtr(storagePathNP(storageTest, strNew("is/a/subdir"))), "/path/to/is/a/subdir", " subdir");
|
||||
TEST_RESULT_STR(strPtr(storagePathP(storageTest, NULL)), "/path/to", " root dir");
|
||||
TEST_RESULT_STR(strPtr(storagePathP(storageTest, strNew("/path/to"))), "/path/to", " absolute root dir");
|
||||
TEST_RESULT_STR(strPtr(storagePathP(storageTest, strNew("is/a/subdir"))), "/path/to/is/a/subdir", " subdir");
|
||||
|
||||
TEST_ERROR(
|
||||
storagePathNP(storageTest, strNew("/bogus")), AssertError, "absolute path '/bogus' is not in base path '/path/to'");
|
||||
storagePathP(storageTest, strNew("/bogus")), AssertError, "absolute path '/bogus' is not in base path '/path/to'");
|
||||
TEST_ERROR(
|
||||
storagePathNP(storageTest, strNew("/path/toot")), AssertError,
|
||||
storagePathP(storageTest, strNew("/path/toot")), AssertError,
|
||||
"absolute path '/path/toot' is not in base path '/path/to'");
|
||||
|
||||
// Path enforcement disabled
|
||||
storagePathEnforceSet(storageTest, false);
|
||||
TEST_RESULT_STR(strPtr(storagePathNP(storageTest, strNew("/bogus"))), "/bogus", "path enforce disabled");
|
||||
TEST_RESULT_STR(strPtr(storagePathP(storageTest, strNew("/bogus"))), "/bogus", "path enforce disabled");
|
||||
storagePathEnforceSet(storageTest, true);
|
||||
|
||||
TEST_ERROR(storagePathNP(storageTest, strNew("<TEST")), AssertError, "end > not found in path expression '<TEST'");
|
||||
TEST_ERROR(storagePathP(storageTest, strNew("<TEST")), AssertError, "end > not found in path expression '<TEST'");
|
||||
TEST_ERROR(
|
||||
storagePathNP(storageTest, strNew("<TEST>" BOGUS_STR)), AssertError,
|
||||
storagePathP(storageTest, strNew("<TEST>" BOGUS_STR)), AssertError,
|
||||
"'/' should separate expression and path '<TEST>BOGUS'");
|
||||
|
||||
TEST_RESULT_STR(strPtr(storagePathNP(storageTest, strNew("<TEST>"))), "/path/to/test", " expression");
|
||||
TEST_ERROR(strPtr(storagePathNP(storageTest, strNew("<TEST>/"))), AssertError, "path '<TEST>/' should not end in '/'");
|
||||
TEST_RESULT_STR(strPtr(storagePathP(storageTest, strNew("<TEST>"))), "/path/to/test", " expression");
|
||||
TEST_ERROR(strPtr(storagePathP(storageTest, strNew("<TEST>/"))), AssertError, "path '<TEST>/' should not end in '/'");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(storagePathNP(storageTest, strNew("<TEST>/something"))), "/path/to/test/something", " expression with path");
|
||||
strPtr(storagePathP(storageTest, strNew("<TEST>/something"))), "/path/to/test/something", " expression with path");
|
||||
|
||||
TEST_ERROR(storagePathNP(storageTest, strNew("<NULL>")), AssertError, "evaluated path '<NULL>' cannot be null");
|
||||
TEST_ERROR(storagePathP(storageTest, strNew("<NULL>")), AssertError, "evaluated path '<NULL>' cannot be null");
|
||||
|
||||
TEST_ERROR(storagePathNP(storageTest, strNew("<WHATEVS>")), AssertError, "invalid expression '<WHATEVS>'");
|
||||
TEST_ERROR(storagePathP(storageTest, strNew("<WHATEVS>")), AssertError, "invalid expression '<WHATEVS>'");
|
||||
}
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
if (testBegin("storagePathCreate()"))
|
||||
{
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageTest, strNew("sub1")), "create sub1");
|
||||
TEST_RESULT_INT(storageInfoNP(storageTest, strNew("sub1")).mode, 0750, "check sub1 dir mode");
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageTest, strNew("sub1")), "create sub1 again");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageTest, strNew("sub1")), "create sub1");
|
||||
TEST_RESULT_INT(storageInfoP(storageTest, strNew("sub1")).mode, 0750, "check sub1 dir mode");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageTest, strNew("sub1")), "create sub1 again");
|
||||
TEST_ERROR_FMT(
|
||||
storagePathCreateP(storageTest, strNew("sub1"), .errorOnExists = true), PathCreateError,
|
||||
"unable to create path '%s/sub1': [17] File exists", testPath());
|
||||
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageTest, strNew("sub2"), .mode = 0777), "create sub2 with custom mode");
|
||||
TEST_RESULT_INT(storageInfoNP(storageTest, strNew("sub2")).mode, 0777, "check sub2 dir mode");
|
||||
TEST_RESULT_INT(storageInfoP(storageTest, strNew("sub2")).mode, 0777, "check sub2 dir mode");
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
storagePathCreateP(storageTest, strNew("sub3/sub4"), .noParentCreate = true), PathCreateError,
|
||||
"unable to create path '%s/sub3/sub4': [2] No such file or directory", testPath());
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageTest, strNew("sub3/sub4")), "create sub3/sub4");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageTest, strNew("sub3/sub4")), "create sub3/sub4");
|
||||
|
||||
TEST_RESULT_INT(system(strPtr(strNewFmt("rm -rf %s/sub*", testPath()))), 0, "remove sub paths");
|
||||
}
|
||||
@ -593,7 +593,7 @@ testRun(void)
|
||||
TEST_RESULT_INT(system(strPtr(strNewFmt("sudo mkdir -p -m 700 %s", strPtr(pathRemove2)))), 0, "create noperm paths");
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
storagePathRemoveNP(storageTest, pathRemove2), PathRemoveError, STORAGE_ERROR_PATH_REMOVE ": [13] Permission denied",
|
||||
storagePathRemoveP(storageTest, pathRemove2), PathRemoveError, STORAGE_ERROR_PATH_REMOVE ": [13] Permission denied",
|
||||
strPtr(pathRemove2));
|
||||
TEST_ERROR_FMT(
|
||||
storagePathRemoveP(storageTest, pathRemove2, .recurse = true), PathOpenError,
|
||||
@ -625,7 +625,7 @@ testRun(void)
|
||||
TEST_RESULT_VOID(
|
||||
storagePathRemoveP(storageTest, pathRemove1, .recurse = true), "remove path");
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageTest, pathRemove1), false, "path is removed");
|
||||
storageExistsP(storageTest, pathRemove1), false, "path is removed");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_INT(system(strPtr(strNewFmt("mkdir -p %s", strPtr(pathRemove2)))), 0, "create subpaths");
|
||||
@ -633,7 +633,7 @@ testRun(void)
|
||||
TEST_RESULT_VOID(
|
||||
storagePathRemoveP(storageTest, pathRemove1, .recurse = true), "remove path");
|
||||
TEST_RESULT_BOOL(
|
||||
storageExistsNP(storageTest, pathRemove1), false, "path is removed");
|
||||
storageExistsP(storageTest, pathRemove1), false, "path is removed");
|
||||
}
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
@ -642,24 +642,24 @@ testRun(void)
|
||||
TEST_CREATE_NOPERM();
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
storagePathSyncNP(storageTest, fileNoPerm), PathOpenError, STORAGE_ERROR_PATH_SYNC_OPEN ": [13] Permission denied",
|
||||
storagePathSyncP(storageTest, fileNoPerm), PathOpenError, STORAGE_ERROR_PATH_SYNC_OPEN ": [13] Permission denied",
|
||||
strPtr(fileNoPerm));
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
String *pathName = strNewFmt("%s/testpath", testPath());
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
storagePathSyncNP(storageTest, pathName), PathMissingError, STORAGE_ERROR_PATH_SYNC_MISSING, strPtr(pathName));
|
||||
storagePathSyncP(storageTest, pathName), PathMissingError, STORAGE_ERROR_PATH_SYNC_MISSING, strPtr(pathName));
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_ERROR_FMT(
|
||||
storagePathSyncNP(
|
||||
storagePathSyncP(
|
||||
storagePosixNew(strNew("/"), STORAGE_MODE_FILE_DEFAULT, STORAGE_MODE_PATH_DEFAULT, true, NULL), strNew("/proc")),
|
||||
PathSyncError, STORAGE_ERROR_PATH_SYNC ": [22] Invalid argument", "/proc");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageTest, pathName), "create path to sync");
|
||||
TEST_RESULT_VOID(storagePathSyncNP(storageTest, pathName), "sync path");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageTest, pathName), "create path to sync");
|
||||
TEST_RESULT_VOID(storagePathSyncP(storageTest, pathName), "sync path");
|
||||
}
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
@ -668,7 +668,7 @@ testRun(void)
|
||||
StorageRead *file = NULL;
|
||||
String *fileName = strNewFmt("%s/readtest.txt", testPath());
|
||||
|
||||
TEST_ASSIGN(file, storageNewReadNP(storageTest, fileName), "new read file (defaults)");
|
||||
TEST_ASSIGN(file, storageNewReadP(storageTest, fileName), "new read file (defaults)");
|
||||
TEST_ERROR_FMT(ioReadOpen(storageReadIo(file)), FileMissingError, STORAGE_ERROR_READ_MISSING, strPtr(fileName));
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -702,9 +702,9 @@ testRun(void)
|
||||
TEST_RESULT_INT(
|
||||
ioWriteHandle(storageWriteIo(file)), ((StorageWritePosix *)file->driver)->handle, "check write handle");
|
||||
TEST_RESULT_VOID(ioWriteClose(storageWriteIo(file)), " close file");
|
||||
TEST_RESULT_INT(storageInfoNP(storageTest, strPath(fileName)).mode, 0750, " check path mode");
|
||||
TEST_RESULT_INT(storageInfoNP(storageTest, fileName).mode, 0640, " check file mode");
|
||||
TEST_RESULT_INT(storageInfoNP(storageTest, fileName).timeModified, 1, " check file modified times");
|
||||
TEST_RESULT_INT(storageInfoP(storageTest, strPath(fileName)).mode, 0750, " check path mode");
|
||||
TEST_RESULT_INT(storageInfoP(storageTest, fileName).mode, 0640, " check file mode");
|
||||
TEST_RESULT_INT(storageInfoP(storageTest, fileName).timeModified, 1, " check file modified times");
|
||||
|
||||
// Test that a premature free (from error or otherwise) does not rename the file
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -718,9 +718,9 @@ testRun(void)
|
||||
TEST_RESULT_VOID(ioWriteFlush(storageWriteIo(file)), "flush data");
|
||||
TEST_RESULT_VOID(ioWriteFree(storageWriteIo(file)), " free file");
|
||||
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, fileName), false, "destination file does not exist");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, fileNameTmp), true, "destination tmp file exists");
|
||||
TEST_RESULT_INT(storageInfoNP(storageTest, fileNameTmp).size, 8, " check temp file size");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, fileName), false, "destination file does not exist");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, fileNameTmp), true, "destination tmp file exists");
|
||||
TEST_RESULT_INT(storageInfoP(storageTest, fileNameTmp).size, 8, " check temp file size");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
fileName = strNewFmt("%s/sub2/testfile", testPath());
|
||||
@ -731,8 +731,8 @@ testRun(void)
|
||||
TEST_RESULT_VOID(ioWriteOpen(storageWriteIo(file)), " open file");
|
||||
TEST_RESULT_VOID(ioWriteClose(storageWriteIo(file)), " close file");
|
||||
TEST_RESULT_VOID(storageWritePosixClose(storageWriteDriver(file)), " close file again");
|
||||
TEST_RESULT_INT(storageInfoNP(storageTest, strPath(fileName)).mode, 0700, " check path mode");
|
||||
TEST_RESULT_INT(storageInfoNP(storageTest, fileName).mode, 0600, " check file mode");
|
||||
TEST_RESULT_INT(storageInfoP(storageTest, strPath(fileName)).mode, 0700, " check path mode");
|
||||
TEST_RESULT_INT(storageInfoP(storageTest, fileName).mode, 0600, " check file mode");
|
||||
}
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
@ -741,48 +741,48 @@ testRun(void)
|
||||
Storage *storageTest = storagePosixNew(strNew("/"), 0640, 0750, true, NULL);
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
storageGetNP(storageNewReadNP(storageTest, strNew(testPath()))), FileReadError,
|
||||
storageGetP(storageNewReadP(storageTest, strNew(testPath()))), FileReadError,
|
||||
"unable to read '%s': [21] Is a directory", testPath());
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
String *emptyFile = strNewFmt("%s/test.empty", testPath());
|
||||
TEST_RESULT_VOID(storagePutNP(storageNewWriteNP(storageTest, emptyFile), NULL), "put empty file");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, emptyFile), true, "check empty file exists");
|
||||
TEST_RESULT_VOID(storagePutP(storageNewWriteP(storageTest, emptyFile), NULL), "put empty file");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, emptyFile), true, "check empty file exists");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
const Buffer *buffer = BUFSTRDEF("TESTFILE\n");
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageTest, strNewFmt("%s/test.txt", testPath())), buffer), "put test file");
|
||||
storagePutP(storageNewWriteP(storageTest, strNewFmt("%s/test.txt", testPath())), buffer), "put test file");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_PTR(
|
||||
storageGetNP(storageNewReadP(storageTest, strNewFmt("%s/%s", testPath(), BOGUS_STR), .ignoreMissing = true)),
|
||||
storageGetP(storageNewReadP(storageTest, strNewFmt("%s/%s", testPath(), BOGUS_STR), .ignoreMissing = true)),
|
||||
NULL, "get missing file");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_ASSIGN(buffer, storageGetNP(storageNewReadNP(storageTest, strNewFmt("%s/test.empty", testPath()))), "get empty");
|
||||
TEST_ASSIGN(buffer, storageGetP(storageNewReadP(storageTest, strNewFmt("%s/test.empty", testPath()))), "get empty");
|
||||
TEST_RESULT_INT(bufSize(buffer), 0, "size is 0");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_ASSIGN(buffer, storageGetNP(storageNewReadNP(storageTest, strNewFmt("%s/test.txt", testPath()))), "get text");
|
||||
TEST_ASSIGN(buffer, storageGetP(storageNewReadP(storageTest, strNewFmt("%s/test.txt", testPath()))), "get text");
|
||||
TEST_RESULT_INT(bufSize(buffer), 9, "check size");
|
||||
TEST_RESULT_BOOL(memcmp(bufPtr(buffer), "TESTFILE\n", bufSize(buffer)) == 0, true, "check content");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_ASSIGN(
|
||||
buffer, storageGetP(storageNewReadNP(storageTest, strNewFmt("%s/test.txt", testPath())), .exactSize = 4), "get exact");
|
||||
buffer, storageGetP(storageNewReadP(storageTest, strNewFmt("%s/test.txt", testPath())), .exactSize = 4), "get exact");
|
||||
TEST_RESULT_INT(bufSize(buffer), 4, "check size");
|
||||
TEST_RESULT_BOOL(memcmp(bufPtr(buffer), "TEST", bufSize(buffer)) == 0, true, "check content");
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
storageGetP(storageNewReadNP(storageTest, strNewFmt("%s/test.txt", testPath())), .exactSize = 64), FileReadError,
|
||||
storageGetP(storageNewReadP(storageTest, strNewFmt("%s/test.txt", testPath())), .exactSize = 64), FileReadError,
|
||||
"unable to read 64 byte(s) from '%s/test.txt'", testPath());
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
ioBufferSizeSet(2);
|
||||
|
||||
TEST_ASSIGN(buffer, storageGetNP(storageNewReadNP(storageTest, strNewFmt("%s/test.txt", testPath()))), "get text");
|
||||
TEST_ASSIGN(buffer, storageGetP(storageNewReadP(storageTest, strNewFmt("%s/test.txt", testPath()))), "get text");
|
||||
TEST_RESULT_INT(bufSize(buffer), 9, "check size");
|
||||
TEST_RESULT_BOOL(memcmp(bufPtr(buffer), "TESTFILE\n", bufSize(buffer)) == 0, true, "check content");
|
||||
}
|
||||
@ -793,7 +793,7 @@ testRun(void)
|
||||
TEST_CREATE_NOPERM();
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(storageRemoveNP(storageTest, strNew("missing")), "remove missing file");
|
||||
TEST_RESULT_VOID(storageRemoveP(storageTest, strNew("missing")), "remove missing file");
|
||||
TEST_ERROR_FMT(
|
||||
storageRemoveP(storageTest, strNew("missing"), .errorOnMissing = true), FileRemoveError,
|
||||
"unable to remove '%s/missing': [2] No such file or directory", testPath());
|
||||
@ -802,11 +802,11 @@ testRun(void)
|
||||
String *fileExists = strNewFmt("%s/exists", testPath());
|
||||
TEST_RESULT_INT(system(strPtr(strNewFmt("touch %s", strPtr(fileExists)))), 0, "create exists file");
|
||||
|
||||
TEST_RESULT_VOID(storageRemoveNP(storageTest, fileExists), "remove exists file");
|
||||
TEST_RESULT_VOID(storageRemoveP(storageTest, fileExists), "remove exists file");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_ERROR_FMT(
|
||||
storageRemoveNP(storageTest, fileNoPerm), FileRemoveError,
|
||||
storageRemoveP(storageTest, fileNoPerm), FileRemoveError,
|
||||
"unable to remove '%s': [13] Permission denied", strPtr(fileNoPerm));
|
||||
}
|
||||
|
||||
@ -822,14 +822,14 @@ testRun(void)
|
||||
TEST_RESULT_STR(strPtr(storageReadName(file)), strPtr(fileNoPerm), " check name");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_ASSIGN(file, storageNewReadNP(storageTest, fileNoPerm), "new no perm read file");
|
||||
TEST_ASSIGN(file, storageNewReadP(storageTest, fileNoPerm), "new no perm read file");
|
||||
TEST_ERROR_FMT(
|
||||
ioReadOpen(storageReadIo(file)), FileOpenError, STORAGE_ERROR_READ_OPEN ": [13] Permission denied", strPtr(fileNoPerm));
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
String *fileName = strNewFmt("%s/test.file", testPath());
|
||||
|
||||
TEST_ASSIGN(file, storageNewReadNP(storageTest, fileName), "new missing read file");
|
||||
TEST_ASSIGN(file, storageNewReadP(storageTest, fileName), "new missing read file");
|
||||
TEST_ERROR_FMT(ioReadOpen(storageReadIo(file)), FileMissingError, STORAGE_ERROR_READ_MISSING, strPtr(fileName));
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -839,9 +839,9 @@ testRun(void)
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
Buffer *outBuffer = bufNew(2);
|
||||
const Buffer *expectedBuffer = BUFSTRDEF("TESTFILE\n");
|
||||
TEST_RESULT_VOID(storagePutNP(storageNewWriteNP(storageTest, fileName), expectedBuffer), "write test file");
|
||||
TEST_RESULT_VOID(storagePutP(storageNewWriteP(storageTest, fileName), expectedBuffer), "write test file");
|
||||
|
||||
TEST_ASSIGN(file, storageNewReadNP(storageTest, fileName), "new read file");
|
||||
TEST_ASSIGN(file, storageNewReadP(storageTest, fileName), "new read file");
|
||||
TEST_RESULT_BOOL(ioReadOpen(storageReadIo(file)), true, " open file");
|
||||
|
||||
// Close the file handle so operations will fail
|
||||
@ -859,7 +859,7 @@ testRun(void)
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
TEST_ASSIGN(file, storageReadMove(storageNewReadNP(storageTest, fileName), MEM_CONTEXT_OLD()), "new read file");
|
||||
TEST_ASSIGN(file, storageReadMove(storageNewReadP(storageTest, fileName), MEM_CONTEXT_OLD()), "new read file");
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
@ -900,7 +900,7 @@ testRun(void)
|
||||
|
||||
TEST_RESULT_VOID(ioReadClose(storageReadIo(file)), " close file");
|
||||
|
||||
TEST_RESULT_VOID(storageReadFree(storageNewReadNP(storageTest, fileName)), " free file");
|
||||
TEST_RESULT_VOID(storageReadFree(storageNewReadP(storageTest, fileName)), " free file");
|
||||
|
||||
TEST_RESULT_VOID(storageReadMove(NULL, memContextTop()), " move null file");
|
||||
}
|
||||
@ -944,7 +944,7 @@ testRun(void)
|
||||
ioBufferSizeSet(10);
|
||||
const Buffer *buffer = BUFSTRDEF("TESTFILE\n");
|
||||
|
||||
TEST_ASSIGN(file, storageNewWriteNP(storageTest, fileName), "new write file");
|
||||
TEST_ASSIGN(file, storageNewWriteP(storageTest, fileName), "new write file");
|
||||
TEST_RESULT_STR(strPtr(storageWriteName(file)), strPtr(fileName), " check file name");
|
||||
TEST_RESULT_VOID(ioWriteOpen(storageWriteIo(file)), " open file");
|
||||
|
||||
@ -970,7 +970,7 @@ testRun(void)
|
||||
((StorageWritePosix *)file->driver)->handle = -1;
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_ASSIGN(file, storageNewWriteNP(storageTest, fileName), "new write file");
|
||||
TEST_ASSIGN(file, storageNewWriteP(storageTest, fileName), "new write file");
|
||||
TEST_RESULT_STR(strPtr(storageWriteName(file)), strPtr(fileName), " check file name");
|
||||
TEST_RESULT_STR(strPtr(storageWriteType(file)), "posix", " check file type");
|
||||
TEST_RESULT_VOID(ioWriteOpen(storageWriteIo(file)), " open file");
|
||||
@ -989,7 +989,7 @@ testRun(void)
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
TEST_ASSIGN(file, storageWriteMove(storageNewWriteNP(storageTest, fileName), MEM_CONTEXT_OLD()), "new write file");
|
||||
TEST_ASSIGN(file, storageWriteMove(storageNewWriteP(storageTest, fileName), MEM_CONTEXT_OLD()), "new write file");
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
@ -998,13 +998,13 @@ testRun(void)
|
||||
TEST_RESULT_VOID(ioWrite(storageWriteIo(file), bufNew(0)), " write zero buffer to file");
|
||||
TEST_RESULT_VOID(ioWrite(storageWriteIo(file), buffer), " write to file");
|
||||
TEST_RESULT_VOID(ioWriteClose(storageWriteIo(file)), " close file");
|
||||
TEST_RESULT_VOID(storageWriteFree(storageNewWriteNP(storageTest, fileName)), " free file");
|
||||
TEST_RESULT_VOID(storageWriteFree(storageNewWriteP(storageTest, fileName)), " free file");
|
||||
TEST_RESULT_VOID(storageWriteMove(NULL, memContextTop()), " move null file");
|
||||
|
||||
Buffer *expectedBuffer = storageGetNP(storageNewReadNP(storageTest, fileName));
|
||||
Buffer *expectedBuffer = storageGetP(storageNewReadP(storageTest, fileName));
|
||||
TEST_RESULT_BOOL(bufEq(buffer, expectedBuffer), true, " check file contents");
|
||||
TEST_RESULT_INT(storageInfoNP(storageTest, strPath(fileName)).mode, 0750, " check path mode");
|
||||
TEST_RESULT_INT(storageInfoNP(storageTest, fileName).mode, 0640, " check file mode");
|
||||
TEST_RESULT_INT(storageInfoP(storageTest, strPath(fileName)).mode, 0750, " check path mode");
|
||||
TEST_RESULT_INT(storageInfoP(storageTest, fileName).mode, 0640, " check file mode");
|
||||
|
||||
storageRemoveP(storageTest, fileName, .errorOnMissing = true);
|
||||
|
||||
@ -1021,10 +1021,10 @@ testRun(void)
|
||||
TEST_RESULT_VOID(ioWrite(storageWriteIo(file), buffer), " write to file");
|
||||
TEST_RESULT_VOID(ioWriteClose(storageWriteIo(file)), " close file");
|
||||
|
||||
expectedBuffer = storageGetNP(storageNewReadNP(storageTest, fileName));
|
||||
expectedBuffer = storageGetP(storageNewReadP(storageTest, fileName));
|
||||
TEST_RESULT_BOOL(bufEq(buffer, expectedBuffer), true, " check file contents");
|
||||
TEST_RESULT_INT(storageInfoNP(storageTest, strPath(fileName)).mode, 0700, " check path mode");
|
||||
TEST_RESULT_INT(storageInfoNP(storageTest, fileName).mode, 0600, " check file mode");
|
||||
TEST_RESULT_INT(storageInfoP(storageTest, strPath(fileName)).mode, 0700, " check path mode");
|
||||
TEST_RESULT_INT(storageInfoP(storageTest, fileName).mode, 0600, " check file mode");
|
||||
|
||||
storageRemoveP(storageTest, fileName, .errorOnMissing = true);
|
||||
}
|
||||
@ -1039,9 +1039,9 @@ testRun(void)
|
||||
TEST_RESULT_PTR(storageHelper.storageLocal, storage, "local storage cached");
|
||||
TEST_RESULT_PTR(storageLocal(), storage, "get cached storage");
|
||||
|
||||
TEST_RESULT_STR(strPtr(storagePathNP(storage, NULL)), "/", "check base path");
|
||||
TEST_RESULT_STR(strPtr(storagePathP(storage, NULL)), "/", "check base path");
|
||||
|
||||
TEST_ERROR(storageNewWriteNP(storage, writeFile), AssertError, "assertion 'this->write' failed");
|
||||
TEST_ERROR(storageNewWriteP(storage, writeFile), AssertError, "assertion 'this->write' failed");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_PTR(storageHelper.storageLocalWrite, NULL, "local storage not cached");
|
||||
@ -1049,9 +1049,9 @@ testRun(void)
|
||||
TEST_RESULT_PTR(storageHelper.storageLocalWrite, storage, "local storage cached");
|
||||
TEST_RESULT_PTR(storageLocalWrite(), storage, "get cached storage");
|
||||
|
||||
TEST_RESULT_STR(strPtr(storagePathNP(storage, NULL)), "/", "check base path");
|
||||
TEST_RESULT_STR(strPtr(storagePathP(storage, NULL)), "/", "check base path");
|
||||
|
||||
TEST_RESULT_VOID(storageNewWriteNP(storage, writeFile), "writes are allowed");
|
||||
TEST_RESULT_VOID(storageNewWriteP(storage, writeFile), "writes are allowed");
|
||||
}
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
@ -1074,28 +1074,28 @@ testRun(void)
|
||||
TEST_RESULT_PTR(storageRepo(), storage, "get cached storage");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_ERROR(storagePathNP(storage, strNew("<BOGUS>/path")), AssertError, "invalid expression '<BOGUS>'");
|
||||
TEST_ERROR(storageNewWriteNP(storage, writeFile), AssertError, "assertion 'this->write' failed");
|
||||
TEST_ERROR(storagePathP(storage, strNew("<BOGUS>/path")), AssertError, "invalid expression '<BOGUS>'");
|
||||
TEST_ERROR(storageNewWriteP(storage, writeFile), AssertError, "assertion 'this->write' failed");
|
||||
|
||||
TEST_RESULT_STR(strPtr(storagePathNP(storage, NULL)), testPath(), "check base path");
|
||||
TEST_RESULT_STR(strPtr(storagePathP(storage, NULL)), testPath(), "check base path");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(storagePathNP(storage, STORAGE_REPO_ARCHIVE_STR)), strPtr(strNewFmt("%s/archive/db", testPath())),
|
||||
strPtr(storagePathP(storage, STORAGE_REPO_ARCHIVE_STR)), strPtr(strNewFmt("%s/archive/db", testPath())),
|
||||
"check archive path");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(storagePathNP(storage, strNew(STORAGE_REPO_ARCHIVE "/simple"))),
|
||||
strPtr(storagePathP(storage, strNew(STORAGE_REPO_ARCHIVE "/simple"))),
|
||||
strPtr(strNewFmt("%s/archive/db/simple", testPath())), "check simple path");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(storagePathNP(storage, strNew(STORAGE_REPO_ARCHIVE "/9.4-1/700000007000000070000000"))),
|
||||
strPtr(storagePathP(storage, strNew(STORAGE_REPO_ARCHIVE "/9.4-1/700000007000000070000000"))),
|
||||
strPtr(strNewFmt("%s/archive/db/9.4-1/7000000070000000/700000007000000070000000", testPath())), "check segment path");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(storagePathNP(storage, strNew(STORAGE_REPO_ARCHIVE "/9.4-1/00000008.history"))),
|
||||
strPtr(storagePathP(storage, strNew(STORAGE_REPO_ARCHIVE "/9.4-1/00000008.history"))),
|
||||
strPtr(strNewFmt("%s/archive/db/9.4-1/00000008.history", testPath())), "check history path");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(storagePathNP(storage, strNew(STORAGE_REPO_ARCHIVE "/9.4-1/000000010000014C0000001A.00000028.backup"))),
|
||||
strPtr(storagePathP(storage, strNew(STORAGE_REPO_ARCHIVE "/9.4-1/000000010000014C0000001A.00000028.backup"))),
|
||||
strPtr(strNewFmt("%s/archive/db/9.4-1/000000010000014C/000000010000014C0000001A.00000028.backup", testPath())),
|
||||
"check archive backup path");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(storagePathNP(storage, STORAGE_REPO_BACKUP_STR)), strPtr(strNewFmt("%s/backup/db", testPath())),
|
||||
strPtr(storagePathP(storage, STORAGE_REPO_BACKUP_STR)), strPtr(strNewFmt("%s/backup/db", testPath())),
|
||||
"check backup path");
|
||||
|
||||
// Change the stanza to NULL with the stanzaInit flag still true, make sure helper does not fail when stanza option not set
|
||||
@ -1108,16 +1108,16 @@ testRun(void)
|
||||
TEST_RESULT_PTR(storageHelper.stanza, NULL, "stanza NULL");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(storagePathNP(storage, STORAGE_REPO_ARCHIVE_STR)), strPtr(strNewFmt("%s/archive", testPath())),
|
||||
strPtr(storagePathP(storage, STORAGE_REPO_ARCHIVE_STR)), strPtr(strNewFmt("%s/archive", testPath())),
|
||||
"check archive path - NULL stanza");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(storagePathNP(storage, strNew(STORAGE_REPO_ARCHIVE "/simple"))),
|
||||
strPtr(storagePathP(storage, strNew(STORAGE_REPO_ARCHIVE "/simple"))),
|
||||
strPtr(strNewFmt("%s/archive/simple", testPath())), "check simple archive path - NULL stanza");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(storagePathNP(storage, STORAGE_REPO_BACKUP_STR)), strPtr(strNewFmt("%s/backup", testPath())),
|
||||
strPtr(storagePathP(storage, STORAGE_REPO_BACKUP_STR)), strPtr(strNewFmt("%s/backup", testPath())),
|
||||
"check backup path - NULL stanza");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(storagePathNP(storage, strNew(STORAGE_REPO_BACKUP "/simple"))),
|
||||
strPtr(storagePathP(storage, strNew(STORAGE_REPO_BACKUP "/simple"))),
|
||||
strPtr(strNewFmt("%s/backup/simple", testPath())), "check simple backup path - NULL stanza");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -1149,24 +1149,24 @@ testRun(void)
|
||||
TEST_RESULT_PTR(storageSpool(), storage, "get cached storage");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_STR(strPtr(storagePathNP(storage, NULL)), testPath(), "check base path");
|
||||
TEST_RESULT_STR(strPtr(storagePathP(storage, NULL)), testPath(), "check base path");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(storagePathNP(storage, strNew(STORAGE_SPOOL_ARCHIVE_OUT))), strPtr(strNewFmt("%s/archive/db/out", testPath())),
|
||||
strPtr(storagePathP(storage, strNew(STORAGE_SPOOL_ARCHIVE_OUT))), strPtr(strNewFmt("%s/archive/db/out", testPath())),
|
||||
"check spool out path");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(storagePathNP(storage, strNewFmt("%s/%s", STORAGE_SPOOL_ARCHIVE_OUT, "file.ext"))),
|
||||
strPtr(storagePathP(storage, strNewFmt("%s/%s", STORAGE_SPOOL_ARCHIVE_OUT, "file.ext"))),
|
||||
strPtr(strNewFmt("%s/archive/db/out/file.ext", testPath())), "check spool out file");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(storagePathNP(storage, strNew(STORAGE_SPOOL_ARCHIVE_IN))), strPtr(strNewFmt("%s/archive/db/in", testPath())),
|
||||
strPtr(storagePathP(storage, strNew(STORAGE_SPOOL_ARCHIVE_IN))), strPtr(strNewFmt("%s/archive/db/in", testPath())),
|
||||
"check spool in path");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(storagePathNP(storage, strNewFmt("%s/%s", STORAGE_SPOOL_ARCHIVE_IN, "file.ext"))),
|
||||
strPtr(storagePathP(storage, strNewFmt("%s/%s", STORAGE_SPOOL_ARCHIVE_IN, "file.ext"))),
|
||||
strPtr(strNewFmt("%s/archive/db/in/file.ext", testPath())), "check spool in file");
|
||||
|
||||
TEST_ERROR(storagePathNP(storage, strNew("<" BOGUS_STR ">")), AssertError, "invalid expression '<BOGUS>'");
|
||||
TEST_ERROR(storagePathP(storage, strNew("<" BOGUS_STR ">")), AssertError, "invalid expression '<BOGUS>'");
|
||||
|
||||
TEST_ERROR(storageNewWriteNP(storage, writeFile), AssertError, "assertion 'this->write' failed");
|
||||
TEST_ERROR(storageNewWriteP(storage, writeFile), AssertError, "assertion 'this->write' failed");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_PTR(storageHelper.storageSpoolWrite, NULL, "storage not cached");
|
||||
@ -1174,7 +1174,7 @@ testRun(void)
|
||||
TEST_RESULT_PTR(storageHelper.storageSpoolWrite, storage, "storage cached");
|
||||
TEST_RESULT_PTR(storageSpoolWrite(), storage, "get cached storage");
|
||||
|
||||
TEST_RESULT_VOID(storageNewWriteNP(storage, writeFile), "writes are allowed");
|
||||
TEST_RESULT_VOID(storageNewWriteP(storage, writeFile), "writes are allowed");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_PTR(storageHelper.storagePg, NULL, "pg storage not cached");
|
||||
|
@ -89,12 +89,12 @@ testRun(void)
|
||||
{
|
||||
Storage *storageRemote = NULL;
|
||||
TEST_ASSIGN(storageRemote, storagePgGet(1, false), "get remote pg storage");
|
||||
storagePathCreateNP(storageTest, strNew("pg"));
|
||||
storagePathCreateP(storageTest, strNew("pg"));
|
||||
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageRemote, strNew("test.txt")), false, "file does not exist");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageRemote, strNew("test.txt")), false, "file does not exist");
|
||||
|
||||
storagePutNP(storageNewWriteNP(storageTest, strNew("repo/test.txt")), BUFSTRDEF("TEST"));
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageRemote, strNew("test.txt")), true, "file exists");
|
||||
storagePutP(storageNewWriteP(storageTest, strNew("repo/test.txt")), BUFSTRDEF("TEST"));
|
||||
TEST_RESULT_BOOL(storageExistsP(storageRemote, strNew("test.txt")), true, "file exists");
|
||||
|
||||
// Check protocol function directly
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -130,14 +130,14 @@ testRun(void)
|
||||
TEST_TITLE("missing file/path");
|
||||
|
||||
TEST_ERROR(
|
||||
storageInfoNP(storageRemote, strNew(BOGUS_STR)), FileOpenError,
|
||||
storageInfoP(storageRemote, strNew(BOGUS_STR)), FileOpenError,
|
||||
hrnReplaceKey("unable to get info for missing path/file '{[path]}/repo/BOGUS'"));
|
||||
TEST_RESULT_BOOL(storageInfoP(storageRemote, strNew(BOGUS_STR), .ignoreMissing = true).exists, false, "missing file/path");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("path info");
|
||||
|
||||
storagePathCreateNP(storageTest, strNew("repo"));
|
||||
storagePathCreateP(storageTest, strNew("repo"));
|
||||
struct utimbuf utimeTest = {.actime = 1000000000, .modtime = 1555160000};
|
||||
THROW_ON_SYS_ERROR(
|
||||
utime(strPtr(storagePath(storageTest, strNew("repo"))), &utimeTest) != 0, FileWriteError, "unable to set time");
|
||||
@ -159,9 +159,9 @@ testRun(void)
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("file info");
|
||||
|
||||
storagePutNP(storageNewWriteP(storageRemote, strNew("test"), .timeModified = 1555160001), BUFSTRDEF("TESTME"));
|
||||
storagePutP(storageNewWriteP(storageRemote, strNew("test"), .timeModified = 1555160001), BUFSTRDEF("TESTME"));
|
||||
|
||||
TEST_ASSIGN(info, storageInfoNP(storageRemote, strNew("test")), "valid file");
|
||||
TEST_ASSIGN(info, storageInfoP(storageRemote, strNew("test")), "valid file");
|
||||
TEST_RESULT_PTR(info.name, NULL, " name is not set");
|
||||
TEST_RESULT_BOOL(info.exists, true, " check exists");
|
||||
TEST_RESULT_INT(info.type, storageTypeFile, " check type");
|
||||
@ -179,7 +179,7 @@ testRun(void)
|
||||
|
||||
TEST_SYSTEM_FMT("mkfifo -m 666 %s", strPtr(storagePath(storageTest, strNew("repo/fifo"))));
|
||||
|
||||
TEST_ASSIGN(info, storageInfoNP(storageRemote, strNew("fifo")), "valid fifo");
|
||||
TEST_ASSIGN(info, storageInfoP(storageRemote, strNew("fifo")), "valid fifo");
|
||||
TEST_RESULT_PTR(info.name, NULL, " name is not set");
|
||||
TEST_RESULT_BOOL(info.exists, true, " check exists");
|
||||
TEST_RESULT_INT(info.type, storageTypeSpecial, " check type");
|
||||
@ -196,7 +196,7 @@ testRun(void)
|
||||
|
||||
TEST_SYSTEM_FMT("ln -s ../repo/test %s", strPtr(storagePath(storageTest, strNew("repo/link"))));
|
||||
|
||||
TEST_ASSIGN(info, storageInfoNP(storageRemote, strNew("link")), "valid link");
|
||||
TEST_ASSIGN(info, storageInfoP(storageRemote, strNew("link")), "valid link");
|
||||
TEST_RESULT_PTR(info.name, NULL, " name is not set");
|
||||
TEST_RESULT_BOOL(info.exists, true, " check exists");
|
||||
TEST_RESULT_INT(info.type, storageTypeLink, " check type");
|
||||
@ -300,8 +300,8 @@ testRun(void)
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("list path and file");
|
||||
|
||||
storagePathCreateNP(storageRemote, NULL);
|
||||
storagePutNP(storageNewWriteP(storageRemote, strNew("test"), .timeModified = 1555160001), BUFSTRDEF("TESTME"));
|
||||
storagePathCreateP(storageRemote, NULL);
|
||||
storagePutP(storageNewWriteP(storageRemote, strNew("test"), .timeModified = 1555160001), BUFSTRDEF("TESTME"));
|
||||
|
||||
// Path timestamp must be set after file is created since file creation updates it
|
||||
struct utimbuf utimeTest = {.actime = 1000000000, .modtime = 1555160000};
|
||||
@ -341,18 +341,18 @@ testRun(void)
|
||||
{
|
||||
Storage *storageRemote = NULL;
|
||||
TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), false), "get remote repo storage");
|
||||
storagePathCreateNP(storageTest, strNew("repo"));
|
||||
storagePathCreateP(storageTest, strNew("repo"));
|
||||
|
||||
TEST_RESULT_PTR(storageListP(storageRemote, strNew(BOGUS_STR), .nullOnMissing = true), NULL, "null for missing dir");
|
||||
TEST_RESULT_UINT(strLstSize(storageListNP(storageRemote, NULL)), 0, "empty list for missing dir");
|
||||
TEST_RESULT_UINT(strLstSize(storageListP(storageRemote, NULL)), 0, "empty list for missing dir");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePathCreateNP(storageTest, strNew("repo/testy"));
|
||||
TEST_RESULT_STR(strPtr(strLstJoin(storageListNP(storageRemote, NULL), ",")), "testy" , "list path");
|
||||
storagePathCreateP(storageTest, strNew("repo/testy"));
|
||||
TEST_RESULT_STR(strPtr(strLstJoin(storageListP(storageRemote, NULL), ",")), "testy" , "list path");
|
||||
|
||||
storagePathCreateNP(storageTest, strNew("repo/testy2\""));
|
||||
storagePathCreateP(storageTest, strNew("repo/testy2\""));
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListNP(storageRemote, strNewFmt("%s/repo", testPath())), sortOrderAsc), ",")),
|
||||
strPtr(strLstJoin(strLstSort(storageListP(storageRemote, strNewFmt("%s/repo", testPath())), sortOrderAsc), ",")),
|
||||
"testy,testy2\"" , "list 2 paths");
|
||||
|
||||
// Check protocol function directly
|
||||
@ -372,7 +372,7 @@ testRun(void)
|
||||
{
|
||||
Storage *storageRemote = NULL;
|
||||
TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), false), "get remote repo storage");
|
||||
storagePathCreateNP(storageTest, strNew("repo"));
|
||||
storagePathCreateP(storageTest, strNew("repo"));
|
||||
|
||||
Buffer *contentBuf = bufNew(32768);
|
||||
|
||||
@ -382,11 +382,11 @@ testRun(void)
|
||||
bufUsedSet(contentBuf, bufSize(contentBuf));
|
||||
|
||||
TEST_ERROR_FMT(
|
||||
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storageRemote, strNew("test.txt"))))), FileMissingError,
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(storageRemote, strNew("test.txt"))))), FileMissingError,
|
||||
"raised from remote-0 protocol on 'localhost': " STORAGE_ERROR_READ_MISSING,
|
||||
strPtr(strNewFmt("%s/repo/test.txt", testPath())));
|
||||
|
||||
storagePutNP(storageNewWriteNP(storageTest, strNew("repo/test.txt")), contentBuf);
|
||||
storagePutP(storageNewWriteP(storageTest, strNew("repo/test.txt")), contentBuf);
|
||||
|
||||
// Disable protocol compression in the storage object to test no compression
|
||||
((StorageRemote *)storageRemote->driver)->compressLevel = 0;
|
||||
@ -394,16 +394,16 @@ testRun(void)
|
||||
StorageRead *fileRead = NULL;
|
||||
|
||||
ioBufferSizeSet(8193);
|
||||
TEST_ASSIGN(fileRead, storageNewReadNP(storageRemote, strNew("test.txt")), "new file");
|
||||
TEST_RESULT_BOOL(bufEq(storageGetNP(fileRead), contentBuf), true, "get file");
|
||||
TEST_ASSIGN(fileRead, storageNewReadP(storageRemote, strNew("test.txt")), "new file");
|
||||
TEST_RESULT_BOOL(bufEq(storageGetP(fileRead), contentBuf), true, "get file");
|
||||
TEST_RESULT_BOOL(storageReadIgnoreMissing(fileRead), false, "check ignore missing");
|
||||
TEST_RESULT_STR_Z(storageReadName(fileRead), hrnReplaceKey("{[path]}/repo/test.txt"), "check name");
|
||||
TEST_RESULT_SIZE(
|
||||
storageReadRemote(storageRead(fileRead), bufNew(32), false), 0,
|
||||
"nothing more to read");
|
||||
|
||||
TEST_ASSIGN(fileRead, storageNewReadNP(storageRemote, strNew("test.txt")), "get file");
|
||||
TEST_RESULT_BOOL(bufEq(storageGetNP(fileRead), contentBuf), true, " check contents");
|
||||
TEST_ASSIGN(fileRead, storageNewReadP(storageRemote, strNew("test.txt")), "get file");
|
||||
TEST_RESULT_BOOL(bufEq(storageGetP(fileRead), contentBuf), true, " check contents");
|
||||
TEST_RESULT_UINT(((StorageReadRemote *)fileRead->driver)->protocolReadBytes, bufSize(contentBuf), " check read size");
|
||||
|
||||
// Enable protocol compression in the storage object
|
||||
@ -411,7 +411,7 @@ testRun(void)
|
||||
|
||||
TEST_ASSIGN(
|
||||
fileRead, storageNewReadP(storageRemote, strNew("test.txt"), .compressible = true), "get file (protocol compress)");
|
||||
TEST_RESULT_BOOL(bufEq(storageGetNP(fileRead), contentBuf), true, " check contents");
|
||||
TEST_RESULT_BOOL(bufEq(storageGetP(fileRead), contentBuf), true, " check contents");
|
||||
// We don't know how much protocol compression there will be exactly, but make sure this is some
|
||||
TEST_RESULT_BOOL(
|
||||
((StorageReadRemote *)fileRead->driver)->protocolReadBytes < bufSize(contentBuf), true,
|
||||
@ -436,7 +436,7 @@ testRun(void)
|
||||
|
||||
// Check protocol function directly (file exists)
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
storagePutNP(storageNewWriteNP(storageTest, strNew("repo/test.txt")), BUFSTRDEF("TESTDATA"));
|
||||
storagePutP(storageNewWriteP(storageTest, strNew("repo/test.txt")), BUFSTRDEF("TESTDATA"));
|
||||
ioBufferSizeSet(4);
|
||||
|
||||
paramList = varLstNew();
|
||||
@ -509,7 +509,7 @@ testRun(void)
|
||||
// *****************************************************************************************************************************
|
||||
if (testBegin("storageNewWrite()"))
|
||||
{
|
||||
storagePathCreateNP(storageTest, strNew("repo"));
|
||||
storagePathCreateP(storageTest, strNew("repo"));
|
||||
|
||||
Storage *storageRemote = NULL;
|
||||
TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), true), "get remote repo storage");
|
||||
@ -530,7 +530,7 @@ testRun(void)
|
||||
((StorageRemote *)storageRemote->driver)->compressLevel = 0;
|
||||
|
||||
StorageWrite *write = NULL;
|
||||
TEST_ASSIGN(write, storageNewWriteNP(storageRemote, strNew("test.txt")), "new write file");
|
||||
TEST_ASSIGN(write, storageNewWriteP(storageRemote, strNew("test.txt")), "new write file");
|
||||
|
||||
TEST_RESULT_BOOL(storageWriteAtomic(write), true, "write is atomic");
|
||||
TEST_RESULT_BOOL(storageWriteCreatePath(write), true, "path will be created");
|
||||
@ -540,21 +540,21 @@ testRun(void)
|
||||
TEST_RESULT_BOOL(storageWriteSyncFile(write), true, "file is synced");
|
||||
TEST_RESULT_BOOL(storageWriteSyncPath(write), true, "path is synced");
|
||||
|
||||
TEST_RESULT_VOID(storagePutNP(write, contentBuf), "write file");
|
||||
TEST_RESULT_VOID(storagePutP(write, contentBuf), "write file");
|
||||
TEST_RESULT_UINT(((StorageWriteRemote *)write->driver)->protocolWriteBytes, bufSize(contentBuf), " check write size");
|
||||
TEST_RESULT_VOID(storageWriteRemoteClose((StorageWriteRemote *)storageWriteDriver(write)), "close file again");
|
||||
TEST_RESULT_VOID(storageWriteFree(write), "free file");
|
||||
|
||||
// Make sure the file was written correctly
|
||||
TEST_RESULT_BOOL(
|
||||
bufEq(storageGetNP(storageNewReadNP(storageRemote, strNew("test.txt"))), contentBuf), true, "check file");
|
||||
bufEq(storageGetP(storageNewReadP(storageRemote, strNew("test.txt"))), contentBuf), true, "check file");
|
||||
|
||||
// Enable protocol compression in the storage object
|
||||
((StorageRemote *)storageRemote->driver)->compressLevel = 3;
|
||||
|
||||
// Write the file again, but this time free it before close and make sure the .tmp file is left
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_ASSIGN(write, storageNewWriteNP(storageRemote, strNew("test2.txt")), "new write file");
|
||||
TEST_ASSIGN(write, storageNewWriteP(storageRemote, strNew("test2.txt")), "new write file");
|
||||
|
||||
TEST_RESULT_VOID(ioWriteOpen(storageWriteIo(write)), "open file");
|
||||
TEST_RESULT_VOID(ioWrite(storageWriteIo(write), contentBuf), "write bytes");
|
||||
@ -562,12 +562,12 @@ testRun(void)
|
||||
TEST_RESULT_VOID(storageWriteFree(write), "free file");
|
||||
|
||||
TEST_RESULT_UINT(
|
||||
storageInfoNP(storageTest, strNew("repo/test2.txt.pgbackrest.tmp")).size, 16384, "file exists and is partial");
|
||||
storageInfoP(storageTest, strNew("repo/test2.txt.pgbackrest.tmp")).size, 16384, "file exists and is partial");
|
||||
|
||||
// Write the file again with protocol compression
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_ASSIGN(write, storageNewWriteP(storageRemote, strNew("test2.txt"), .compressible = true), "new write file (compress)");
|
||||
TEST_RESULT_VOID(storagePutNP(write, contentBuf), "write file");
|
||||
TEST_RESULT_VOID(storagePutP(write, contentBuf), "write file");
|
||||
TEST_RESULT_BOOL(
|
||||
((StorageWriteRemote *)write->driver)->protocolWriteBytes < bufSize(contentBuf), true,
|
||||
" check compressed write size");
|
||||
@ -608,7 +608,7 @@ testRun(void)
|
||||
"check result");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storageTest, strNew("repo/test3.txt"))))), "ABC123456789012345",
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(storageTest, strNew("repo/test3.txt"))))), "ABC123456789012345",
|
||||
"check file");
|
||||
|
||||
bufUsedSet(serverWrite, 0);
|
||||
@ -642,7 +642,7 @@ testRun(void)
|
||||
ioBufferSizeSet(8192);
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(storageGetNP(storageNewReadNP(storageTest, strNew("repo/test4.txt.pgbackrest.tmp"))))), "",
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(storageTest, strNew("repo/test4.txt.pgbackrest.tmp"))))), "",
|
||||
"check file");
|
||||
}
|
||||
|
||||
@ -651,10 +651,10 @@ testRun(void)
|
||||
{
|
||||
Storage *storageRemote = NULL;
|
||||
TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), false), "get remote repo storage");
|
||||
storagePathCreateNP(storageTest, strNew("repo"));
|
||||
storagePathCreateP(storageTest, strNew("repo"));
|
||||
|
||||
TEST_RESULT_BOOL(storagePathExistsNP(storageRemote, strNew("missing")), false, "path does not exist");
|
||||
TEST_RESULT_BOOL(storagePathExistsNP(storageRemote, NULL), true, "path exists");
|
||||
TEST_RESULT_BOOL(storagePathExistsP(storageRemote, strNew("missing")), false, "path does not exist");
|
||||
TEST_RESULT_BOOL(storagePathExistsP(storageRemote, NULL), true, "path exists");
|
||||
|
||||
// Check protocol function directly
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -672,15 +672,15 @@ testRun(void)
|
||||
if (testBegin("storagePathCreate()"))
|
||||
{
|
||||
String *path = strNew("testpath");
|
||||
storagePathCreateNP(storageTest, strNew("repo"));
|
||||
storagePathCreateP(storageTest, strNew("repo"));
|
||||
|
||||
Storage *storageRemote = NULL;
|
||||
TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), true), "get remote repo storage");
|
||||
|
||||
// Create a path via the remote. Check the repo via the local test storage to ensure the remote created it.
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageRemote, path), "new path");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageRemote, path), "new path");
|
||||
StorageInfo info = {0};
|
||||
TEST_ASSIGN(info, storageInfoNP(storageTest, strNewFmt("repo/%s", strPtr(path))), " get path info");
|
||||
TEST_ASSIGN(info, storageInfoP(storageTest, strNewFmt("repo/%s", strPtr(path))), " get path info");
|
||||
TEST_RESULT_BOOL(info.exists, true, " path exists");
|
||||
TEST_RESULT_INT(info.mode, STORAGE_MODE_PATH_DEFAULT, " mode is default");
|
||||
|
||||
@ -719,7 +719,7 @@ testRun(void)
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storageRemoteProtocol(PROTOCOL_COMMAND_STORAGE_PATH_CREATE_STR, paramList, server), "create parent and path");
|
||||
TEST_ASSIGN(info, storageInfoNP(storageTest, strNewFmt("repo/%s", strPtr(path))), " get path info");
|
||||
TEST_ASSIGN(info, storageInfoP(storageTest, strNewFmt("repo/%s", strPtr(path))), " get path info");
|
||||
TEST_RESULT_BOOL(info.exists, true, " path exists");
|
||||
TEST_RESULT_INT(info.mode, 0777, " mode is set");
|
||||
TEST_RESULT_STR(strPtr(strNewBuf(serverWrite)), "{}\n", " check result");
|
||||
@ -730,16 +730,16 @@ testRun(void)
|
||||
if (testBegin("storagePathRemove()"))
|
||||
{
|
||||
String *path = strNew("testpath");
|
||||
storagePathCreateNP(storageTest, strNew("repo"));
|
||||
storagePathCreateP(storageTest, strNew("repo"));
|
||||
|
||||
Storage *storageRemote = NULL;
|
||||
TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), true), "get remote repo storage");
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageRemote, path), "new path");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageRemote, path), "new path");
|
||||
|
||||
// Check the repo via the local test storage to ensure the remote wrote it, then remove via the remote and confirm removed
|
||||
TEST_RESULT_BOOL(storagePathExistsNP(storageTest, strNewFmt("repo/%s", strPtr(path))), true, "path exists");
|
||||
TEST_RESULT_VOID(storagePathRemoveNP(storageRemote, path), "remote remove path");
|
||||
TEST_RESULT_BOOL(storagePathExistsNP(storageTest, strNewFmt("repo/%s", strPtr(path))), false, "path removed");
|
||||
TEST_RESULT_BOOL(storagePathExistsP(storageTest, strNewFmt("repo/%s", strPtr(path))), true, "path exists");
|
||||
TEST_RESULT_VOID(storagePathRemoveP(storageRemote, path), "remote remove path");
|
||||
TEST_RESULT_BOOL(storagePathExistsP(storageTest, strNewFmt("repo/%s", strPtr(path))), false, "path removed");
|
||||
|
||||
// Check protocol function directly
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -756,12 +756,12 @@ testRun(void)
|
||||
|
||||
// Write the path and file to the repo and test the protocol
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(storageNewWriteNP(storageRemote, strNewFmt("%s/file.txt", strPtr(path))), BUFSTRDEF("TEST")),
|
||||
storagePutP(storageNewWriteP(storageRemote, strNewFmt("%s/file.txt", strPtr(path))), BUFSTRDEF("TEST")),
|
||||
"new path and file");
|
||||
TEST_RESULT_BOOL(
|
||||
storageRemoteProtocol(PROTOCOL_COMMAND_STORAGE_PATH_REMOVE_STR, paramList, server), true,
|
||||
" protocol path recurse remove");
|
||||
TEST_RESULT_BOOL(storagePathExistsNP(storageTest, strNewFmt("repo/%s", strPtr(path))), false, " recurse path removed");
|
||||
TEST_RESULT_BOOL(storagePathExistsP(storageTest, strNewFmt("repo/%s", strPtr(path))), false, " recurse path removed");
|
||||
TEST_RESULT_STR(strPtr(strNewBuf(serverWrite)), "{\"out\":true}\n", " check result");
|
||||
|
||||
bufUsedSet(serverWrite, 0);
|
||||
@ -770,19 +770,19 @@ testRun(void)
|
||||
// *****************************************************************************************************************************
|
||||
if (testBegin("storageRemove()"))
|
||||
{
|
||||
storagePathCreateNP(storageTest, strNew("repo"));
|
||||
storagePathCreateP(storageTest, strNew("repo"));
|
||||
|
||||
Storage *storageRemote = NULL;
|
||||
TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), true), "get remote repo storage");
|
||||
String *file = strNew("file.txt");
|
||||
|
||||
// Write the file to the repo via the remote so owner is pgbackrest
|
||||
TEST_RESULT_VOID(storagePutNP(storageNewWriteNP(storageRemote, file), BUFSTRDEF("TEST")), "new file");
|
||||
TEST_RESULT_VOID(storagePutP(storageNewWriteP(storageRemote, file), BUFSTRDEF("TEST")), "new file");
|
||||
|
||||
// Check the repo via the local test storage to ensure the remote wrote it, then remove via the remote and confirm removed
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, strNewFmt("repo/%s", strPtr(file))), true, "file exists");
|
||||
TEST_RESULT_VOID(storageRemoveNP(storageRemote, file), "remote remove file");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, strNewFmt("repo/%s", strPtr(file))), false, "file removed");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, strNewFmt("repo/%s", strPtr(file))), true, "file exists");
|
||||
TEST_RESULT_VOID(storageRemoveP(storageRemote, file), "remote remove file");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, strNewFmt("repo/%s", strPtr(file))), false, "file removed");
|
||||
|
||||
// Check protocol function directly
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -806,11 +806,11 @@ testRun(void)
|
||||
bufUsedSet(serverWrite, 0);
|
||||
|
||||
// Write the file to the repo via the remote and test the protocol
|
||||
TEST_RESULT_VOID(storagePutNP(storageNewWriteNP(storageRemote, file), BUFSTRDEF("TEST")), "new file");
|
||||
TEST_RESULT_VOID(storagePutP(storageNewWriteP(storageRemote, file), BUFSTRDEF("TEST")), "new file");
|
||||
TEST_RESULT_BOOL(
|
||||
storageRemoteProtocol(PROTOCOL_COMMAND_STORAGE_REMOVE_STR, paramList, server), true,
|
||||
"protocol file remove");
|
||||
TEST_RESULT_BOOL(storageExistsNP(storageTest, strNewFmt("repo/%s", strPtr(file))), false, " confirm file removed");
|
||||
TEST_RESULT_BOOL(storageExistsP(storageTest, strNewFmt("repo/%s", strPtr(file))), false, " confirm file removed");
|
||||
TEST_RESULT_STR(strPtr(strNewBuf(serverWrite)), "{}\n", " check result");
|
||||
bufUsedSet(serverWrite, 0);
|
||||
}
|
||||
@ -818,14 +818,14 @@ testRun(void)
|
||||
// *****************************************************************************************************************************
|
||||
if (testBegin("storagePathSync()"))
|
||||
{
|
||||
storagePathCreateNP(storageTest, strNew("repo"));
|
||||
storagePathCreateP(storageTest, strNew("repo"));
|
||||
|
||||
Storage *storageRemote = NULL;
|
||||
TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), true), "get remote repo storage");
|
||||
|
||||
String *path = strNew("testpath");
|
||||
TEST_RESULT_VOID(storagePathCreateNP(storageRemote, path), "new path");
|
||||
TEST_RESULT_VOID(storagePathSyncNP(storageRemote, path), "sync path");
|
||||
TEST_RESULT_VOID(storagePathCreateP(storageRemote, path), "new path");
|
||||
TEST_RESULT_VOID(storagePathSyncP(storageRemote, path), "sync path");
|
||||
|
||||
// Check protocol function directly
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -751,19 +751,19 @@ testRun(void)
|
||||
|
||||
// Coverage for noop functions
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(storagePathSyncNP(s3, strNew("path")), "path sync is a noop");
|
||||
TEST_RESULT_VOID(storagePathSyncP(s3, strNew("path")), "path sync is a noop");
|
||||
|
||||
// storageS3NewRead() and StorageS3FileRead
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_PTR(
|
||||
storageGetNP(storageNewReadP(s3, strNew("fi&le.txt"), .ignoreMissing = true)), NULL, "ignore missing file");
|
||||
storageGetP(storageNewReadP(s3, strNew("fi&le.txt"), .ignoreMissing = true)), NULL, "ignore missing file");
|
||||
TEST_ERROR(
|
||||
storageGetNP(storageNewReadNP(s3, strNew("file.txt"))), FileMissingError,
|
||||
storageGetP(storageNewReadP(s3, strNew("file.txt"))), FileMissingError,
|
||||
"unable to open '/file.txt': No such file or directory");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(storageGetNP(storageNewReadNP(s3, strNew("file.txt"))))), "this is a sample file",
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(s3, strNew("file.txt"))))), "this is a sample file",
|
||||
"get file");
|
||||
TEST_RESULT_STR(strPtr(strNewBuf(storageGetNP(storageNewReadNP(s3, strNew("file0.txt"))))), "", "get zero-length file");
|
||||
TEST_RESULT_STR(strPtr(strNewBuf(storageGetP(storageNewReadP(s3, strNew("file0.txt"))))), "", "get zero-length file");
|
||||
|
||||
StorageRead *read = NULL;
|
||||
TEST_ASSIGN(read, storageNewReadP(s3, strNew("file.txt"), .ignoreMissing = true), "new read file");
|
||||
@ -790,8 +790,8 @@ testRun(void)
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
// File is written all at once
|
||||
StorageWrite *write = NULL;
|
||||
TEST_ASSIGN(write, storageNewWriteNP(s3, strNew("file.txt")), "new write file");
|
||||
TEST_RESULT_VOID(storagePutNP(write, BUFSTRDEF("ABCD")), "put file all at once");
|
||||
TEST_ASSIGN(write, storageNewWriteP(s3, strNew("file.txt")), "new write file");
|
||||
TEST_RESULT_VOID(storagePutP(write, BUFSTRDEF("ABCD")), "put file all at once");
|
||||
|
||||
TEST_RESULT_BOOL(storageWriteAtomic(write), true, "write is atomic");
|
||||
TEST_RESULT_BOOL(storageWriteCreatePath(write), true, "path will be created");
|
||||
@ -804,32 +804,32 @@ testRun(void)
|
||||
TEST_RESULT_VOID(storageWriteS3Close((StorageWriteS3 *)storageWriteDriver(write)), "close file again");
|
||||
|
||||
// Zero-length file
|
||||
TEST_ASSIGN(write, storageNewWriteNP(s3, strNew("file.txt")), "new write file");
|
||||
TEST_RESULT_VOID(storagePutNP(write, NULL), "write zero-length file");
|
||||
TEST_ASSIGN(write, storageNewWriteP(s3, strNew("file.txt")), "new write file");
|
||||
TEST_RESULT_VOID(storagePutP(write, NULL), "write zero-length file");
|
||||
|
||||
// File is written in chunks with nothing left over on close
|
||||
TEST_ASSIGN(write, storageNewWriteNP(s3, strNew("file.txt")), "new write file");
|
||||
TEST_ASSIGN(write, storageNewWriteP(s3, strNew("file.txt")), "new write file");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(write, BUFSTRDEF("12345678901234567890123456789012")),
|
||||
storagePutP(write, BUFSTRDEF("12345678901234567890123456789012")),
|
||||
"write file in chunks -- nothing left on close");
|
||||
|
||||
// File is written in chunks with something left over on close
|
||||
TEST_ASSIGN(write, storageNewWriteNP(s3, strNew("file.txt")), "new write file");
|
||||
TEST_ASSIGN(write, storageNewWriteP(s3, strNew("file.txt")), "new write file");
|
||||
TEST_RESULT_VOID(
|
||||
storagePutNP(write, BUFSTRDEF("12345678901234567890")),
|
||||
storagePutP(write, BUFSTRDEF("12345678901234567890")),
|
||||
"write file in chunks -- something left on close");
|
||||
|
||||
// storageDriverExists()
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_BOOL(storageExistsNP(s3, strNew("BOGUS")), false, "file does not exist");
|
||||
TEST_RESULT_BOOL(storageExistsNP(s3, strNew("subdir/file1.txt")), true, "file exists");
|
||||
TEST_RESULT_BOOL(storageExistsP(s3, strNew("BOGUS")), false, "file does not exist");
|
||||
TEST_RESULT_BOOL(storageExistsP(s3, strNew("subdir/file1.txt")), true, "file exists");
|
||||
|
||||
// Info()
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_BOOL(storageInfoP(s3, strNew("BOGUS"), .ignoreMissing = true).exists, false, "file does not exist");
|
||||
|
||||
StorageInfo info;
|
||||
TEST_ASSIGN(info, storageInfoNP(s3, strNew("subdir/file1.txt")), "file exists");
|
||||
TEST_ASSIGN(info, storageInfoP(s3, strNew("subdir/file1.txt")), "file exists");
|
||||
TEST_RESULT_BOOL(info.exists, true, " check exists");
|
||||
TEST_RESULT_UINT(info.type, storageTypeFile, " check type");
|
||||
TEST_RESULT_UINT(info.size, 9999, " check exists");
|
||||
@ -841,7 +841,7 @@ testRun(void)
|
||||
AssertError, "assertion '!param.errorOnMissing || storageFeature(this, storageFeaturePath)' failed");
|
||||
|
||||
TEST_RESULT_VOID(
|
||||
storageInfoListNP(s3, strNew("/path/to"), testStorageInfoListCallback, (void *)memContextCurrent()), "info list files");
|
||||
storageInfoListP(s3, strNew("/path/to"), testStorageInfoListCallback, (void *)memContextCurrent()), "info list files");
|
||||
|
||||
TEST_RESULT_UINT(testStorageInfoListSize, 2, " file and path returned");
|
||||
TEST_RESULT_STR(strPtr(testStorageInfoList[0].name), "test_path", " check name");
|
||||
@ -856,7 +856,7 @@ testRun(void)
|
||||
TEST_ERROR(
|
||||
storageListP(s3, strNew("/"), .errorOnMissing = true), AssertError,
|
||||
"assertion '!param.errorOnMissing || storageFeature(this, storageFeaturePath)' failed");
|
||||
TEST_ERROR(storageListNP(s3, strNew("/")), ProtocolError,
|
||||
TEST_ERROR(storageListP(s3, strNew("/")), ProtocolError,
|
||||
"S3 request failed with 344: Another bad status\n"
|
||||
"*** URI/Query ***:\n"
|
||||
"/?delimiter=%2F&list-type=2\n"
|
||||
@ -866,7 +866,7 @@ testRun(void)
|
||||
"host: " S3_TEST_HOST "\n"
|
||||
"x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n"
|
||||
"x-amz-date: <redacted>");
|
||||
TEST_ERROR(storageListNP(s3, strNew("/")), ProtocolError,
|
||||
TEST_ERROR(storageListP(s3, strNew("/")), ProtocolError,
|
||||
"S3 request failed with 344: Another bad status with xml\n"
|
||||
"*** URI/Query ***:\n"
|
||||
"/?delimiter=%2F&list-type=2\n"
|
||||
@ -880,7 +880,7 @@ testRun(void)
|
||||
"content-length: 79\n"
|
||||
"*** Response Content ***:\n"
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><Error><Code>SomeOtherCode</Code></Error>");
|
||||
TEST_ERROR(storageListNP(s3, strNew("/")), ProtocolError,
|
||||
TEST_ERROR(storageListP(s3, strNew("/")), ProtocolError,
|
||||
"S3 request failed with 403: Forbidden\n"
|
||||
"*** URI/Query ***:\n"
|
||||
"/?delimiter=%2F&list-type=2\n"
|
||||
@ -896,12 +896,12 @@ testRun(void)
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><Error><Code>RequestTimeTooSkewed</Code>"
|
||||
"<Message>The difference between the request time and the current time is too large.</Message></Error>");
|
||||
|
||||
TEST_RESULT_STR(strPtr(strLstJoin(storageListNP(s3, strNew("/")), ",")), "path1,test1.txt", "list a file/path in root");
|
||||
TEST_RESULT_STR(strPtr(strLstJoin(storageListP(s3, strNew("/")), ",")), "path1,test1.txt", "list a file/path in root");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(storageListP(s3, strNew("/"), .expression = strNew("^test.*$")), ",")), "test1.txt",
|
||||
"list a file in root with expression");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(storageListNP(s3, strNew("/path/to")), ",")),
|
||||
strPtr(strLstJoin(storageListP(s3, strNew("/path/to")), ",")),
|
||||
"path1,test1.txt,test2.txt,path2,test3.txt", "list files with continuation");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(storageListP(s3, strNew("/path/to"), .expression = strNew("^test(1|3)")), ",")),
|
||||
@ -910,7 +910,7 @@ testRun(void)
|
||||
// storageDriverPathRemove()
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_ERROR(
|
||||
storagePathRemoveNP(s3, strNew("/")), AssertError,
|
||||
storagePathRemoveP(s3, strNew("/")), AssertError,
|
||||
"assertion 'param.recurse || storageFeature(this, storageFeaturePath)' failed");
|
||||
TEST_RESULT_VOID(storagePathRemoveP(s3, strNew("/"), .recurse = true), "remove root path");
|
||||
TEST_RESULT_VOID(storagePathRemoveP(s3, strNew("/path"), .recurse = true), "nothing to do in empty subpath");
|
||||
@ -921,7 +921,7 @@ testRun(void)
|
||||
|
||||
// storageDriverRemove()
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_RESULT_VOID(storageRemoveNP(s3, strNew("/path/to/test.txt")), "remove file");
|
||||
TEST_RESULT_VOID(storageRemoveP(s3, strNew("/path/to/test.txt")), "remove file");
|
||||
}
|
||||
|
||||
FUNCTION_HARNESS_RESULT_VOID();
|
||||
|
Reference in New Issue
Block a user