0002-Run-of-perltidy-for-previous-patch.patch
application/x-patch
Filename: 0002-Run-of-perltidy-for-previous-patch.patch
Type: application/x-patch
Part: 1
Patch
Format: format-patch
Series: patch 0002
Subject: Run of perltidy for previous patch
| File | + | − |
|---|---|---|
| src/bin/pg_basebackup/t/010_pg_basebackup.pl | 64 | 32 |
| src/bin/pg_ctl/t/001_start_stop.pl | 3 | 4 |
| src/bin/pg_rewind/RewindTest.pm | 34 | 27 |
| src/bin/scripts/t/010_clusterdb.pl | 4 | 3 |
| src/bin/scripts/t/020_createdb.pl | 2 | 1 |
| src/bin/scripts/t/030_createlang.pl | 2 | 4 |
| src/bin/scripts/t/040_createuser.pl | 2 | 1 |
| src/bin/scripts/t/050_dropdb.pl | 2 | 1 |
| src/bin/scripts/t/070_dropuser.pl | 2 | 1 |
| src/bin/scripts/t/090_reindexdb.pl | 1 | 1 |
| src/test/perl/PostgresNode.pm | 9 | 5 |
| src/test/perl/RecursiveCopy.pm | 2 | 2 |
| src/test/perl/TestLib.pm | 6 | 3 |
| src/test/ssl/t/001_ssltests.pl | 1 | 0 |
From 5474c9a8251462328c5879202b6f2d7adbb6f048 Mon Sep 17 00:00:00 2001
From: Michael Paquier <michael@otacoo.com>
Date: Wed, 2 Dec 2015 15:16:38 +0000
Subject: [PATCH 2/2] Run of perltidy for previous patch
---
src/bin/pg_basebackup/t/010_pg_basebackup.pl | 96 ++++++++++++++++++----------
src/bin/pg_ctl/t/001_start_stop.pl | 7 +-
src/bin/pg_rewind/RewindTest.pm | 61 ++++++++++--------
src/bin/scripts/t/010_clusterdb.pl | 7 +-
src/bin/scripts/t/020_createdb.pl | 3 +-
src/bin/scripts/t/030_createlang.pl | 6 +-
src/bin/scripts/t/040_createuser.pl | 3 +-
src/bin/scripts/t/050_dropdb.pl | 3 +-
src/bin/scripts/t/070_dropuser.pl | 3 +-
src/bin/scripts/t/090_reindexdb.pl | 2 +-
src/test/perl/PostgresNode.pm | 14 ++--
src/test/perl/RecursiveCopy.pm | 4 +-
src/test/perl/TestLib.pm | 9 ++-
src/test/ssl/t/001_ssltests.pl | 1 +
14 files changed, 134 insertions(+), 85 deletions(-)
diff --git a/src/bin/pg_basebackup/t/010_pg_basebackup.pl b/src/bin/pg_basebackup/t/010_pg_basebackup.pl
index 46c8a71..106606a 100644
--- a/src/bin/pg_basebackup/t/010_pg_basebackup.pl
+++ b/src/bin/pg_basebackup/t/010_pg_basebackup.pl
@@ -13,6 +13,7 @@ program_options_handling_ok('pg_basebackup');
my $tempdir = TestLib::tempdir;
my $node = get_new_node();
+
# Initialize node without replication settings
$node->init(hba_permit_replication => 0);
$node->start;
@@ -50,9 +51,10 @@ $node->command_ok([ 'pg_basebackup', '-D', "$tempdir/backup" ],
'pg_basebackup runs');
ok(-f "$tempdir/backup/PG_VERSION", 'backup was created');
-is_deeply([sort(slurp_dir("$tempdir/backup/pg_xlog/"))],
- [sort qw(. .. archive_status)],
- 'no WAL files copied');
+is_deeply(
+ [ sort(slurp_dir("$tempdir/backup/pg_xlog/")) ],
+ [ sort qw(. .. archive_status) ],
+ 'no WAL files copied');
$node->command_ok(
[ 'pg_basebackup', '-D', "$tempdir/backup2", '--xlogdir',
@@ -91,14 +93,16 @@ my $superlongpath = "$pgdata/$superlongname";
open FILE, ">$superlongpath" or die "unable to create file $superlongpath";
close FILE;
-$node->command_fails([ 'pg_basebackup', '-D', "$tempdir/tarbackup_l1", '-Ft' ],
+$node->command_fails(
+ [ 'pg_basebackup', '-D', "$tempdir/tarbackup_l1", '-Ft' ],
'pg_basebackup tar with long name fails');
unlink "$pgdata/$superlongname";
# The following tests test symlinks. Windows doesn't have symlinks, so
# skip on Windows.
-SKIP: {
- skip "symlinks not supported on Windows", 10 if ($windows_os);
+SKIP:
+{
+ skip "symlinks not supported on Windows", 10 if ($windows_os);
# Create a temporary directory in the system location and symlink it
# to our physical temp location. That way we can use shorter names
@@ -109,10 +113,10 @@ SKIP: {
mkdir "$tempdir/tblspc1";
$node->psql('postgres',
- "CREATE TABLESPACE tblspc1 LOCATION '$shorter_tempdir/tblspc1';");
+ "CREATE TABLESPACE tblspc1 LOCATION '$shorter_tempdir/tblspc1';");
$node->psql('postgres', "CREATE TABLE test1 (a int) TABLESPACE tblspc1;");
$node->command_ok([ 'pg_basebackup', '-D', "$tempdir/tarbackup2", '-Ft' ],
- 'tar format with tablespaces');
+ 'tar format with tablespaces');
ok(-f "$tempdir/tarbackup2/base.tar", 'backup tar was created');
my @tblspc_tars = glob "$tempdir/tarbackup2/[0-9]*.tar";
is(scalar(@tblspc_tars), 1, 'one tablespace tar was created');
@@ -128,9 +132,9 @@ SKIP: {
ok(-d "$tempdir/tbackup/tblspc1", 'tablespace was relocated');
opendir(my $dh, "$pgdata/pg_tblspc") or die;
ok( ( grep {
- -l "$tempdir/backup1/pg_tblspc/$_"
- and readlink "$tempdir/backup1/pg_tblspc/$_" eq
- "$tempdir/tbackup/tblspc1"
+ -l "$tempdir/backup1/pg_tblspc/$_"
+ and readlink "$tempdir/backup1/pg_tblspc/$_" eq
+ "$tempdir/tbackup/tblspc1"
} readdir($dh)),
"tablespace symlink was updated");
closedir $dh;
@@ -139,19 +143,21 @@ SKIP: {
$node->psql('postgres', "DROP TABLE test1;");
$node->psql('postgres', "DROP TABLESPACE tblspc1;");
$node->psql('postgres',
- "CREATE TABLESPACE tblspc2 LOCATION '$shorter_tempdir/tbl=spc2';");
+ "CREATE TABLESPACE tblspc2 LOCATION '$shorter_tempdir/tbl=spc2';");
$node->command_ok(
[ 'pg_basebackup', '-D', "$tempdir/backup3", '-Fp',
"-T$shorter_tempdir/tbl\\=spc2=$tempdir/tbackup/tbl\\=spc2" ],
'mapping tablespace with = sign in path');
- ok(-d "$tempdir/tbackup/tbl=spc2", 'tablespace with = sign was relocated');
+ ok(-d "$tempdir/tbackup/tbl=spc2",
+ 'tablespace with = sign was relocated');
$node->psql('postgres', "DROP TABLESPACE tblspc2;");
mkdir "$tempdir/$superlongname";
$node->psql('postgres',
- "CREATE TABLESPACE tblspc3 LOCATION '$tempdir/$superlongname';");
- $node->command_ok([ 'pg_basebackup', '-D', "$tempdir/tarbackup_l3", '-Ft' ],
- 'pg_basebackup tar with long symlink target');
+ "CREATE TABLESPACE tblspc3 LOCATION '$tempdir/$superlongname';");
+ $node->command_ok(
+ [ 'pg_basebackup', '-D', "$tempdir/tarbackup_l3", '-Ft' ],
+ 'pg_basebackup tar with long symlink target');
$node->psql('postgres', "DROP TABLESPACE tblspc3;");
}
@@ -159,33 +165,59 @@ $node->command_ok([ 'pg_basebackup', '-D', "$tempdir/backupR", '-R' ],
'pg_basebackup -R runs');
ok(-f "$tempdir/backupR/recovery.conf", 'recovery.conf was created');
my $recovery_conf = slurp_file "$tempdir/backupR/recovery.conf";
+
# using a character class for the final "'" here works around an apparent
# bug in several version of the Msys DTK perl
-like($recovery_conf, qr/^standby_mode = 'on[']$/m, 'recovery.conf sets standby_mode');
-like($recovery_conf, qr/^primary_conninfo = '.*port=$ENV{PGPORT}.*'$/m, 'recovery.conf sets primary_conninfo');
+like(
+ $recovery_conf,
+ qr/^standby_mode = 'on[']$/m,
+ 'recovery.conf sets standby_mode');
+like(
+ $recovery_conf,
+ qr/^primary_conninfo = '.*port=$ENV{PGPORT}.*'$/m,
+ 'recovery.conf sets primary_conninfo');
-$node->command_ok([ 'pg_basebackup', '-D', "$tempdir/backupxf", '-X', 'fetch' ],
+$node->command_ok(
+ [ 'pg_basebackup', '-D', "$tempdir/backupxf", '-X', 'fetch' ],
'pg_basebackup -X fetch runs');
-ok(grep(/^[0-9A-F]{24}$/, slurp_dir("$tempdir/backupxf/pg_xlog")), 'WAL files copied');
-$node->command_ok([ 'pg_basebackup', '-D', "$tempdir/backupxs", '-X', 'stream' ],
+ok(grep(/^[0-9A-F]{24}$/, slurp_dir("$tempdir/backupxf/pg_xlog")),
+ 'WAL files copied');
+$node->command_ok(
+ [ 'pg_basebackup', '-D', "$tempdir/backupxs", '-X', 'stream' ],
'pg_basebackup -X stream runs');
-ok(grep(/^[0-9A-F]{24}$/, slurp_dir("$tempdir/backupxf/pg_xlog")), 'WAL files copied');
+ok(grep(/^[0-9A-F]{24}$/, slurp_dir("$tempdir/backupxf/pg_xlog")),
+ 'WAL files copied');
-$node->command_fails([ 'pg_basebackup', '-D', "$tempdir/fail", '-S', 'slot1' ],
+$node->command_fails(
+ [ 'pg_basebackup', '-D', "$tempdir/fail", '-S', 'slot1' ],
'pg_basebackup with replication slot fails without -X stream');
-$node->command_fails([ 'pg_basebackup', '-D', "$tempdir/backupxs_sl_fail", '-X', 'stream', '-S', 'slot1' ],
+$node->command_fails(
+ [ 'pg_basebackup', '-D',
+ "$tempdir/backupxs_sl_fail", '-X',
+ 'stream', '-S',
+ 'slot1' ],
'pg_basebackup fails with nonexistent replication slot');
-$node->psql('postgres', q{SELECT * FROM pg_create_physical_replication_slot('slot1')});
-my $lsn = $node->psql('postgres', q{SELECT restart_lsn FROM pg_replication_slots WHERE slot_name = 'slot1'});
+$node->psql('postgres',
+ q{SELECT * FROM pg_create_physical_replication_slot('slot1')});
+my $lsn = $node->psql('postgres',
+ q{SELECT restart_lsn FROM pg_replication_slots WHERE slot_name = 'slot1'}
+);
is($lsn, '', 'restart LSN of new slot is null');
-$node->command_ok([ 'pg_basebackup', '-D', "$tempdir/backupxs_sl", '-X', 'stream', '-S', 'slot1' ],
+$node->command_ok(
+ [ 'pg_basebackup', '-D', "$tempdir/backupxs_sl", '-X',
+ 'stream', '-S', 'slot1' ],
'pg_basebackup -X stream with replication slot runs');
-$lsn = $node->psql('postgres', q{SELECT restart_lsn FROM pg_replication_slots WHERE slot_name = 'slot1'});
+$lsn = $node->psql('postgres',
+ q{SELECT restart_lsn FROM pg_replication_slots WHERE slot_name = 'slot1'}
+);
like($lsn, qr!^0/[0-9A-Z]{7,8}$!, 'restart LSN of slot has advanced');
-$node->command_ok([ 'pg_basebackup', '-D', "$tempdir/backupxs_sl_R", '-X', 'stream', '-S', 'slot1', '-R' ],
+$node->command_ok(
+ [ 'pg_basebackup', '-D', "$tempdir/backupxs_sl_R", '-X',
+ 'stream', '-S', 'slot1', '-R' ],
'pg_basebackup with replication slot and -R runs');
-like(slurp_file("$tempdir/backupxs_sl_R/recovery.conf"),
- qr/^primary_slot_name = 'slot1'$/m,
- 'recovery.conf sets primary_slot_name');
+like(
+ slurp_file("$tempdir/backupxs_sl_R/recovery.conf"),
+ qr/^primary_slot_name = 'slot1'$/m,
+ 'recovery.conf sets primary_slot_name');
diff --git a/src/bin/pg_ctl/t/001_start_stop.pl b/src/bin/pg_ctl/t/001_start_stop.pl
index a224ece..cbe99d7 100644
--- a/src/bin/pg_ctl/t/001_start_stop.pl
+++ b/src/bin/pg_ctl/t/001_start_stop.pl
@@ -18,13 +18,11 @@ command_exit_is([ 'pg_ctl', 'start', '-D', "$tempdir/nonexistent" ],
command_ok([ 'pg_ctl', 'initdb', '-D', "$tempdir/data", '-o', '-N' ],
'pg_ctl initdb');
-command_ok(
- [ $ENV{PG_REGRESS}, '--config-auth',
- "$tempdir/data" ],
+command_ok([ $ENV{PG_REGRESS}, '--config-auth', "$tempdir/data" ],
'configure authentication');
open CONF, ">>$tempdir/data/postgresql.conf";
print CONF "fsync = off\n";
-if (! $windows_os)
+if (!$windows_os)
{
print CONF "listen_addresses = ''\n";
print CONF "unix_socket_directories = '$tempdir_short'\n";
@@ -36,6 +34,7 @@ else
close CONF;
command_ok([ 'pg_ctl', 'start', '-D', "$tempdir/data", '-w' ],
'pg_ctl start -w');
+
# sleep here is because Windows builds can't check postmaster.pid exactly,
# so they may mistake a pre-existing postmaster.pid for one created by the
# postmaster they start. Waiting more than the 2 seconds slop time allowed
diff --git a/src/bin/pg_rewind/RewindTest.pm b/src/bin/pg_rewind/RewindTest.pm
index 55bbc9c..f2c0ca9 100644
--- a/src/bin/pg_rewind/RewindTest.pm
+++ b/src/bin/pg_rewind/RewindTest.pm
@@ -77,7 +77,7 @@ sub standby_psql
my $cmd = shift;
system_or_bail 'psql', '-q', '--no-psqlrc', '-d',
- $node_standby->connstr('postgres'), '-c', "$cmd";
+ $node_standby->connstr('postgres'), '-c', "$cmd";
}
# Run a query against the master, and check that the output matches what's
@@ -89,8 +89,9 @@ sub check_query
# we want just the output, no formatting
my $result = IPC::Run::run [
- 'psql', '-q', '-A', '-t', '--no-psqlrc', '-d',
- $node_master->connstr('postgres'), '-c', $query ],
+ 'psql', '-q', '-A', '-t', '--no-psqlrc', '-d',
+ $node_master->connstr('postgres'),
+ '-c', $query ],
'>', \$stdout, '2>', \$stderr;
# We don't use ok() for the exit code and stderr, because we want this
@@ -118,7 +119,8 @@ sub setup_cluster
$node_master->init;
# Custom parameters for master's postgresql.conf
- $node_master->append_conf("postgresql.conf", qq(
+ $node_master->append_conf(
+ "postgresql.conf", qq(
wal_level = hot_standby
max_wal_senders = 2
wal_keep_segments = 20
@@ -146,7 +148,8 @@ sub create_standby
$node_standby->init_from_backup($node_master, 'my_backup');
my $connstr_master = $node_master->connstr('postgres');
- $node_standby->append_conf("recovery.conf", qq(
+ $node_standby->append_conf(
+ "recovery.conf", qq(
primary_conninfo='$connstr_master application_name=rewind_standby'
standby_mode=on
recovery_target_timeline='latest'
@@ -174,7 +177,8 @@ sub promote_standby
# the master out-of-sync with the standby. Wait until the standby is
# out of recovery mode, and is ready to accept read-write connections.
system_or_bail('pg_ctl', '-w', '-D', $node_standby->data_dir, 'promote');
- $node_standby->poll_query_until('postgres', "SELECT NOT pg_is_in_recovery()")
+ $node_standby->poll_query_until('postgres',
+ "SELECT NOT pg_is_in_recovery()")
or die "Timed out while waiting for promotion of standby";
# Force a checkpoint after the promotion. pg_rewind looks at the control
@@ -188,11 +192,11 @@ sub promote_standby
sub run_pg_rewind
{
- my $test_mode = shift;
- my $master_pgdata = $node_master->data_dir;
- my $standby_pgdata = $node_standby->data_dir;
+ my $test_mode = shift;
+ my $master_pgdata = $node_master->data_dir;
+ my $standby_pgdata = $node_standby->data_dir;
my $standby_connstr = $node_standby->connstr('postgres');
- my $tmp_folder = TestLib::tempdir;
+ my $tmp_folder = TestLib::tempdir;
# Stop the master and be ready to perform the rewind
$node_master->stop;
@@ -204,8 +208,9 @@ sub run_pg_rewind
# Keep a temporary postgresql.conf for master node or it would be
# overwritten during the rewind.
- copy("$master_pgdata/postgresql.conf",
- "$tmp_folder/master-postgresql.conf.tmp");
+ copy(
+ "$master_pgdata/postgresql.conf",
+ "$tmp_folder/master-postgresql.conf.tmp");
# Now run pg_rewind
if ($test_mode eq "local")
@@ -213,21 +218,21 @@ sub run_pg_rewind
# Do rewind using a local pgdata as source
# Stop the master and be ready to perform the rewind
$node_standby->stop;
- command_ok(['pg_rewind',
- "--debug",
- "--source-pgdata=$standby_pgdata",
- "--target-pgdata=$master_pgdata"],
- 'pg_rewind local');
+ command_ok(
+ [ 'pg_rewind',
+ "--debug",
+ "--source-pgdata=$standby_pgdata",
+ "--target-pgdata=$master_pgdata" ],
+ 'pg_rewind local');
}
elsif ($test_mode eq "remote")
{
# Do rewind using a remote connection as source
- command_ok(['pg_rewind',
- "--debug",
- "--source-server",
- $standby_connstr,
- "--target-pgdata=$master_pgdata"],
- 'pg_rewind remote');
+ command_ok(
+ [ 'pg_rewind', "--debug",
+ "--source-server", $standby_connstr,
+ "--target-pgdata=$master_pgdata" ],
+ 'pg_rewind remote');
}
else
{
@@ -236,12 +241,14 @@ sub run_pg_rewind
}
# Now move back postgresql.conf with old settings
- move("$tmp_folder/master-postgresql.conf.tmp",
- "$master_pgdata/postgresql.conf");
+ move(
+ "$tmp_folder/master-postgresql.conf.tmp",
+ "$master_pgdata/postgresql.conf");
# Plug-in rewound node to the now-promoted standby node
my $port_standby = $node_standby->port;
- $node_master->append_conf('recovery.conf', qq(
+ $node_master->append_conf(
+ 'recovery.conf', qq(
primary_conninfo='port=$port_standby'
standby_mode=on
recovery_target_timeline='latest'
@@ -256,7 +263,7 @@ recovery_target_timeline='latest'
# Clean up after the test. Stop both servers, if they're still running.
sub clean_rewind_test
{
- $node_master->teardown_node if defined $node_master;
+ $node_master->teardown_node if defined $node_master;
$node_standby->teardown_node if defined $node_standby;
}
diff --git a/src/bin/scripts/t/010_clusterdb.pl b/src/bin/scripts/t/010_clusterdb.pl
index bdb140f..5131b35 100644
--- a/src/bin/scripts/t/010_clusterdb.pl
+++ b/src/bin/scripts/t/010_clusterdb.pl
@@ -14,15 +14,16 @@ $node->init;
$node->start;
$node->issues_sql_like(
- [ 'clusterdb' ],
+ ['clusterdb'],
qr/statement: CLUSTER;/,
'SQL CLUSTER run');
$node->command_fails([ 'clusterdb', '-t', 'nonexistent' ],
- 'fails with nonexistent table');
+ 'fails with nonexistent table');
$node->psql('postgres',
- 'CREATE TABLE test1 (a int); CREATE INDEX test1x ON test1 (a); CLUSTER test1 USING test1x');
+'CREATE TABLE test1 (a int); CREATE INDEX test1x ON test1 (a); CLUSTER test1 USING test1x'
+);
$node->issues_sql_like(
[ 'clusterdb', '-t', 'test1' ],
qr/statement: CLUSTER test1;/,
diff --git a/src/bin/scripts/t/020_createdb.pl b/src/bin/scripts/t/020_createdb.pl
index 840c1b3..e0cf860 100644
--- a/src/bin/scripts/t/020_createdb.pl
+++ b/src/bin/scripts/t/020_createdb.pl
@@ -22,4 +22,5 @@ $node->issues_sql_like(
qr/statement: CREATE DATABASE foobar2 ENCODING 'LATIN1'/,
'create database with encoding');
-$node->command_fails([ 'createdb', 'foobar1' ], 'fails if database already exists');
+$node->command_fails([ 'createdb', 'foobar1' ],
+ 'fails if database already exists');
diff --git a/src/bin/scripts/t/030_createlang.pl b/src/bin/scripts/t/030_createlang.pl
index 6d14c98..8ad391d 100644
--- a/src/bin/scripts/t/030_createlang.pl
+++ b/src/bin/scripts/t/030_createlang.pl
@@ -15,8 +15,7 @@ $node->start;
$ENV{PGDATABASE} = 'postgres';
-$node->command_fails(
- [ 'createlang', 'plpgsql' ],
+$node->command_fails([ 'createlang', 'plpgsql' ],
'fails if language already exists');
$node->psql('postgres', 'DROP EXTENSION plpgsql');
@@ -25,5 +24,4 @@ $node->issues_sql_like(
qr/statement: CREATE EXTENSION "plpgsql"/,
'SQL CREATE EXTENSION run');
-$node->command_like([ 'createlang', '--list' ],
- qr/plpgsql/, 'list output');
+$node->command_like([ 'createlang', '--list' ], qr/plpgsql/, 'list output');
diff --git a/src/bin/scripts/t/040_createuser.pl b/src/bin/scripts/t/040_createuser.pl
index ac08fde..fcada63 100644
--- a/src/bin/scripts/t/040_createuser.pl
+++ b/src/bin/scripts/t/040_createuser.pl
@@ -30,4 +30,5 @@ $node->issues_sql_like(
qr/statement: CREATE ROLE user3 SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;/,
'create a superuser');
-$node->command_fails([ 'createuser', 'user1' ], 'fails if role already exists');
+$node->command_fails([ 'createuser', 'user1' ],
+ 'fails if role already exists');
diff --git a/src/bin/scripts/t/050_dropdb.pl b/src/bin/scripts/t/050_dropdb.pl
index fb4feb8..2adc80a 100644
--- a/src/bin/scripts/t/050_dropdb.pl
+++ b/src/bin/scripts/t/050_dropdb.pl
@@ -19,4 +19,5 @@ $node->issues_sql_like(
qr/statement: DROP DATABASE foobar1/,
'SQL DROP DATABASE run');
-$node->command_fails([ 'dropdb', 'nonexistent' ], 'fails with nonexistent database');
+$node->command_fails([ 'dropdb', 'nonexistent' ],
+ 'fails with nonexistent database');
diff --git a/src/bin/scripts/t/070_dropuser.pl b/src/bin/scripts/t/070_dropuser.pl
index 6e87f1e..0849f77 100644
--- a/src/bin/scripts/t/070_dropuser.pl
+++ b/src/bin/scripts/t/070_dropuser.pl
@@ -19,4 +19,5 @@ $node->issues_sql_like(
qr/statement: DROP ROLE foobar1/,
'SQL DROP ROLE run');
-$node->command_fails([ 'dropuser', 'nonexistent' ], 'fails with nonexistent user');
+$node->command_fails([ 'dropuser', 'nonexistent' ],
+ 'fails with nonexistent user');
diff --git a/src/bin/scripts/t/090_reindexdb.pl b/src/bin/scripts/t/090_reindexdb.pl
index 68b2291..fd4eac3 100644
--- a/src/bin/scripts/t/090_reindexdb.pl
+++ b/src/bin/scripts/t/090_reindexdb.pl
@@ -21,7 +21,7 @@ $node->issues_sql_like(
'SQL REINDEX run');
$node->psql('postgres',
- 'CREATE TABLE test1 (a int); CREATE INDEX test1x ON test1 (a);');
+ 'CREATE TABLE test1 (a int); CREATE INDEX test1x ON test1 (a);');
$node->issues_sql_like(
[ 'reindexdb', '-t', 'test1', 'postgres' ],
qr/statement: REINDEX TABLE test1;/,
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index c182ce7..56628bf 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -176,7 +176,8 @@ sub init
my $pgdata = $self->data_dir;
my $host = $self->host;
- $params{hba_permit_replication} = 1 if (!defined($params{hba_permit_replication}));
+ $params{hba_permit_replication} = 1
+ if (!defined($params{hba_permit_replication}));
mkdir $self->backup_dir;
mkdir $self->archive_dir;
@@ -243,7 +244,8 @@ sub init_from_backup
chmod(0700, $data_path);
# Base configuration for this node
- $self->append_conf('postgresql.conf',
+ $self->append_conf(
+ 'postgresql.conf',
qq(
port = $port
));
@@ -380,8 +382,9 @@ sub psql
my ($stdout, $stderr);
print("# Running SQL command: $sql\n");
- IPC::Run::run [ 'psql', '-XAtq', '-d', $self->connstr($dbname), '-f', '-' ],
- '<', \$sql, '>', \$stdout, '2>', \$stderr or die;
+ IPC::Run::run [ 'psql', '-XAtq', '-d', $self->connstr($dbname), '-f',
+ '-' ], '<', \$sql, '>', \$stdout, '2>', \$stderr
+ or die;
if ($stderr ne "")
{
@@ -405,7 +408,8 @@ sub poll_query_until
while ($attempts < $max_attempts)
{
- my $cmd = [ 'psql', '-At', '-c', $query, '-d', $self->connstr($dbname) ];
+ my $cmd =
+ [ 'psql', '-At', '-c', $query, '-d', $self->connstr($dbname) ];
my $result = IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr;
chomp($stdout);
diff --git a/src/test/perl/RecursiveCopy.pm b/src/test/perl/RecursiveCopy.pm
index 4e58ad3..9362aa8 100644
--- a/src/test/perl/RecursiveCopy.pm
+++ b/src/test/perl/RecursiveCopy.pm
@@ -20,7 +20,7 @@ sub copypath
if (-f $srcpath)
{
copy($srcpath, $destpath)
- or die "copy $srcpath -> $destpath failed: $!";
+ or die "copy $srcpath -> $destpath failed: $!";
return 1;
}
@@ -33,7 +33,7 @@ sub copypath
{
next if ($entry eq '.' || $entry eq '..');
RecursiveCopy::copypath("$srcpath/$entry", "$destpath/$entry")
- or die "copypath $srcpath/$entry -> $destpath/$entry failed";
+ or die "copypath $srcpath/$entry -> $destpath/$entry failed";
}
closedir($directory);
return 1;
diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm
index 3a01b7a..b4f1080 100644
--- a/src/test/perl/TestLib.pm
+++ b/src/test/perl/TestLib.pm
@@ -214,7 +214,8 @@ sub program_help_ok
my ($cmd) = @_;
my ($stdout, $stderr);
print("# Running: $cmd --help\n");
- my $result = IPC::Run::run [ $cmd, '--help' ], '>', \$stdout, '2>', \$stderr;
+ my $result = IPC::Run::run [ $cmd, '--help' ], '>', \$stdout, '2>',
+ \$stderr;
ok($result, "$cmd --help exit code 0");
isnt($stdout, '', "$cmd --help goes to stdout");
is($stderr, '', "$cmd --help nothing to stderr");
@@ -225,7 +226,8 @@ sub program_version_ok
my ($cmd) = @_;
my ($stdout, $stderr);
print("# Running: $cmd --version\n");
- my $result = IPC::Run::run [ $cmd, '--version' ], '>', \$stdout, '2>', \$stderr;
+ my $result = IPC::Run::run [ $cmd, '--version' ], '>', \$stdout, '2>',
+ \$stderr;
ok($result, "$cmd --version exit code 0");
isnt($stdout, '', "$cmd --version goes to stdout");
is($stderr, '', "$cmd --version nothing to stderr");
@@ -236,7 +238,8 @@ sub program_options_handling_ok
my ($cmd) = @_;
my ($stdout, $stderr);
print("# Running: $cmd --not-a-valid-option\n");
- my $result = IPC::Run::run [ $cmd, '--not-a-valid-option' ], '>', \$stdout,
+ my $result = IPC::Run::run [ $cmd, '--not-a-valid-option' ], '>',
+ \$stdout,
'2>', \$stderr;
ok(!$result, "$cmd with invalid option nonzero exit code");
isnt($stderr, '', "$cmd with invalid option prints error message");
diff --git a/src/test/ssl/t/001_ssltests.pl b/src/test/ssl/t/001_ssltests.pl
index dcc541d..92f16e4 100644
--- a/src/test/ssl/t/001_ssltests.pl
+++ b/src/test/ssl/t/001_ssltests.pl
@@ -77,6 +77,7 @@ chmod 0600, "ssl/client.key";
diag "setting up data directory...";
my $node = get_new_node();
$node->init;
+
# PGHOST is enforced here to set up the node, subsequent connections
# will use a dedicated connection string.
$ENV{PGHOST} = $node->host;
--
2.6.3