diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2024-10-14 10:57:54 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2024-10-14 11:25:03 +0200 |
commit | e7d0cf42b1acb185edc947a8732843966ea3c160 (patch) | |
tree | 8e06ed1c9773280751e05451faa4c2747d3df42b /src/bin | |
parent | 199ad00e4b59a04263fd79fb115aecce2fb0851b (diff) | |
download | postgresql-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/bin')
-rw-r--r-- | src/bin/pg_amcheck/t/003_check.pl | 2 | ||||
-rw-r--r-- | src/bin/pg_amcheck/t/004_verify_heapam.pl | 2 | ||||
-rw-r--r-- | src/bin/pg_checksums/t/002_actions.pl | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/pg_amcheck/t/003_check.pl b/src/bin/pg_amcheck/t/003_check.pl index d99b094dba8..2b57c4dbac1 100644 --- a/src/bin/pg_amcheck/t/003_check.pl +++ b/src/bin/pg_amcheck/t/003_check.pl @@ -120,7 +120,7 @@ sub perform_all_corruptions() # Test set-up $node = PostgreSQL::Test::Cluster->new('test'); -$node->init; +$node->init(no_data_checksums => 1); $node->append_conf('postgresql.conf', 'autovacuum=off'); $node->start; $port = $node->port; diff --git a/src/bin/pg_amcheck/t/004_verify_heapam.pl b/src/bin/pg_amcheck/t/004_verify_heapam.pl index f6d2c5f7877..95fe6e6d3bd 100644 --- a/src/bin/pg_amcheck/t/004_verify_heapam.pl +++ b/src/bin/pg_amcheck/t/004_verify_heapam.pl @@ -181,7 +181,7 @@ my $aborted_xid; # autovacuum workers visiting the table could crash the backend. # Disable autovacuum so that won't happen. my $node = PostgreSQL::Test::Cluster->new('test'); -$node->init; +$node->init(no_data_checksums => 1); $node->append_conf('postgresql.conf', 'autovacuum=off'); $node->append_conf('postgresql.conf', 'max_prepared_transactions=10'); diff --git a/src/bin/pg_checksums/t/002_actions.pl b/src/bin/pg_checksums/t/002_actions.pl index 33e7fb53c5e..df926339909 100644 --- a/src/bin/pg_checksums/t/002_actions.pl +++ b/src/bin/pg_checksums/t/002_actions.pl @@ -88,7 +88,7 @@ sub check_relation_corruption # Initialize node with checksums disabled. my $node = PostgreSQL::Test::Cluster->new('node_checksum'); -$node->init(); +$node->init(no_data_checksums => 1); my $pgdata = $node->data_dir; # Control file should know that checksums are disabled. |