pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Change TAP test framework to not rely on having a chmod executab
3+ messages / 3 participants
[nested] [flat]
* pgsql: Change TAP test framework to not rely on having a chmod executab
@ 2015-06-19 14:52 Robert Haas <rhaas@postgresql.org>
0 siblings, 1 reply; 3+ messages in thread
From: Robert Haas @ 2015-06-19 14:52 UTC (permalink / raw)
To: pgsql-committers
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
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/ca3f43aa48a83013ea50aeee7cd193a5859c4587
Modified Files
--------------
src/test/ssl/ServerSetup.pm | 16 +++++++++++++++-
src/test/ssl/t/001_ssltests.pl | 2 +-
2 files changed, 16 insertions(+), 2 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [COMMITTERS] pgsql: Change TAP test framework to not rely on having a chmod executab
@ 2015-08-25 14:02 Peter Eisentraut <peter_e@gmx.net>
parent: Robert Haas <rhaas@postgresql.org>
0 siblings, 1 reply; 3+ messages in thread
From: Peter Eisentraut @ 2015-08-25 14:02 UTC (permalink / raw)
To: Michael Paquier <michael.paquier@gmail.com>; +Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
On 6/19/15 10:52 AM, Robert Haas wrote:
> 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
I came across this on an unrelated mission and noticed it was
unnecessarily complicated. How about this patch instead?
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
0001-Simplify-Perl-chmod-calls.patch (text/x-diff, 1.4K) download
From 3062d1ad69774f7dd68eb8f307997ae32d3535f2 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Tue, 25 Aug 2015 09:58:49 -0400
Subject: [PATCH] Simplify Perl chmod calls
The Perl chmod function already takes multiple file arguments, so we
don't need a separate looping function.
---
src/test/ssl/ServerSetup.pm | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/src/test/ssl/ServerSetup.pm b/src/test/ssl/ServerSetup.pm
index 8c1b517..a8228b0 100644
--- a/src/test/ssl/ServerSetup.pm
+++ b/src/test/ssl/ServerSetup.pm
@@ -43,20 +43,6 @@ sub copy_files
}
}
-# Perform chmod on a set of files, taking into account wildcards
-sub chmod_files
-{
- my $mode = shift;
- my $file_expr = shift;
-
- my @all_files = glob $file_expr;
- foreach my $file_entry (@all_files)
- {
- chmod $mode, $file_entry
- or die "Could not run chmod with mode $mode on $file_entry";
- }
-}
-
sub configure_test_server_for_ssl
{
my $tempdir = $_[0];
@@ -82,7 +68,7 @@ sub configure_test_server_for_ssl
# Copy all server certificates and keys, and client root cert, to the data dir
copy_files("ssl/server-*.crt", "$tempdir/pgdata");
copy_files("ssl/server-*.key", "$tempdir/pgdata");
- chmod_files(0600, "$tempdir/pgdata/server-*.key");
+ chmod(0600, glob "$tempdir/pgdata/server-*.key") or die $!;
copy_files("ssl/root+client_ca.crt", "$tempdir/pgdata");
copy_files("ssl/root+client.crl", "$tempdir/pgdata");
--
2.5.0
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [COMMITTERS] pgsql: Change TAP test framework to not rely on having a chmod executab
@ 2015-08-26 06:15 Michael Paquier <michael.paquier@gmail.com>
parent: Peter Eisentraut <peter_e@gmx.net>
0 siblings, 0 replies; 3+ messages in thread
From: Michael Paquier @ 2015-08-26 06:15 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
On Tue, Aug 25, 2015 at 11:02 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
> On 6/19/15 10:52 AM, Robert Haas wrote:
>> 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
>
> I came across this on an unrelated mission and noticed it was
> unnecessarily complicated. How about this patch instead?
I didn't know this one... Looking at the docs this would visibly work
at least down to 5.8.8, the docs saying that a list of files can be
passed to chmod:
http://perldoc.perl.org/5.8.8/functions/chmod.html
--
Michael
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2015-08-26 06:15 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-06-19 14:52 pgsql: Change TAP test framework to not rely on having a chmod executab Robert Haas <rhaas@postgresql.org>
2015-08-25 14:02 ` Peter Eisentraut <peter_e@gmx.net>
2015-08-26 06:15 ` Michael Paquier <michael.paquier@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox