Skip to content

Commit 3943f5c

Browse files
committed
Fix inconsistent quoting for some options in TAP tests
This commit addresses some inconsistencies with how the options of some routines from PostgreSQL/Test/ are written, mainly for init() and init_from_backup() in Cluster.pm. These are written as unquoted, except in the locations updated here. Changes extracted from a larger patch by the same author. Author: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Discussion: https://postgr.es/m/87jz8rzf3h.fsf@wibble.ilmari.org
1 parent 19c6e92 commit 3943f5c

File tree

10 files changed

+13
-14
lines changed

10 files changed

+13
-14
lines changed

contrib/auto_explain/t/001_auto_explain.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ sub query_log
2828
}
2929

3030
my $node = PostgreSQL::Test::Cluster->new('main');
31-
$node->init('auth_extra' => [ '--create-role' => 'regress_user1' ]);
31+
$node->init(auth_extra => [ '--create-role' => 'regress_user1' ]);
3232
$node->append_conf('postgresql.conf',
3333
"session_preload_libraries = 'auto_explain'");
3434
$node->append_conf('postgresql.conf', "auto_explain.log_min_duration = 0");

contrib/basebackup_to_shell/t/001_basic.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
# Make sure pg_hba.conf is set up to allow connections from backupuser.
2525
# This is only needed on Windows machines that don't use UNIX sockets.
2626
$node->init(
27-
'allows_streaming' => 1,
28-
'auth_extra' => [ '--create-role' => 'backupuser' ]);
27+
allows_streaming => 1,
28+
auth_extra => [ '--create-role' => 'backupuser' ]);
2929

3030
$node->append_conf('postgresql.conf',
3131
"shared_preload_libraries = 'basebackup_to_shell'");

src/bin/pg_basebackup/t/010_pg_basebackup.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@
470470
$node2->init_from_backup(
471471
$node, 'tarbackup2',
472472
tar_program => $tar,
473-
'tablespace_map' => { $tblspcoid => $realRepTsDir });
473+
tablespace_map => { $tblspcoid => $realRepTsDir });
474474

475475
$node2->start;
476476
my $result = $node2->safe_psql('postgres', 'SELECT * FROM test1');

src/bin/pg_basebackup/t/011_in_place_tablespace.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
# Set up an instance.
1919
my $node = PostgreSQL::Test::Cluster->new('main');
20-
$node->init('allows_streaming' => 1);
20+
$node->init(allows_streaming => 1);
2121
$node->start();
2222

2323
# Create an in-place tablespace.

src/bin/pg_combinebackup/t/008_promote.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
# then stop recovery at some arbitrary LSN, not just when it hits the end of
5353
# WAL, so use a recovery target.
5454
my $node2 = PostgreSQL::Test::Cluster->new('node2');
55-
$node2->init_from_backup($node1, 'backup1', 'has_streaming' => 1);
55+
$node2->init_from_backup($node1, 'backup1', has_streaming => 1);
5656
$node2->append_conf('postgresql.conf', <<EOM);
5757
recovery_target_lsn = '$lsn'
5858
recovery_target_action = 'pause'

src/test/modules/test_pg_dump/t/001_base.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@
869869
# Create a PG instance to test actually dumping from
870870
871871
my $node = PostgreSQL::Test::Cluster->new('main');
872-
$node->init('auth_extra' => [ '--create-role' => 'regress_dump_login_role' ]);
872+
$node->init(auth_extra => [ '--create-role' => 'regress_dump_login_role' ]);
873873
$node->start;
874874
875875
my $port = $node->port;

src/test/perl/PostgreSQL/Test/Cluster.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ sub init_from_backup
10191019
PostgreSQL::Test::RecursiveCopy::copypath(
10201020
$backup_path,
10211021
$data_path,
1022-
'filterfn' => sub {
1022+
filterfn => sub {
10231023
my ($path) = @_;
10241024
if ($path =~ /^pg_tblspc\/(\d+)$/
10251025
&& exists $params{tablespace_map}{$1})

src/test/postmaster/t/002_connection_limits.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Initialize the server with specific low connection limits
1414
my $node = PostgreSQL::Test::Cluster->new('primary');
1515
$node->init(
16-
'auth_extra' => [
16+
auth_extra => [
1717
'--create-role' =>
1818
'regress_regular,regress_reserved,regress_superuser',
1919
]);

src/test/ssl/t/002_scram.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ sub switch_server_cert
7171
$ssl_server->configure_test_server_for_ssl(
7272
$node, $SERVERHOSTADDR, $SERVERHOSTCIDR,
7373
"scram-sha-256",
74-
'password' => "pass",
75-
'password_enc' => "scram-sha-256");
74+
password => "pass",
75+
password_enc => "scram-sha-256");
7676
switch_server_cert($node, certfile => 'server-cn-only');
7777
$ENV{PGPASSWORD} = "pass";
7878
$common_connstr =

src/test/ssl/t/003_sslinfo.pl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,8 @@ sub switch_server_cert
186186
$result = $node->safe_psql(
187187
"trustdb",
188188
"SELECT ssl_client_cert_present();",
189-
connstr => "$common_connstr dbname=trustdb $c->{'opts'}");
190-
is($result, $c->{'present'},
191-
"ssl_client_cert_present() for $c->{'opts'}");
189+
connstr => "$common_connstr dbname=trustdb $c->{opts}");
190+
is($result, $c->{present}, "ssl_client_cert_present() for $c->{opts}");
192191
}
193192

194193
done_testing();

0 commit comments

Comments
 (0)