mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2024-12-12 10:04:14 +02:00
d038b9a029
PostgreSQL 11 introduces configurable WAL segment sizes, from 1MB to 1GB. There are two areas that needed to be updated to support this: building the archive-get queue and checking that WAL has been archived after a backup. Both operations require the WAL segment size to properly build a list. Checking the archive after a backup is still implemented in Perl and has an active database connection, so just get the WAL segment size from the database. The archive-get command does not have a connection to the database, so get the WAL segment size from pg_control instead. This requires a deeper inspection of pg_control than has been done in the past, so it seemed best to copy the relevant data structures from each version of PostgreSQL and build a generic interface layer to address them. While this approach is a bit verbose, it has the advantage of being relatively simple, and can easily be updated for new versions of PostgreSQL. Since the integration tests generate pg_control files for testing, teach Perl how to generate files with the correct offsets for both 32-bit and 64-bit architectures.
747 lines
26 KiB
YAML
747 lines
26 KiB
YAML
# **********************************************************************************************************************************
|
|
# Test Definition
|
|
#
|
|
# Contains definitions for all unit and integration tests.
|
|
#
|
|
# The definitions consist of modules and tests. Modules group together tests that are related and allow common settings for all the
|
|
# tests. Every module and test must have a name. Tests must also have a total. If this total does not match the actual number of
|
|
# runs in a test then an error will be thrown.
|
|
#
|
|
# Most options can be set for modules and tests (test option will override module option if both are set):
|
|
# * db - determines if the test will be run against multiple db versions
|
|
# * coverage - determines coverage for the test
|
|
# full - the module/test provides full coverage for the code module
|
|
# partial - the module/test provides partial coverage for the code module
|
|
# noCode - the code module should not contain any coverable code. If it does an error will be thrown.
|
|
# * define - defines for C testing
|
|
# * debugUnitSuppress - don't define DEBUG_UNIT for unit tests -- this is used to test unit test debugging macros
|
|
# * perlReq - is Perl required for this C test?
|
|
#
|
|
# Some options are unique to tests:
|
|
# * total - total runs in the test
|
|
# * vm - VMs that the test will be run on
|
|
# **********************************************************************************************************************************
|
|
|
|
# **********************************************************************************************************************************
|
|
# Unit tests
|
|
#
|
|
# Unit tests are assumed to be C tests unless they end in "-perl".
|
|
# **********************************************************************************************************************************
|
|
unit:
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: common
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: error
|
|
total: 8
|
|
define: -DNO_ERROR -DNO_LOG -DNO_STACK_TRACE -DNO_MEM_CONTEXT
|
|
|
|
coverage:
|
|
common/error: full
|
|
common/error.auto: noCode
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: assert-on
|
|
total: 2
|
|
define: -DNO_LOG -DNO_STACK_TRACE -DNO_MEM_CONTEXT
|
|
|
|
coverage:
|
|
common/assert: noCode
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: assert-off
|
|
total: 2
|
|
define: -DNDEBUG -DNO_LOG -DNO_STACK_TRACE -DNO_MEM_CONTEXT
|
|
debugUnitSuppress: true
|
|
|
|
coverage:
|
|
common/assert: noCode
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: stack-trace
|
|
total: 4
|
|
define: -DNO_LOG -DNO_STACK_TRACE -DNO_MEM_CONTEXT
|
|
|
|
coverage:
|
|
common/stackTrace: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: mem-context
|
|
total: 7
|
|
define: -DNO_MEM_CONTEXT -DNO_LOG
|
|
|
|
coverage:
|
|
common/memContext: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: time
|
|
total: 2
|
|
define: -DNO_ERROR -DNO_LOG
|
|
|
|
coverage:
|
|
common/time: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: fork
|
|
total: 1
|
|
define: -DNO_LOG
|
|
|
|
coverage:
|
|
common/fork: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: log
|
|
total: 5
|
|
define: -DNO_LOG
|
|
|
|
coverage:
|
|
common/log: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: debug-off
|
|
total: 2
|
|
define: -DNDEBUG -DNO_LOG
|
|
debugUnitSuppress: true
|
|
|
|
coverage:
|
|
common/debug: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: debug-on
|
|
total: 4
|
|
|
|
coverage:
|
|
common/debug: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: lock
|
|
total: 2
|
|
|
|
coverage:
|
|
common/lock: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: exit
|
|
total: 3
|
|
|
|
coverage:
|
|
common/exit: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: wait
|
|
total: 1
|
|
|
|
coverage:
|
|
common/wait: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: type-convert
|
|
total: 9
|
|
|
|
coverage:
|
|
common/type/convert: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: type-list
|
|
total: 3
|
|
|
|
coverage:
|
|
common/type/list: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: type-string
|
|
total: 14
|
|
|
|
coverage:
|
|
common/type/string: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: type-string-list
|
|
total: 9
|
|
|
|
coverage:
|
|
common/type/stringList: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: type-buffer
|
|
total: 5
|
|
|
|
coverage:
|
|
common/type/buffer: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: type-variant
|
|
total: 9
|
|
|
|
coverage:
|
|
common/type/variant: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: type-variant-list
|
|
total: 3
|
|
|
|
coverage:
|
|
common/type/variantList: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: type-json
|
|
total: 1
|
|
|
|
coverage:
|
|
common/type/json: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: type-key-value
|
|
total: 2
|
|
|
|
coverage:
|
|
common/type/keyValue: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: io
|
|
total: 4
|
|
|
|
coverage:
|
|
common/io/bufferRead: full
|
|
common/io/bufferWrite: full
|
|
common/io/filter/buffer: full
|
|
common/io/filter/filter: full
|
|
common/io/filter/group: full
|
|
common/io/filter/size: full
|
|
common/io/handle: full
|
|
common/io/io: full
|
|
common/io/read: full
|
|
common/io/write: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: encode
|
|
total: 1
|
|
|
|
coverage:
|
|
common/encode: full
|
|
common/encode/base64: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: encode-perl
|
|
total: 1
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: http-client-perl
|
|
total: 2
|
|
|
|
coverage:
|
|
Common/Http/Client: partial
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: reg-exp
|
|
total: 2
|
|
|
|
coverage:
|
|
common/regExp: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: ini
|
|
total: 3
|
|
|
|
coverage:
|
|
common/ini: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: ini-perl
|
|
total: 10
|
|
|
|
coverage:
|
|
Common/Ini: partial
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: io-handle-perl
|
|
total: 6
|
|
|
|
coverage:
|
|
Common/Io/Handle: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: io-buffered-perl
|
|
total: 3
|
|
|
|
coverage:
|
|
Common/Io/Buffered: partial
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: io-process-perl
|
|
total: 3
|
|
|
|
coverage:
|
|
Common/Io/Process: partial
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: log-perl
|
|
total: 1
|
|
|
|
coverage:
|
|
Common/Log: partial
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: crypto
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: crypto
|
|
total: 1
|
|
|
|
coverage:
|
|
crypto/crypto: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: random
|
|
total: 1
|
|
|
|
coverage:
|
|
crypto/random: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: hash
|
|
total: 2
|
|
|
|
coverage:
|
|
crypto/hash: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: cipherBlock
|
|
total: 2
|
|
|
|
coverage:
|
|
crypto/cipherBlock: full
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: compress
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: gzip
|
|
total: 4
|
|
|
|
coverage:
|
|
compress/gzip: full
|
|
compress/gzipCompress: full
|
|
compress/gzipDecompress: full
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: postgres
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: interface
|
|
total: 2
|
|
|
|
coverage:
|
|
postgres/interface: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: page-checksum
|
|
total: 3
|
|
|
|
coverage:
|
|
postgres/pageChecksum: full
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: perl
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: config
|
|
total: 1
|
|
|
|
coverage:
|
|
perl/config: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: exec
|
|
total: 2
|
|
perlReq: true
|
|
|
|
coverage:
|
|
perl/exec: full
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: help
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: help
|
|
total: 4
|
|
|
|
coverage:
|
|
command/help/help: full
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: config
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: define
|
|
total: 2
|
|
|
|
coverage:
|
|
config/define: full
|
|
config/define.auto: noCode
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: config
|
|
total: 3
|
|
|
|
coverage:
|
|
config/config: full
|
|
config/config.auto: noCode
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: parse
|
|
total: 4
|
|
|
|
coverage:
|
|
config/parse: full
|
|
config/parse.auto: noCode
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: load
|
|
total: 3
|
|
|
|
coverage:
|
|
config/load: full
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: storage
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: filter-cipher-block-perl
|
|
total: 2
|
|
|
|
coverage:
|
|
Storage/Filter/CipherBlock: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: filter-gzip-perl
|
|
total: 3
|
|
|
|
coverage:
|
|
Storage/Filter/Gzip: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: filter-sha-perl
|
|
total: 2
|
|
|
|
coverage:
|
|
Storage/Filter/Sha: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: posix-perl
|
|
total: 9
|
|
|
|
coverage:
|
|
Storage/Posix/Driver: partial
|
|
Storage/Posix/FileRead: partial
|
|
Storage/Posix/FileWrite: partial
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: s3-auth-perl
|
|
total: 5
|
|
|
|
coverage:
|
|
Storage/S3/Auth: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: s3-cert-perl
|
|
total: 1
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: s3-request-perl
|
|
total: 2
|
|
|
|
coverage:
|
|
Storage/S3/Request: partial
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: s3-perl
|
|
total: 7
|
|
|
|
coverage:
|
|
Storage/S3/Driver: partial
|
|
Storage/S3/FileRead: partial
|
|
Storage/S3/FileWrite: full
|
|
|
|
vm:
|
|
- co7
|
|
- u14
|
|
- u16
|
|
- u18
|
|
- d8
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: local-perl
|
|
total: 10
|
|
|
|
coverage:
|
|
Storage/Local: partial
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: helper-perl
|
|
total: 5
|
|
|
|
coverage:
|
|
Storage/Helper: partial
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: posix
|
|
total: 20
|
|
|
|
coverage:
|
|
storage/driver/posix/common: full
|
|
storage/driver/posix/fileRead: full
|
|
storage/driver/posix/fileWrite: full
|
|
storage/driver/posix/storage: full
|
|
storage/fileRead: full
|
|
storage/fileWrite: full
|
|
storage/helper: full
|
|
storage/storage: full
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: protocol
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: common-minion-perl
|
|
total: 1
|
|
|
|
coverage:
|
|
Protocol/Base/Minion: partial
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: helper-perl
|
|
total: 2
|
|
|
|
coverage:
|
|
Protocol/Helper: partial
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: info
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: unit-perl
|
|
total: 2
|
|
|
|
coverage:
|
|
Info: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: info
|
|
total: 1
|
|
|
|
coverage:
|
|
info/info: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: info-pg
|
|
total: 1
|
|
|
|
coverage:
|
|
info/infoPg: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: info-archive
|
|
total: 1
|
|
|
|
coverage:
|
|
info/infoArchive: full
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: command
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: command
|
|
total: 1
|
|
|
|
coverage:
|
|
command/command: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: control
|
|
total: 2
|
|
|
|
coverage:
|
|
command/control/control: full
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: archive
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: common
|
|
total: 6
|
|
|
|
coverage:
|
|
command/archive/common: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: common-perl
|
|
total: 6
|
|
|
|
coverage:
|
|
Archive/Common: partial
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: push-perl
|
|
total: 7
|
|
|
|
coverage:
|
|
Archive/Push/Async: full
|
|
Archive/Push/File: partial
|
|
Archive/Push/Push: full
|
|
Protocol/Local/Master: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: push
|
|
total: 1
|
|
perlReq: true
|
|
|
|
coverage:
|
|
command/archive/push/push: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: info-unit-perl
|
|
total: 4
|
|
|
|
coverage:
|
|
Archive/Info: partial
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: get
|
|
total: 4
|
|
perlReq: true
|
|
|
|
coverage:
|
|
command/archive/get/file: full
|
|
command/archive/get/get: full
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: get-perl
|
|
total: 3
|
|
|
|
coverage:
|
|
Archive/Base: full
|
|
Archive/Get/Async: full
|
|
Archive/Get/File: partial
|
|
Archive/Get/Get: partial
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: backup
|
|
|
|
coverage:
|
|
Backup/Common: full
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: unit-perl
|
|
total: 3
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: info-unit-perl
|
|
total: 3
|
|
|
|
coverage:
|
|
Backup/Info: partial
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: file-unit-perl
|
|
total: 2
|
|
|
|
coverage:
|
|
Backup/File: partial
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: manifest
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: all-perl
|
|
total: 9
|
|
|
|
coverage:
|
|
Manifest: partial
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: stanza
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: all-perl
|
|
total: 9
|
|
|
|
coverage:
|
|
Stanza: full
|
|
|
|
# **********************************************************************************************************************************
|
|
# Integration tests
|
|
#
|
|
# Integration tests are not run in a container. They are expected to create their own containers since most integration runs will
|
|
# create more than one. For this reason each run is executed individually.
|
|
# **********************************************************************************************************************************
|
|
integration:
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: mock
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: stanza
|
|
total: 3
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: expire
|
|
total: 4
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: archive
|
|
total: 3
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: archive-stop
|
|
total: 7
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: all
|
|
total: 3
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: real
|
|
db: true
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: all
|
|
total: 6
|
|
|
|
# **********************************************************************************************************************************
|
|
# Performance tests
|
|
#
|
|
# Performance tests run in a single container but are more like integration tests than unit tests since they call the pgbackrest
|
|
# executable directly.
|
|
# **********************************************************************************************************************************
|
|
performance:
|
|
|
|
# ********************************************************************************************************************************
|
|
- name: performance
|
|
|
|
test:
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: archive
|
|
total: 1
|
|
|
|
# ----------------------------------------------------------------------------------------------------------------------------
|
|
- name: io
|
|
total: 1
|