contrib/sepgsql regression tests have been broken for months - Mailing list pgsql-hackers

From Tom Lane
Subject contrib/sepgsql regression tests have been broken for months
Date
Msg-id 1613232.1761255361@sss.pgh.pa.us
Whole thread Raw
Responses Re: contrib/sepgsql regression tests have been broken for months
Re: contrib/sepgsql regression tests have been broken for months
List pgsql-hackers
I tried to run contrib/sepgsql's regression tests today, and was
rather astonished when they failed.  Investigating, there are
some context lines like "LINE 1: ALTER TABLE regtest_table_4
ALTER COLUMN y TYPE float;" in the test output that were not there
before.  A bit of bisecting showed that the change happened with

65281391a937293db7fa747be218def0e9794550 is the first bad commit
commit 65281391a937293db7fa747be218def0e9794550 (HEAD)
Author: Michael Paquier <michael@paquier.xyz>
Date:   Mon Jan 27 13:51:23 2025 +0900

    Print out error position for some ALTER TABLE ALTER COLUMN type

So, okay, that's a perfectly respectable thing to do, and I can't
really fault Michael or Jian for not having tested its effects on
sepgsql.  But how come it took this long to notice?

I think that rhinoceros is the only BF member testing with
--with-selinux.  Looking at its logs, it is running the sepgsql tests
(as a custom module) in v17 and before, but not in v18 or HEAD.
I suppose that this is a consequence of trying to rely on the
TAP-test infrastructure that was installed by aeb8ea361 (just a few
days before the aforesaid change, as luck would have it).  That TAP
test does work for me, but it does not run on rhinoceros because
(1) there's no --enable-tap-tests in its configure command, and
(2) it doesn't set up environment variable PG_TEST_EXTRA to include
"sepgsql".

Anyway, we seem to need the attached in v18 and HEAD,
and we really ought to get BF coverage going again.

            regards, tom lane

diff --git a/contrib/sepgsql/expected/ddl.out b/contrib/sepgsql/expected/ddl.out
index 7e8deae4f93..accb903f5ce 100644
--- a/contrib/sepgsql/expected/ddl.out
+++ b/contrib/sepgsql/expected/ddl.out
@@ -304,6 +304,8 @@ ALTER TABLE regtest_table_4 ALTER COLUMN y TYPE float;
 LOG:  SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0
tcontext=unconfined_u:object_r:sepgsql_schema_t:s0tclass=db_schema name="regtest_schema" permissive=0 
 LOG:  SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0
tcontext=system_u:object_r:sepgsql_schema_t:s0tclass=db_schema name="public" permissive=0 
 LOG:  SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0
tcontext=system_u:object_r:sepgsql_schema_t:s0tclass=db_schema name="pg_catalog" permissive=0 
+LINE 1: ALTER TABLE regtest_table_4 ALTER COLUMN y TYPE float;
+                                                        ^
 LOG:  SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0
tcontext=system_u:object_r:sepgsql_schema_t:s0tclass=db_schema name="pg_catalog" permissive=0 
 LOG:  SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0
tcontext=unconfined_u:object_r:sepgsql_table_t:s0tclass=db_column name="regtest_schema.regtest_table_4.y" permissive=0 
 LOG:  SELinux: allowed { execute } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0
tcontext=system_u:object_r:sepgsql_proc_exec_t:s0tclass=db_procedure name="pg_catalog.float8(integer)" permissive=0 
@@ -388,7 +390,11 @@ ALTER TABLE regtest_ptable_4 ALTER COLUMN y TYPE float;
 LOG:  SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0
tcontext=unconfined_u:object_r:sepgsql_schema_t:s0tclass=db_schema name="regtest_schema" permissive=0 
 LOG:  SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0
tcontext=system_u:object_r:sepgsql_schema_t:s0tclass=db_schema name="public" permissive=0 
 LOG:  SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0
tcontext=system_u:object_r:sepgsql_schema_t:s0tclass=db_schema name="pg_catalog" permissive=0 
+LINE 1: ALTER TABLE regtest_ptable_4 ALTER COLUMN y TYPE float;
+                                                         ^
 LOG:  SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0
tcontext=system_u:object_r:sepgsql_schema_t:s0tclass=db_schema name="pg_catalog" permissive=0 
+LINE 1: ALTER TABLE regtest_ptable_4 ALTER COLUMN y TYPE float;
+                                                         ^
 LOG:  SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0
tcontext=system_u:object_r:sepgsql_schema_t:s0tclass=db_schema name="pg_catalog" permissive=0 
 LOG:  SELinux: allowed { setattr } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0
tcontext=unconfined_u:object_r:sepgsql_table_t:s0tclass=db_column name="regtest_schema.regtest_ptable_4.y" permissive=0 
 LOG:  SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0
tcontext=system_u:object_r:sepgsql_schema_t:s0tclass=db_schema name="pg_catalog" permissive=0 

pgsql-hackers by date:

Previous
From: Sami Imseih
Date:
Subject: Re: [Proposal] Adding callback support for custom statistics kinds
Next
From: Masahiko Sawada
Date:
Subject: Re: Support getrandom() for pg_strong_random() source