Allow TAP tests to force checksums off when calling init()
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 14 Oct 2024 08:57:54 +0000 (10:57 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 14 Oct 2024 09:25:03 +0000 (11:25 +0200)
commite7d0cf42b1acb185edc947a8732843966ea3c160
tree8e06ed1c9773280751e05451faa4c2747d3df42b
parent199ad00e4b59a04263fd79fb115aecce2fb0851b
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
contrib/amcheck/t/001_verify_heapam.pl
src/bin/pg_amcheck/t/003_check.pl
src/bin/pg_amcheck/t/004_verify_heapam.pl
src/bin/pg_checksums/t/002_actions.pl
src/test/perl/PostgreSQL/Test/Cluster.pm