From b87a6bbb293deb94693774fa7b5c1e4918704f57 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 1 Dec 2022 15:36:12 +0100 Subject: [PATCH 2/2] pg_upgrade: Make testing different transfer modes easier It still requires a manual change in the test script, but now there is only one well-marked place to change. (Automatically running the pg_upgrade tests for all supported modes would be too slow.) --- src/bin/pg_upgrade/t/002_pg_upgrade.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bin/pg_upgrade/t/002_pg_upgrade.pl b/src/bin/pg_upgrade/t/002_pg_upgrade.pl index add6ea9c3437..365d81a8a380 100644 --- a/src/bin/pg_upgrade/t/002_pg_upgrade.pl +++ b/src/bin/pg_upgrade/t/002_pg_upgrade.pl @@ -12,6 +12,9 @@ use PostgreSQL::Test::Utils; use Test::More; +# Can be changed (manually) to test the other modes. +my $mode = '--copy'; + # Generate a database with a name made of a range of ASCII characters. sub generate_db { @@ -256,6 +259,7 @@ sub filter_dump '-s', $newnode->host, '-p', $oldnode->port, '-P', $newnode->port, + $mode, '--check' ], 'run of pg_upgrade --check for new instance with incorrect binary path'); @@ -270,6 +274,7 @@ sub filter_dump '-D', $newnode->data_dir, '-b', $oldbindir, '-B', $newbindir, '-s', $newnode->host, '-p', $oldnode->port, '-P', $newnode->port, + $mode, '--check' ], 'run of pg_upgrade --check for new instance'); @@ -282,7 +287,8 @@ sub filter_dump 'pg_upgrade', '--no-sync', '-d', $oldnode->data_dir, '-D', $newnode->data_dir, '-b', $oldbindir, '-B', $newbindir, '-s', $newnode->host, - '-p', $oldnode->port, '-P', $newnode->port + '-p', $oldnode->port, '-P', $newnode->port, + $mode, ], 'run of pg_upgrade for new instance'); ok( !-d $newnode->data_dir . "/pg_upgrade_output.d", -- 2.38.1