test(data): PostgreSQL MD5, cleartext, trust and TLS tests can run, and must where TLS is set up

BRIEF §6.3 requires every authentication method and TLS mode against the
PostgreSQL service containers, but the MD5, cleartext and trust tests always
skipped in CI (no roles) and the TLS tests skipped at run time because the
official images start with TLS off. .github/scripts/postgres-ci-setup.sh prepares
a server container: a role per method with its pg_hba line ahead of the image's
SCRAM line (the MD5 password stored as MD5), and TLS with a self-signed
certificate for localhost and 127.0.0.1, enabled with ALTER SYSTEM and a reload
whose rejected lines fail the script. With TITANO_TEST_PG_TLS=1 a server that
refuses TLS fails the TLS tests instead of skipping them, and a new test checks
that verify-full accepts the server whose certificate chains to
TITANO_TEST_PG_ROOT_CERT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-12 10:06:10 +00:00
1 parent a8cf92b4a4
commit ec247a96e1
3 files changed
+86 -3

No files matched your search

@@ -29,6 +29,11 @@ internal static class PgTestServer
public static string Optional(string variable) =>
Environment.GetEnvironmentVariable(variable) is { Length: > 0 } cs ? cs : throw new SkipException($"{variable} not set");
/// <summary>Set to 1 where the server was set up with TLS (CI): a server that refuses TLS then fails the TLS tests.</summary>
public const string TlsVariable = "TITANO_TEST_PG_TLS";
public static bool TlsExpected => Environment.GetEnvironmentVariable(TlsVariable) is "1" or "true";
public static async Task<string> CreateSchemaAsync(CancellationToken cancellationToken)
{
var name = "titano_t_" + Guid.NewGuid().ToString("N")[..16];