Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd5ab9a8

Browse files
committed
Simplify TAP tests of pg_dump for connection strings
The last set of scenarios did an initialization of nodes followed by anextra command to set up the authentication policy with pg_regress--config-auth. This configuration step can be integrated directly usingthe option auth_extra from PostgresNode::init when initializing thenode, saving from one extra command. On Windows, this also restrictsmore pg_ident.conf for the SSPI user mapping by removing the entry ofthe OS user running the test, which is not needed anyway.Note that IPC::Run mishandles double quotes, hence the restore user nameis changed to map with that. This was already done in the test as alater step, but not in a consistent way, causing the switch to useauth_extra to fail.Found while reviewingca129e5.Discussion:https://postgr.es/m/20190703062024.GD3084@paquier.xyz
1 parent8abc13a commitd5ab9a8

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

‎src/bin/pg_dump/t/010_dump_connstr.pl

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -171,21 +171,19 @@
171171
system_log('cat',$plain);
172172
my ($stderr,$result);
173173
my$restore_super =qq{regress_a'b\\c=d\\ne"f};
174+
$restore_super =~s/"//g
175+
if$TestLib::windows_os;# IPC::Run mishandles '"' on Windows
174176

175177

176178
# Restore full dump through psql using environment variables for
177179
# dbname/user connection parameters
178180

179181
my$envar_node = get_new_node('destination_envar');
180-
$envar_node->init(extra=>
181-
['-U',$dst_bootstrap_super,'--locale=C','--encoding=LATIN1' ]);
182-
$envar_node->run_log(
183-
[
184-
$ENV{PG_REGRESS},'--config-auth',
185-
$envar_node->data_dir,'--user',
186-
$dst_bootstrap_super,'--create-role',
187-
$restore_super
188-
]);
182+
$envar_node->init(
183+
extra=>
184+
['-U',$dst_bootstrap_super,'--locale=C','--encoding=LATIN1' ],
185+
auth_extra=>
186+
['--user',$dst_bootstrap_super,'--create-role',$restore_super ]);
189187
$envar_node->start;
190188

191189
# make superuser for restore
@@ -207,18 +205,12 @@
207205
# dbname/user connection parameters. "\connect dbname=" forgets
208206
# user/port from command line.
209207

210-
$restore_super =~s/"//g
211-
if$TestLib::windows_os;# IPC::Run mishandles '"' on Windows
212208
my$cmdline_node = get_new_node('destination_cmdline');
213-
$cmdline_node->init(extra=>
214-
['-U',$dst_bootstrap_super,'--locale=C','--encoding=LATIN1' ]);
215-
$cmdline_node->run_log(
216-
[
217-
$ENV{PG_REGRESS},'--config-auth',
218-
$cmdline_node->data_dir,'--user',
219-
$dst_bootstrap_super,'--create-role',
220-
$restore_super
221-
]);
209+
$cmdline_node->init(
210+
extra=>
211+
['-U',$dst_bootstrap_super,'--locale=C','--encoding=LATIN1' ],
212+
auth_extra=>
213+
['--user',$dst_bootstrap_super,'--create-role',$restore_super ]);
222214
$cmdline_node->start;
223215
$cmdline_node->run_log(
224216
['createuser','-U',$dst_bootstrap_super,'-s',$restore_super ]);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp