aboutsummaryrefslogtreecommitdiff
path: root/src/test/perl/PostgreSQL/Test/Cluster.pm
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2024-10-14 10:57:54 +0200
committerPeter Eisentraut <peter@eisentraut.org>2024-10-14 11:25:03 +0200
commite7d0cf42b1acb185edc947a8732843966ea3c160 (patch)
tree8e06ed1c9773280751e05451faa4c2747d3df42b /src/test/perl/PostgreSQL/Test/Cluster.pm
parent199ad00e4b59a04263fd79fb115aecce2fb0851b (diff)
downloadpostgresql-e7d0cf42b1acb185edc947a8732843966ea3c160.tar.gz
postgresql-e7d0cf42b1acb185edc947a8732843966ea3c160.zip
Allow TAP tests to force checksums off when calling init()
TAP tests can write $node->init(no_data_checksums => 1); to initialize a cluster explicitly without checksums. Currently, this is the default, but this change allows running all tests with checksums enabled, like PG_TEST_INITDB_EXTRA_OPTS=--data-checksums meson test ... And this also prepares the tests for when we switch the default to checksums enabled. The pg_checksums tests need to disable checksums so it can test its own functionality of enabling checksums. The amcheck/pg_amcheck tests need to disable checksums because they manually introduce corruption that they want to detect, but with checksums enabled, the checksum verification will fail before they even get to their work. Author: Greg Sabino Mullane <greg@turnstep.com> Reviewed-by: Nathan Bossart <nathandbossart@gmail.com> Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Discussion: https://www.postgresql.org/message-id/flat/CAKAnmmKwiMHik5AHmBEdf5vqzbOBbcwEPHo4-PioWeAbzwcTOQ@mail.gmail.com
Diffstat (limited to 'src/test/perl/PostgreSQL/Test/Cluster.pm')
-rw-r--r--src/test/perl/PostgreSQL/Test/Cluster.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm
index 3f133cafbd9..110b53ba0dc 100644
--- a/src/test/perl/PostgreSQL/Test/Cluster.pm
+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm
@@ -586,6 +586,8 @@ On Windows, we use SSPI authentication to ensure the same (by pg_regress
WAL archiving can be enabled on this node by passing the keyword parameter
has_archiving => 1. This is disabled by default.
+Data checksums can be forced off by passing no_data_checksums => 1.
+
postgresql.conf can be set up for replication by passing the keyword
parameter allows_streaming => 'logical' or 'physical' (passing 1 will also
suffice for physical replication) depending on type of replication that
@@ -618,6 +620,12 @@ sub init
push @{ $params{extra} }, shellwords($initdb_extra_opts_env);
}
+ # This should override user-supplied initdb options.
+ if ($params{no_data_checksums})
+ {
+ push @{ $params{extra} }, '--no-data-checksums';
+ }
+
mkdir $self->backup_dir;
mkdir $self->archive_dir;