mirror of
https://github.com/postgres/postgres.git
synced 2025-05-05 09:19:17 +03:00
Clean up pg_rewind regression test script.
Since commit 01f6bb4b2, TestLib.pm has exported path to tmp_check directory, so let's use that also for the pg_rewind test clusters etc. Also, in master, the $tempdir_short variable has not been used since commit 13d856e17, which moved the initdb-running code to TestLib.pm. Backpatch to 9.5.
This commit is contained in:
parent
642ae4ee7d
commit
2b917a58ae
@ -62,15 +62,8 @@ our @EXPORT = qw(
|
|||||||
clean_rewind_test
|
clean_rewind_test
|
||||||
);
|
);
|
||||||
|
|
||||||
# A temporary directory created with 'tempdir' is deleted automatically at
|
our $test_master_datadir = "$tmp_check/data_master";
|
||||||
# the end of the tests. You can change it to a constant if you need to keep it
|
our $test_standby_datadir = "$tmp_check/data_standby";
|
||||||
# for debugging purposes,
|
|
||||||
my $testroot = tempdir;
|
|
||||||
|
|
||||||
our $test_master_datadir = "$testroot/data_master";
|
|
||||||
our $test_standby_datadir = "$testroot/data_standby";
|
|
||||||
|
|
||||||
mkdir $testroot;
|
|
||||||
|
|
||||||
# Define non-conflicting ports for both nodes.
|
# Define non-conflicting ports for both nodes.
|
||||||
my $port_master = $ENV{PGPORT};
|
my $port_master = $ENV{PGPORT};
|
||||||
@ -273,9 +266,8 @@ sub run_pg_rewind
|
|||||||
|
|
||||||
# Keep a temporary postgresql.conf for master node or it would be
|
# Keep a temporary postgresql.conf for master node or it would be
|
||||||
# overwritten during the rewind.
|
# overwritten during the rewind.
|
||||||
copy(
|
copy("$test_master_datadir/postgresql.conf",
|
||||||
"$test_master_datadir/postgresql.conf",
|
"$tmp_check/master-postgresql.conf.tmp");
|
||||||
"$testroot/master-postgresql.conf.tmp");
|
|
||||||
|
|
||||||
# Now run pg_rewind
|
# Now run pg_rewind
|
||||||
if ($test_mode eq "local")
|
if ($test_mode eq "local")
|
||||||
@ -307,8 +299,7 @@ sub run_pg_rewind
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Now move back postgresql.conf with old settings
|
# Now move back postgresql.conf with old settings
|
||||||
move(
|
move("$tmp_check/master-postgresql.conf.tmp",
|
||||||
"$testroot/master-postgresql.conf.tmp",
|
|
||||||
"$test_master_datadir/postgresql.conf");
|
"$test_master_datadir/postgresql.conf");
|
||||||
|
|
||||||
# Plug-in rewound node to the now-promoted standby node
|
# Plug-in rewound node to the now-promoted standby node
|
||||||
|
Loading…
x
Reference in New Issue
Block a user