pgsql: Add end-to-end testing of pg_basebackup's tar-format output. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Add end-to-end testing of pg_basebackup's tar-format output.
Date
Msg-id E1lMcdD-0007vW-L6@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Add end-to-end testing of pg_basebackup's tar-format output.

The existing test script does run pg_basebackup with the -Ft option,
but it makes no real attempt to verify the sanity of the results.
We wouldn't know if the output is incompatible with standard "tar"
programs, nor if the server fails to start from the restored output.
Notably, this means that xlog.c's read_tablespace_map() is not being
meaningfully tested, since that code is used only in the tar-format
case.  (We do have reasonable coverage of restoring from plain-format
output, though it's over in src/test/recovery not here.)

Hence, attempt to untar the output and start a server from it,
rather just hoping it's OK.

This test assumes that the local "tar" has the "-C directory"
switch.  Although that's not promised by POSIX, my research
suggests that all non-extinct tar implementations have it.
Should the buildfarm's opinion differ, we can complicate the
test a bit to avoid requiring that.

Possibly this should be back-patched, but I'm unsure about
whether it could work on Windows before d66b23b03.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/081876d75ea15c3bd2ee5ba64a794fd8ea46d794

Modified Files
--------------
src/bin/pg_basebackup/Makefile               |  3 ++
src/bin/pg_basebackup/t/010_pg_basebackup.pl | 55 ++++++++++++++++++++++++----
src/test/perl/PostgresNode.pm                | 34 ++++++++++++++---
3 files changed, 78 insertions(+), 14 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Doc: improve discussion of variable substitution in PL/pgSQL.
Next
From: Tom Lane
Date:
Subject: pgsql: Doc: remove duplicated step in RLS example.