1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Convert sepgsql tests to TAP

Add a TAP test for sepgsql.  This automates the previously required
manual setup before the test.  The actual tests are still run by
pg_regress, as before, but now called from within the TAP Perl script.

The previous manual test script (test_sepgsql) is left in place, since
its purpose is (also) to test whether a running instance was properly
initialized for sepgsql.  But it has been changed to call pg_regress
directly and no longer require make.

Reviewed-by: Andreas Karlsson <andreas@proxel.se>
Discussion: https://www.postgresql.org/message-id/flat/651a5baf-5c45-4a5a-a202-0c8453a4ebf8@eisentraut.org
This commit is contained in:
Peter Eisentraut
2025-01-24 11:37:20 +01:00
parent 02ed3c2bdc
commit aeb8ea361a
9 changed files with 294 additions and 13 deletions

View File

@@ -151,14 +151,23 @@ $ for DBNAME in template0 template1 postgres; do
<sect2 id="sepgsql-regression">
<title>Regression Tests</title>
<para>
The <filename>sepgsql</filename> test suite is run if
<literal>PG_TEST_EXTRA</literal> contains <literal>sepgsql</literal> (see
<xref linkend="regress-additional"/>). This method is suitable during
development of <productname>PostgreSQL</productname>. Alternatively, there
is a way to run the tests to checks whether a database instance has been
set up properly for <literal>sepgsql</literal>.
</para>
<para>
Due to the nature of <productname>SELinux</productname>, running the
regression tests for <filename>sepgsql</filename> requires several extra
configuration steps, some of which must be done as root.
The regression tests will not be run by an ordinary
<literal>make check</literal> or <literal>make installcheck</literal> command; you must
set up the configuration and then invoke the test script manually.
The tests must be run in the <filename>contrib/sepgsql</filename> directory
</para>
<para>
The manual tests must be run in the <filename>contrib/sepgsql</filename> directory
of a configured PostgreSQL build tree. Although they require a build tree,
the tests are designed to be executed against an installed server,
that is they are comparable to <literal>make installcheck</literal> not