Skip to content
Snippets Groups Projects
Commit f3798089 authored by Noah Misch's avatar Noah Misch
Browse files

In the pg_upgrade test suite, remove and recreate "tmp_check".

This allows "vcregress upgradecheck" to pass twice in immediate
succession, and it's more like how $(prove_check) works.  Back-patch to
9.5, where pg_upgrade moved to src/bin.

Discussion: https://postgr.es/m/20190520012436.GA1480421@rfd.leadboat.com
parent 7ac46b1a
No related branches found
No related tags found
No related merge requests found
...@@ -66,6 +66,8 @@ export PGHOST ...@@ -66,6 +66,8 @@ export PGHOST
# don't rely on $PWD here, as old shells don't set it # don't rely on $PWD here, as old shells don't set it
temp_root=`pwd`/tmp_check temp_root=`pwd`/tmp_check
rm -rf "$temp_root"
mkdir "$temp_root"
if [ "$1" = '--install' ]; then if [ "$1" = '--install' ]; then
temp_install=$temp_root/install temp_install=$temp_root/install
...@@ -104,7 +106,6 @@ export PATH ...@@ -104,7 +106,6 @@ export PATH
BASE_PGDATA=$temp_root/data BASE_PGDATA=$temp_root/data
PGDATA="$BASE_PGDATA.old" PGDATA="$BASE_PGDATA.old"
export PGDATA export PGDATA
rm -rf "$BASE_PGDATA" "$PGDATA"
logdir=`pwd`/log logdir=`pwd`/log
rm -rf "$logdir" rm -rf "$logdir"
......
...@@ -488,7 +488,8 @@ sub upgradecheck ...@@ -488,7 +488,8 @@ sub upgradecheck
$ENV{PGHOST} = 'localhost'; $ENV{PGHOST} = 'localhost';
$ENV{PGPORT} ||= 50432; $ENV{PGPORT} ||= 50432;
my $tmp_root = "$topdir/src/bin/pg_upgrade/tmp_check"; my $tmp_root = "$topdir/src/bin/pg_upgrade/tmp_check";
(mkdir $tmp_root || die $!) unless -d $tmp_root; rmtree($tmp_root);
mkdir $tmp_root || die $!;
my $upg_tmp_install = "$tmp_root/install"; # unshared temp install my $upg_tmp_install = "$tmp_root/install"; # unshared temp install
print "Setting up temp install\n\n"; print "Setting up temp install\n\n";
Install($upg_tmp_install, "all", $config); Install($upg_tmp_install, "all", $config);
...@@ -501,7 +502,8 @@ sub upgradecheck ...@@ -501,7 +502,8 @@ sub upgradecheck
my $data = "$tmp_root/data"; my $data = "$tmp_root/data";
$ENV{PGDATA} = "$data.old"; $ENV{PGDATA} = "$data.old";
my $logdir = "$topdir/src/bin/pg_upgrade/log"; my $logdir = "$topdir/src/bin/pg_upgrade/log";
(mkdir $logdir || die $!) unless -d $logdir; rmtree($logdir);
mkdir $logdir || die $!;
print "\nRunning initdb on old cluster\n\n"; print "\nRunning initdb on old cluster\n\n";
standard_initdb() or exit 1; standard_initdb() or exit 1;
print "\nStarting old cluster\n\n"; print "\nStarting old cluster\n\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment