Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mr3MC-0007Vy-Mq for pgsql-hackers@arkaria.postgresql.org; Sat, 27 Nov 2021 19:27:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mr3MB-0008UH-JY for pgsql-hackers@arkaria.postgresql.org; Sat, 27 Nov 2021 19:27:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mr3MB-0008Ty-A6 for pgsql-hackers@lists.postgresql.org; Sat, 27 Nov 2021 19:27:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mr3M6-0001Ul-LO for pgsql-hackers@lists.postgresql.org; Sat, 27 Nov 2021 19:27:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 1ARJRJRg599245; Sat, 27 Nov 2021 14:27:20 -0500 From: Tom Lane To: Daniel Gustafsson cc: Michael Paquier , Andrew Dunstan , =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= , PostgreSQL Hackers Subject: Re: SSL Tests for sslinfo extension In-reply-to: <3B87BBC9-706E-4698-8636-30403D21F9B9@yesql.se> References: <87v97emzcp.fsf@wibble.ilmari.org> <09FAE16B-DDE3-4EB3-AEBA-7E31279AA173@yesql.se> <3B87BBC9-706E-4698-8636-30403D21F9B9@yesql.se> Comments: In-reply-to Daniel Gustafsson message dated "Wed, 23 Jun 2021 16:25:52 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <599243.1638041239.1@sss.pgh.pa.us> Date: Sat, 27 Nov 2021 14:27:19 -0500 Message-ID: <599244.1638041239@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Daniel Gustafsson writes: > On 17 Jun 2021, at 09:29, Michael Paquier wrote: >> Hmm. Adding internal dependencies between the tests should be avoided >> if we can. What would it take to move those TAP tests to >> contrib/sslinfo instead? This is while keeping in mind that there was >> a patch aimed at refactoring the SSL test suite for NSS. > It would be quite invasive as we currently don't provide the SSLServer test > harness outside of src/test/ssl, and given how tailored it is today I'm not > sure doing so without a rewrite would be a good idea. I think testing sslinfo in src/test/ssl is fine, while putting its test inside contrib/ would be dangerous, because then the test would be run by default. src/test/ssl is not run by default because the server it starts is potentially accessible by other local users, and AFAICS the same has to be true for an sslinfo test. So I don't have any problem with this structurally, but I do have a few nitpicks: * I think the error message added in 0001 should complain about missing password "encryption" not "encoding", no? * 0002 hasn't been updated for the great PostgresNode renaming. * 0002 needs to extend src/test/ssl/README to mention that "make installcheck" requires having installed contrib/sslinfo, analogous to similar comments in (eg) src/test/recovery/README. * 0002 writes a temporary file in the source tree. This is bad; for one thing I bet it fails under VPATH, but in any case there is no reason to risk it. Put it in the tmp_check directory instead (cf temp kdc files in src/test/kerberos/t/001_auth.pl). That's safer and you needn't worry about cleaning it up. * Hmm ... now I notice that you borrowed the key-file-copying logic from the 001 and 002 tests, but it's just as bad practice there. We should fix them too. * I ran a code-coverage check and it shows that this doesn't test ssl_issuer_field() or any of the following functions in sslinfo.c. I think at least ssl_extension_info() is complicated enough to deserve a test. regards, tom lane