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

Commitca3f43a

Browse files
committed
Change TAP test framework to not rely on having a chmod executable.
This might not work at all on Windows, and is not ever efficient.Michael Paquier
1 parentb76e76b commitca3f43a

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

‎src/test/ssl/ServerSetup.pm

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,20 @@ sub copy_files
4343
}
4444
}
4545

46+
# Perform chmod on a set of files, taking into account wildcards
47+
subchmod_files
48+
{
49+
my$mode =shift;
50+
my$file_expr =shift;
51+
52+
my@all_files =glob$file_expr;
53+
foreachmy$file_entry (@all_files)
54+
{
55+
chmod$mode,$file_entry
56+
ordie"Could not run chmod with mode$mode on$file_entry";
57+
}
58+
}
59+
4660
subconfigure_test_server_for_ssl
4761
{
4862
my$tempdir =$_[0];
@@ -68,7 +82,7 @@ sub configure_test_server_for_ssl
6882
# Copy all server certificates and keys, and client root cert, to the data dir
6983
copy_files("ssl/server-*.crt","$tempdir/pgdata");
7084
copy_files("ssl/server-*.key","$tempdir/pgdata");
71-
system_or_bail"chmod0600 '$tempdir'/pgdata/server-*.key";
85+
chmod_files(0600,"$tempdir/pgdata/server-*.key");
7286
copy_files("ssl/root+client_ca.crt","$tempdir/pgdata");
7387
copy_files("ssl/root+client.crl","$tempdir/pgdata");
7488

‎src/test/ssl/t/001_ssltests.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ sub test_connect_fails
7878
# The client's private key must not be world-readable. Git doesn't track
7979
# permissions (except for the executable bit), so they might be wrong after
8080
# a checkout.
81-
system_or_bail"chmod 0600ssl/client.key";
81+
chmod 0600,"ssl/client.key";
8282

8383
#### Part 0. Set up the server.
8484

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp