1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-03-05 15:05:48 +02:00

Update help test to use restore command to provide better coverage.

This commit is contained in:
David Steele 2018-05-01 13:20:48 -04:00
parent 8dbbf2de92
commit 1a1ed8d6b9

View File

@ -96,19 +96,33 @@ testRun()
const char *commandHelp = strPtr(strNewFmt( const char *commandHelp = strPtr(strNewFmt(
"%s%s%s", "%s%s%s",
helpVersion, helpVersion,
" - 'archive-push' command help\n" " - 'restore' command help\n"
"\n" "\n"
"Push a WAL segment to the archive.\n" "Restore a database cluster.\n"
"\n" "\n"
"The WAL segment may be pushed immediately to the archive or stored locally\n" "This command is generally run manually, but there are instances where it might\n"
"depending on the value of archive-async\n" "be automated.\n"
"\n" "\n"
"Command Options:\n" "Command Options:\n"
"\n" "\n"
" --archive-async push/get WAL segments asynchronously\n" " --db-include restore only specified databases\n"
" [default=n]\n" " --delta restore using delta [default=n]\n"
" --archive-push-queue-max maximum size of the PostgreSQL archive queue\n" " --force force a restore [default=n]\n"
" --archive-timeout archive timeout [default=60]\n" " --link-all restore all symlinks [default=n]\n"
" --link-map modify the destination of a symlink\n"
" --recovery-option set an option in recovery.conf\n"
" --set backup set to restore [default=latest]\n"
" --tablespace-map restore a tablespace into the specified\n"
" directory\n"
" --tablespace-map-all restore all tablespaces into the specified\n"
" directory\n"
" --target recovery target\n"
" --target-action action to take when recovery target is\n"
" reached [default=pause]\n"
" --target-exclusive stop just before the recovery target is\n"
" reached [default=n]\n"
" --target-timeline recover along a timeline\n"
" --type recovery type [default=default]\n"
"\n" "\n"
"General Options:\n" "General Options:\n"
"\n" "\n"
@ -126,15 +140,12 @@ testRun()
" files [default=/etc/pgbackrest/conf.d]\n" " files [default=/etc/pgbackrest/conf.d]\n"
" --config-path base path of pgBackRest configuration files\n" " --config-path base path of pgBackRest configuration files\n"
" [default=/etc/pgbackrest]\n" " [default=/etc/pgbackrest]\n"
" --db-timeout database query timeout [default=1800]\n"
" --lock-path path where lock files are stored\n" " --lock-path path where lock files are stored\n"
" [default=/tmp/pgbackrest]\n" " [default=/tmp/pgbackrest]\n"
" --neutral-umask use a neutral umask [default=y]\n" " --neutral-umask use a neutral umask [default=y]\n"
" --process-max max processes to use for compress/transfer\n" " --process-max max processes to use for compress/transfer\n"
" [default=1]\n" " [default=1]\n"
" --protocol-timeout protocol timeout [default=1830]\n" " --protocol-timeout protocol timeout [default=1830]\n"
" --spool-path path where transient data is stored\n"
" [default=/var/spool/pgbackrest]\n"
" --stanza defines the stanza\n" " --stanza defines the stanza\n"
"\n" "\n"
"Log Options:\n" "Log Options:\n"
@ -145,8 +156,8 @@ testRun()
" --log-path path where log files are stored\n" " --log-path path where log files are stored\n"
" [default=/var/log/pgbackrest]\n" " [default=/var/log/pgbackrest]\n"
" --log-timestamp enable timestamp in logging [default=y]\n" " --log-timestamp enable timestamp in logging [default=y]\n"
"\n" "\n",
"Repository Options:\n", "Repository Options:\n"
"\n" "\n"
" --repo-cipher-pass repository cipher passphrase\n" " --repo-cipher-pass repository cipher passphrase\n"
" --repo-cipher-type cipher used to encrypt the repository\n" " --repo-cipher-type cipher used to encrypt the repository\n"
@ -182,15 +193,15 @@ testRun()
"\n" "\n"
" --pg-path postgreSQL data directory\n" " --pg-path postgreSQL data directory\n"
"\n" "\n"
"Use 'pgbackrest help archive-push [option]' for more information.\n")); "Use 'pgbackrest help restore [option]' for more information.\n"));
argList = strLstNew(); argList = strLstNew();
strLstAddZ(argList, "/path/to/pgbackrest"); strLstAddZ(argList, "/path/to/pgbackrest");
strLstAddZ(argList, "help"); strLstAddZ(argList, "help");
strLstAddZ(argList, "archive-push"); strLstAddZ(argList, "restore");
strLstAddZ(argList, "--buffer-size=32768"); strLstAddZ(argList, "--buffer-size=32768");
strLstAddZ(argList, "--repo1-host=backup.example.net"); strLstAddZ(argList, "--repo1-host=backup.example.net");
TEST_RESULT_VOID(configParse(strLstSize(argList), strLstPtr(argList)), "help for archive-push command"); TEST_RESULT_VOID(configParse(strLstSize(argList), strLstPtr(argList)), "help for restore command");
TEST_RESULT_STR(strPtr(helpRender()), commandHelp, " check text"); TEST_RESULT_STR(strPtr(helpRender()), commandHelp, " check text");
// ------------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------------