commit aa96ef028482fc026850363c776145687cc60fc4 Author: Anton A. Melnikov Date: Thu Jun 2 03:35:26 2022 +0300 Fix test for pg_upgrade from 10x versions. diff --git a/src/bin/pg_upgrade/t/002_pg_upgrade.pl b/src/bin/pg_upgrade/t/002_pg_upgrade.pl index 75ac768a96..e9b4977fee 100644 --- a/src/bin/pg_upgrade/t/002_pg_upgrade.pl +++ b/src/bin/pg_upgrade/t/002_pg_upgrade.pl @@ -1,5 +1,6 @@ # Set of tests for pg_upgrade, including cross-version checks. use strict; +use version; use warnings; use Cwd qw(abs_path getcwd); @@ -56,7 +57,13 @@ my $oldnode = # To increase coverage of non-standard segment size and group access without # increasing test runtime, run these tests with a custom setting. # --allow-group-access and --wal-segsize have been added in v11. -$oldnode->init(extra => [ '--wal-segsize', '1', '--allow-group-access' ]); +my ($oldverstr) = `$ENV{oldinstall}/bin/pg_ctl --version` =~ /(\d+\.\d+)/; +my ($oldver) = (version->parse(${oldverstr})); +$oldnode->init(extra => [ '--wal-segsize', '1', '--allow-group-access' ]) + if $oldver >= version->parse('11.0'); +$oldnode->init() + if $oldver < version->parse('11.0'); + $oldnode->start; # The default location of the source code is the root of this directory.