pgsql: Add TAP tests for password-based authentication methods.

Started by Heikki Linnakangasabout 9 years ago6 messageshackers
Jump to latest
#1Heikki Linnakangas
heikki.linnakangas@enterprisedb.com

Add TAP tests for password-based authentication methods.

Tests all combinations of users with MD5, plaintext and SCRAM verifiers
stored in pg_authid, with plain 'password', 'md5' and 'scram'
authentication methods.

Michael Paquier

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/aa7464d949bf69ce1e8697f77400ff6b7ebb2d18

Modified Files
--------------
src/test/Makefile | 2 +-
src/test/README | 3 ++
src/test/authentication/Makefile | 20 ++++++++
src/test/authentication/README | 16 ++++++
src/test/authentication/t/001_password.pl | 84 +++++++++++++++++++++++++++++++
5 files changed, 124 insertions(+), 1 deletion(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#2Michael Paquier
michael@paquier.xyz
In reply to: Heikki Linnakangas (#1)
Re: [COMMITTERS] pgsql: Add TAP tests for password-based authentication methods.

On Fri, Mar 17, 2017 at 6:37 PM, Heikki Linnakangas
<heikki.linnakangas@iki.fi> wrote:

Add TAP tests for password-based authentication methods.

Tests all combinations of users with MD5, plaintext and SCRAM verifiers
stored in pg_authid, with plain 'password', 'md5' and 'scram'
authentication methods.

This patch has forgotten two things:
1) src/test/authentication/.gitignore.
2) A refresh of vcregress.pl to run this test suite on Windows.
Please find attached a patch to address both issues.
--
Michael

Attachments:

auth-test-fixes.patchtext/x-patch; charset=US-ASCII; name=auth-test-fixes.patchDownload+19-3
#3Peter Eisentraut
peter_e@gmx.net
In reply to: Heikki Linnakangas (#1)
Re: [COMMITTERS] pgsql: Add TAP tests for password-based authentication methods.

On 3/17/17 05:37, Heikki Linnakangas wrote:

Add TAP tests for password-based authentication methods.

Tests all combinations of users with MD5, plaintext and SCRAM verifiers
stored in pg_authid, with plain 'password', 'md5' and 'scram'
authentication methods.

This is missing an entry for tmp_check/ in .gitignore. But maybe we can
do that globally instead of repeating it in every directory?

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Michael Paquier (#2)
Re: [COMMITTERS] pgsql: Add TAP tests for password-based authentication methods.

On 03/18/2017 02:55 PM, Michael Paquier wrote:

On Fri, Mar 17, 2017 at 6:37 PM, Heikki Linnakangas
<heikki.linnakangas@iki.fi> wrote:

Add TAP tests for password-based authentication methods.

Tests all combinations of users with MD5, plaintext and SCRAM verifiers
stored in pg_authid, with plain 'password', 'md5' and 'scram'
authentication methods.

This patch has forgotten two things:
1) src/test/authentication/.gitignore.
2) A refresh of vcregress.pl to run this test suite on Windows.
Please find attached a patch to address both issues.

The tests don't actually work on Windows, and will all be skipped if
try. So "vcregress authcheck" as in this patch is pretty useless.

With some effort, we could make it work on Windows. It currently assumes
unix domain sockets, when it rewrites pg_hba.conf - that would need to
use TCP instead. And to make it secure, use a long-enough random
password instead of a hard-coded constant. I'm not volunteering to do
that, though.

- Heikki

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Peter Eisentraut (#3)
Re: [COMMITTERS] pgsql: Add TAP tests for password-based authentication methods.

On 03/20/2017 02:32 AM, Peter Eisentraut wrote:

On 3/17/17 05:37, Heikki Linnakangas wrote:

Add TAP tests for password-based authentication methods.

Tests all combinations of users with MD5, plaintext and SCRAM verifiers
stored in pg_authid, with plain 'password', 'md5' and 'scram'
authentication methods.

This is missing an entry for tmp_check/ in .gitignore. But maybe we can
do that globally instead of repeating it in every directory?

Hmm. That would be nice. However, many of the test suites have other
files and directories in their .gitignores, so handling tmp_check
globally wouldn't move the needle much. And handling some generated
subdirectories globally and others locally seems confusing. For example,
src/test/regress/.gitignore currently looks like this:

# Local binaries
/pg_regress

# Generated subdirectories
/tmp_check/
/results/
/log/

# Note: regreesion.* are only left behind on a failure; that's why they're not ignored
#/regression.diffs
#/regression.out

Not having /tmp_check/ in the above would look like an omission, when
/results/ and /log/ are still listed.

If we could also handle results and log globally, that would be nice.
But IMHO those names are too generic to put to a global .gitignore. We
could rename them, but this starts to feel like more trouble than it's
worth. I'll just go and create a .gitignore for /tmp_check/ to
src/test/authentication.

- Heikki

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Heikki Linnakangas (#5)
Re: Re: [COMMITTERS] pgsql: Add TAP tests for password-based authentication methods.

Heikki Linnakangas <hlinnaka@iki.fi> writes:

On 03/20/2017 02:32 AM, Peter Eisentraut wrote:

This is missing an entry for tmp_check/ in .gitignore. But maybe we can
do that globally instead of repeating it in every directory?

If we could also handle results and log globally, that would be nice.
But IMHO those names are too generic to put to a global .gitignore. We
could rename them, but this starts to feel like more trouble than it's
worth. I'll just go and create a .gitignore for /tmp_check/ to
src/test/authentication.

FWIW, that was my thought about it as well. Handling tmp_check
differently from those other two just seems confusing.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers