pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Michael Paquier <michael@paquier.xyz>
To: Jacob Champion <pchampion@vmware.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Proposal: Save user's original authenticated identity for logging
Date: Wed, 22 Sep 2021 08:59:38 +0200
Message-ID: <ae1143fb-455c-c80f-ed66-78d45bd93303@enterprisedb.com> (raw)
In-Reply-To: <YGhf4TN6ukOZTUcd@paquier.xyz>
References: <ce72fb588e21a283fb20789faa4da750fea2975a.camel@vmware.com>
	<YGGG1jJkkqCvI5pg@paquier.xyz>
	<4a87886f034c713c056c43850f55e6e0ba50d8b5.camel@vmware.com>
	<YGJ3FoOfgSao9Cv8@paquier.xyz>
	<e0f0484a1815b26bb99ef9ddc7a110dfd6425931.camel@vmware.com>
	<a4fddbcd2f99c293991b7669bd0da3e5a7d3f93b.camel@vmware.com>
	<YGQk74rdCdb8F9gZ@paquier.xyz>
	<YGUgHMF9zxNvY323@paquier.xyz>
	<d17b919e27474abfa55d97786cb9cfadfe2b59e9.camel@vmware.com>
	<YGaha/euiRjZ820X@paquier.xyz>
	<YGhf4TN6ukOZTUcd@paquier.xyz>

On 03.04.21 14:30, Michael Paquier wrote:
> On Fri, Apr 02, 2021 at 01:45:31PM +0900, Michael Paquier wrote:
>> As a whole, this is a consolidation of its own, so let's apply this
>> part first.
> 
> Slight rebase for this one to take care of the updates with the SSL
> error messages.

I noticed this patch eliminated one $Test::Builder::Level assignment. 
Was there a reason for this?

I think we should add it back, and also add a few missing ones in 
similar places.  See attached patch.
From e9ce373a0482799dc37a695058fc2ca4370f33d1 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Wed, 22 Sep 2021 08:58:07 +0200
Subject: [PATCH] Add missing $Test::Builder::Level settings

---
 src/test/authentication/t/001_password.pl | 2 ++
 src/test/authentication/t/002_saslprep.pl | 2 ++
 src/test/kerberos/t/001_auth.pl           | 2 ++
 src/test/ldap/t/001_auth.pl               | 2 ++
 4 files changed, 8 insertions(+)

