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

Commit5d79b67

Browse files
committed
Make SSL regression test suite more portable by avoiding cp.
Use perl 'glob' and File::Copy instead of "cp". This takes us one stepcloser to running the suite on Windows.Michael Paquier
1 parent0fb256d commit5d79b67

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

‎src/test/ssl/ServerSetup.pm

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,29 @@ package ServerSetup;
1919
use strict;
2020
use warnings;
2121
use TestLib;
22+
use File::Basename;
23+
use File::Copy;
2224
use Test::More;
2325

2426
use Exporter'import';
2527
our@EXPORT =qw(
2628
configure_test_server_for_ssl switch_server_cert
2729
);
2830

31+
# Copy a set of files, taking into account wildcards
32+
subcopy_files
33+
{
34+
my$orig =shift;
35+
my$dest =shift;
36+
37+
my@orig_files =glob$orig;
38+
foreachmy$orig_file (@orig_files)
39+
{
40+
my$base_file = basename($orig_file);
41+
copy($orig_file,"$dest/$base_file")ordie"Could not copy$orig_file to$dest";
42+
}
43+
}
44+
2945
subconfigure_test_server_for_ssl
3046
{
3147
my$tempdir =$_[0];
@@ -48,13 +64,12 @@ sub configure_test_server_for_ssl
4864

4965
close CONF;
5066

51-
5267
# Copy all server certificates and keys, and client root cert, to the data dir
53-
system_or_bail"cpssl/server-*.crt '$tempdir'/pgdata";
54-
system_or_bail"cpssl/server-*.key '$tempdir'/pgdata";
68+
copy_files("ssl/server-*.crt","$tempdir/pgdata");
69+
copy_files("ssl/server-*.key","$tempdir/pgdata");
5570
system_or_bail"chmod 0600 '$tempdir'/pgdata/server-*.key";
56-
system_or_bail"cpssl/root+client_ca.crt '$tempdir'/pgdata";
57-
system_or_bail"cpssl/root+client.crl '$tempdir'/pgdata";
71+
copy_files("ssl/root+client_ca.crt","$tempdir/pgdata");
72+
copy_files("ssl/root+client.crl","$tempdir/pgdata");
5873

5974
# Only accept SSL connections from localhost. Our tests don't depend on this
6075
# but seems best to keep it as narrow as possible for security reasons.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp