From e6a6252e2533d2bd891f82b77aabc0b31cc0f836 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Sun, 24 Sep 2017 23:36:28 +1300 Subject: [PATCH 3/3] Add a regression test to log an LDAP diagnostic message. This exercises the new code, but doesn't verify the logged output. Author: Thomas Munro Reviewed-By: Discussion: https://postgr.es/m/CAEepm%3D2_dA-SYpFdmNVwvKsEBXOUj%3DK4ooKovHmvj6jnMdt8dw%40mail.gmail.com --- src/test/ldap/t/001_auth.pl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/test/ldap/t/001_auth.pl b/src/test/ldap/t/001_auth.pl index a7cac6210b..38760ece61 100644 --- a/src/test/ldap/t/001_auth.pl +++ b/src/test/ldap/t/001_auth.pl @@ -2,7 +2,7 @@ use strict; use warnings; use TestLib; use PostgresNode; -use Test::More tests => 14; +use Test::More tests => 15; my ($slapd, $ldap_bin_dir, $ldap_schema_dir); @@ -175,3 +175,12 @@ $node->reload; $ENV{"PGPASSWORD"} = 'secret1'; test_access($node, 'test1', 0, 'combined LDAP URL and search filter'); + +note "diagnostic message"; + +unlink($node->data_dir . '/pg_hba.conf'); +$node->append_conf('pg_hba.conf', qq{local all all ldap ldapserver=$ldap_server ldapport=$ldap_port ldapprefix="uid=" ldapsuffix=",dc=example,dc=net" ldaptls=1}); +$node->reload; + +$ENV{"PGPASSWORD"} = 'secret1'; +test_access($node, 'test1', 2, 'any attempt fails due to unsupported TLS'); -- 2.13.5