diff --git a/src/test/authentication/t/001_password.pl b/src/test/authentication/t/001_password.pl
index 427a360198..1296c5307a 100644
--- a/src/test/authentication/t/001_password.pl
+++ b/src/test/authentication/t/001_password.pl
@@ -42,6 +42,8 @@ sub reset_pg_hba
 # named parameters are passed to connect_ok/fails as-is.
 sub test_role
 {
+	local $Test::Builder::Level = $Test::Builder::Level + 1;
+
 	my ($node, $role, $method, $expected_res, %params) = @_;
 	my $status_string = 'failed';
 	$status_string = 'success' if ($expected_res eq 0);
diff --git a/src/test/authentication/t/002_saslprep.pl b/src/test/authentication/t/002_saslprep.pl
index f080a0ccba..5b8b4b28e7 100644
--- a/src/test/authentication/t/002_saslprep.pl
+++ b/src/test/authentication/t/002_saslprep.pl
@@ -36,6 +36,8 @@ sub reset_pg_hba
 # Test access for a single role, useful to wrap all tests into one.
 sub test_login
 {
+	local $Test::Builder::Level = $Test::Builder::Level + 1;
+
 	my $node          = shift;
 	my $role          = shift;
 	my $password      = shift;
diff --git a/src/test/kerberos/t/001_auth.pl b/src/test/kerberos/t/001_auth.pl
index b5594924ca..27c93abe78 100644
--- a/src/test/kerberos/t/001_auth.pl
+++ b/src/test/kerberos/t/001_auth.pl
@@ -185,6 +185,8 @@ END
 # Test connection success or failure, and if success, that query returns true.
 sub test_access
 {
+	local $Test::Builder::Level = $Test::Builder::Level + 1;
+
 	my ($node, $role, $query, $expected_res, $gssencmode, $test_name,
 		@expect_log_msgs)
 	  = @_;
diff --git a/src/test/ldap/t/001_auth.pl b/src/test/ldap/t/001_auth.pl
index 0ae14e4c85..0dfc1f9ee1 100644
--- a/src/test/ldap/t/001_auth.pl
+++ b/src/test/ldap/t/001_auth.pl
@@ -166,6 +166,8 @@ END
 
 sub test_access
 {
+	local $Test::Builder::Level = $Test::Builder::Level + 1;
+
 	my ($node, $role, $expected_res, $test_name, %params) = @_;
 	my $connstr = "user=$role";
 
-- 
2.33.0

Attachments:

  [text/plain] 0001-Add-missing-Test-Builder-Level-settings.patch (2.3K, ../ae1143fb-455c-c80f-ed66-78d45bd93303@enterprisedb.com/2-0001-Add-missing-Test-Builder-Level-settings.patch)
  download | inline diff:
From e9ce373a0482799dc37a695058fc2ca4370f33d1 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Wed, 22 Sep 2021 08:58:07 +0200
Subject: [PATCH] Add missing $Test::Builder::Level settings

---
 src/test/authentication/t/001_password.pl | 2 ++
 src/test/authentication/t/002_saslprep.pl | 2 ++
 src/test/kerberos/t/001_auth.pl           | 2 ++
 src/test/ldap/t/001_auth.pl               | 2 ++
 4 files changed, 8 insertions(+)

diff --git a/src/test/authentication/t/001_password.pl b/src/test/authentication/t/001_password.pl
index 427a360198..1296c5307a 100644
--- a/src/test/authentication/t/001_password.pl
+++ b/src/test/authentication/t/001_password.pl
@@ -42,6 +42,8 @@ sub reset_pg_hba
 # named parameters are passed to connect_ok/fails as-is.
 sub test_role
 {
+	local $Test::Builder::Level = $Test::Builder::Level + 1;
+
 	my ($node, $role, $method, $expected_res, %params) = @_;
 	my $status_string = 'failed';
 	$status_string = 'success' if ($expected_res eq 0);
diff --git a/src/test/authentication/t/002_saslprep.pl b/src/test/authentication/t/002_saslprep.pl
index f080a0ccba..5b8b4b28e7 100644
--- a/src/test/authentication/t/002_saslprep.pl
+++ b/src/test/authentication/t/002_saslprep.pl
@@ -36,6 +36,8 @@ sub reset_pg_hba
 # Test access for a single role, useful to wrap all tests into one.
 sub test_login
 {
+	local $Test::Builder::Level = $Test::Builder::Level + 1;
+
 	my $node          = shift;
 	my $role          = shift;
 	my $password      = shift;
diff --git a/src/test/kerberos/t/001_auth.pl b/src/test/kerberos/t/001_auth.pl
index b5594924ca..27c93abe78 100644
--- a/src/test/kerberos/t/001_auth.pl
+++ b/src/test/kerberos/t/001_auth.pl
@@ -185,6 +185,8 @@ END
 # Test connection success or failure, and if success, that query returns true.
 sub test_access
 {
+	local $Test::Builder::Level = $Test::Builder::Level + 1;
+
 	my ($node, $role, $query, $expected_res, $gssencmode, $test_name,
 		@expect_log_msgs)
 	  = @_;
diff --git a/src/test/ldap/t/001_auth.pl b/src/test/ldap/t/001_auth.pl
index 0ae14e4c85..0dfc1f9ee1 100644
--- a/src/test/ldap/t/001_auth.pl
+++ b/src/test/ldap/t/001_auth.pl
@@ -166,6 +166,8 @@ END
 
 sub test_access
 {
+	local $Test::Builder::Level = $Test::Builder::Level + 1;
+
 	my ($node, $role, $expected_res, $test_name, %params) = @_;
 	my $connstr = "user=$role";
 
-- 
2.33.0

view thread (80+ messages)  latest in thread

Message-ID: <ae1143fb-455c-c80f-ed66-78d45bd93303@enterprisedb.com>
Permalink:  ../ae1143fb-455c-c80f-ed66-78d45bd93303@enterprisedb.com/
Also on:    postgresql.org/message-id/ae1143fb-455c-c80f-ed66-78d45bd93303@enterprisedb.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: peter.eisentraut@enterprisedb.com, michael@paquier.xyz, pchampion@vmware.com
  Subject: Re: Proposal: Save user's original authenticated identity for logging
  In-Reply-To: <ae1143fb-455c-c80f-ed66-78d45bd93303@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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