mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-03-19 20:00:51 +08:00
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
This commit is contained in:
parent
19c6e92b13
commit
3943f5cff6
@ -28,7 +28,7 @@ sub query_log
|
||||
}
|
||||
|
||||
my $node = PostgreSQL::Test::Cluster->new('main');
|
||||
$node->init('auth_extra' => [ '--create-role' => 'regress_user1' ]);
|
||||
$node->init(auth_extra => [ '--create-role' => 'regress_user1' ]);
|
||||
$node->append_conf('postgresql.conf',
|
||||
"session_preload_libraries = 'auto_explain'");
|
||||
$node->append_conf('postgresql.conf', "auto_explain.log_min_duration = 0");
|
||||
|
@ -24,8 +24,8 @@ my $node = PostgreSQL::Test::Cluster->new('primary');
|
||||
# Make sure pg_hba.conf is set up to allow connections from backupuser.
|
||||
# This is only needed on Windows machines that don't use UNIX sockets.
|
||||
$node->init(
|
||||
'allows_streaming' => 1,
|
||||
'auth_extra' => [ '--create-role' => 'backupuser' ]);
|
||||
allows_streaming => 1,
|
||||
auth_extra => [ '--create-role' => 'backupuser' ]);
|
||||
|
||||
$node->append_conf('postgresql.conf',
|
||||
"shared_preload_libraries = 'basebackup_to_shell'");
|
||||
|
@ -470,7 +470,7 @@ SKIP:
|
||||
$node2->init_from_backup(
|
||||
$node, 'tarbackup2',
|
||||
tar_program => $tar,
|
||||
'tablespace_map' => { $tblspcoid => $realRepTsDir });
|
||||
tablespace_map => { $tblspcoid => $realRepTsDir });
|
||||
|
||||
$node2->start;
|
||||
my $result = $node2->safe_psql('postgres', 'SELECT * FROM test1');
|
||||
|
@ -17,7 +17,7 @@ my @pg_basebackup_defs =
|
||||
|
||||
# Set up an instance.
|
||||
my $node = PostgreSQL::Test::Cluster->new('main');
|
||||
$node->init('allows_streaming' => 1);
|
||||
$node->init(allows_streaming => 1);
|
||||
$node->start();
|
||||
|
||||
# Create an in-place tablespace.
|
||||
|
@ -52,7 +52,7 @@ EOM
|
||||
# then stop recovery at some arbitrary LSN, not just when it hits the end of
|
||||
# WAL, so use a recovery target.
|
||||
my $node2 = PostgreSQL::Test::Cluster->new('node2');
|
||||
$node2->init_from_backup($node1, 'backup1', 'has_streaming' => 1);
|
||||
$node2->init_from_backup($node1, 'backup1', has_streaming => 1);
|
||||
$node2->append_conf('postgresql.conf', <<EOM);
|
||||
recovery_target_lsn = '$lsn'
|
||||
recovery_target_action = 'pause'
|
||||
|
@ -869,7 +869,7 @@ my %tests = (
|
||||
# Create a PG instance to test actually dumping from
|
||||
|
||||
my $node = PostgreSQL::Test::Cluster->new('main');
|
||||
$node->init('auth_extra' => [ '--create-role' => 'regress_dump_login_role' ]);
|
||||
$node->init(auth_extra => [ '--create-role' => 'regress_dump_login_role' ]);
|
||||
$node->start;
|
||||
|
||||
my $port = $node->port;
|
||||
|
@ -1019,7 +1019,7 @@ sub init_from_backup
|
||||
PostgreSQL::Test::RecursiveCopy::copypath(
|
||||
$backup_path,
|
||||
$data_path,
|
||||
'filterfn' => sub {
|
||||
filterfn => sub {
|
||||
my ($path) = @_;
|
||||
if ($path =~ /^pg_tblspc\/(\d+)$/
|
||||
&& exists $params{tablespace_map}{$1})
|
||||
|
@ -13,7 +13,7 @@ use Test::More;
|
||||
# Initialize the server with specific low connection limits
|
||||
my $node = PostgreSQL::Test::Cluster->new('primary');
|
||||
$node->init(
|
||||
'auth_extra' => [
|
||||
auth_extra => [
|
||||
'--create-role' =>
|
||||
'regress_regular,regress_reserved,regress_superuser',
|
||||
]);
|
||||
|
@ -71,8 +71,8 @@ my $md5_works = ($node->psql('postgres', "select md5('')") == 0);
|
||||
$ssl_server->configure_test_server_for_ssl(
|
||||
$node, $SERVERHOSTADDR, $SERVERHOSTCIDR,
|
||||
"scram-sha-256",
|
||||
'password' => "pass",
|
||||
'password_enc' => "scram-sha-256");
|
||||
password => "pass",
|
||||
password_enc => "scram-sha-256");
|
||||
switch_server_cert($node, certfile => 'server-cn-only');
|
||||
$ENV{PGPASSWORD} = "pass";
|
||||
$common_connstr =
|
||||
|
@ -186,9 +186,8 @@ foreach my $c (@cases)
|
||||
$result = $node->safe_psql(
|
||||
"trustdb",
|
||||
"SELECT ssl_client_cert_present();",
|
||||
connstr => "$common_connstr dbname=trustdb $c->{'opts'}");
|
||||
is($result, $c->{'present'},
|
||||
"ssl_client_cert_present() for $c->{'opts'}");
|
||||
connstr => "$common_connstr dbname=trustdb $c->{opts}");
|
||||
is($result, $c->{present}, "ssl_client_cert_present() for $c->{opts}");
|
||||
}
|
||||
|
||||
done_testing();
|
||||
|
Loading…
x
Reference in New Issue
Block a user