From: Joe Conway Date: Sun, 9 Apr 2017 22:59:02 +0000 (-0700) Subject: Make sepgsql regression tests robust vs. collation differences X-Git-Tag: REL_10_BETA1~322 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86fa9b2d1b74cf7e3402c7653f7515b075eacc7b;p=postgresql Make sepgsql regression tests robust vs. collation differences In commit 25542d77, regression test coverage was added to sepgsql for partitioned tables. Unfortunately it was not robust in the face of collation differences, per the buildfarm. Force "C" collation in order to fix that. Discussion: https://postgr.es/m/flat/623bcaae-112e-ced0-8c22-a84f75ae0c53%40joeconway.com --- diff --git a/contrib/sepgsql/expected/dml.out b/contrib/sepgsql/expected/dml.out index e2d277c9b2..995e425aca 100644 --- a/contrib/sepgsql/expected/dml.out +++ b/contrib/sepgsql/expected/dml.out @@ -55,18 +55,18 @@ SELECT objtype, objname, label FROM pg_seclabels 't1p', 't1p.o', 't1p.p', 't1p.q', 't1p_ones', 't1p_ones.o', 't1p_ones.p', 't1p_ones.q', 't1p_tens', 't1p_tens.o', 't1p_tens.p', 't1p_tens.q') -ORDER BY objname; +ORDER BY objname COLLATE "C"; objtype | objname | label ---------+------------+--------------------------------------------- table | t1 | system_u:object_r:sepgsql_table_t:s0 table | t1p | system_u:object_r:sepgsql_table_t:s0 column | t1p.o | system_u:object_r:sepgsql_table_t:s0 + column | t1p.p | system_u:object_r:sepgsql_ro_table_t:s0 + column | t1p.q | system_u:object_r:sepgsql_secret_table_t:s0 table | t1p_ones | unconfined_u:object_r:sepgsql_table_t:s0 column | t1p_ones.o | system_u:object_r:sepgsql_table_t:s0 column | t1p_ones.p | system_u:object_r:sepgsql_ro_table_t:s0 column | t1p_ones.q | system_u:object_r:sepgsql_secret_table_t:s0 - column | t1p.p | system_u:object_r:sepgsql_ro_table_t:s0 - column | t1p.q | system_u:object_r:sepgsql_secret_table_t:s0 table | t1p_tens | unconfined_u:object_r:sepgsql_table_t:s0 column | t1p_tens.o | system_u:object_r:sepgsql_table_t:s0 column | t1p_tens.p | system_u:object_r:sepgsql_ro_table_t:s0 diff --git a/contrib/sepgsql/expected/label.out b/contrib/sepgsql/expected/label.out index f46d6f74e9..0300bc6fb4 100644 --- a/contrib/sepgsql/expected/label.out +++ b/contrib/sepgsql/expected/label.out @@ -107,7 +107,7 @@ SELECT objtype, objname, label FROM pg_seclabels 'tpart', 'tpart_ones', 'tpart_tens') - ORDER BY objname ASC; + ORDER BY objname COLLATE "C" ASC; objtype | objname | label ---------+------------+----------------------------------------------- table | t1 | unconfined_u:object_r:sepgsql_table_t:s0 @@ -124,7 +124,7 @@ SELECT objtype, objname, label FROM pg_seclabels OR objname like 'tpart.%' OR objname like 'tpart_ones.%' OR objname like 'tpart_tens.%') - ORDER BY objname ASC; + ORDER BY objname COLLATE "C" ASC; objtype | objname | label ---------+---------------------+----------------------------------------------- column | t3.cmax | unconfined_u:object_r:user_sepgsql_table_t:s0 @@ -147,6 +147,10 @@ SELECT objtype, objname, label FROM pg_seclabels column | tpart.cmin | unconfined_u:object_r:user_sepgsql_table_t:s0 column | tpart.ctid | unconfined_u:object_r:user_sepgsql_table_t:s0 column | tpart.o | unconfined_u:object_r:user_sepgsql_table_t:s0 + column | tpart.p | unconfined_u:object_r:user_sepgsql_table_t:s0 + column | tpart.tableoid | unconfined_u:object_r:user_sepgsql_table_t:s0 + column | tpart.xmax | unconfined_u:object_r:user_sepgsql_table_t:s0 + column | tpart.xmin | unconfined_u:object_r:user_sepgsql_table_t:s0 column | tpart_ones.cmax | unconfined_u:object_r:user_sepgsql_table_t:s0 column | tpart_ones.cmin | unconfined_u:object_r:user_sepgsql_table_t:s0 column | tpart_ones.ctid | unconfined_u:object_r:user_sepgsql_table_t:s0 @@ -155,8 +159,6 @@ SELECT objtype, objname, label FROM pg_seclabels column | tpart_ones.tableoid | unconfined_u:object_r:user_sepgsql_table_t:s0 column | tpart_ones.xmax | unconfined_u:object_r:user_sepgsql_table_t:s0 column | tpart_ones.xmin | unconfined_u:object_r:user_sepgsql_table_t:s0 - column | tpart.p | unconfined_u:object_r:user_sepgsql_table_t:s0 - column | tpart.tableoid | unconfined_u:object_r:user_sepgsql_table_t:s0 column | tpart_tens.cmax | unconfined_u:object_r:sepgsql_sysobj_t:s0 column | tpart_tens.cmin | unconfined_u:object_r:sepgsql_sysobj_t:s0 column | tpart_tens.ctid | unconfined_u:object_r:sepgsql_sysobj_t:s0 @@ -165,8 +167,6 @@ SELECT objtype, objname, label FROM pg_seclabels column | tpart_tens.tableoid | unconfined_u:object_r:sepgsql_sysobj_t:s0 column | tpart_tens.xmax | unconfined_u:object_r:sepgsql_sysobj_t:s0 column | tpart_tens.xmin | unconfined_u:object_r:sepgsql_sysobj_t:s0 - column | tpart.xmax | unconfined_u:object_r:user_sepgsql_table_t:s0 - column | tpart.xmin | unconfined_u:object_r:user_sepgsql_table_t:s0 (40 rows) -- diff --git a/contrib/sepgsql/sql/dml.sql b/contrib/sepgsql/sql/dml.sql index 2df70dfb98..fc318110fa 100644 --- a/contrib/sepgsql/sql/dml.sql +++ b/contrib/sepgsql/sql/dml.sql @@ -65,7 +65,7 @@ SELECT objtype, objname, label FROM pg_seclabels 't1p', 't1p.o', 't1p.p', 't1p.q', 't1p_ones', 't1p_ones.o', 't1p_ones.p', 't1p_ones.q', 't1p_tens', 't1p_tens.o', 't1p_tens.p', 't1p_tens.q') -ORDER BY objname; +ORDER BY objname COLLATE "C"; CREATE SCHEMA my_schema_1; CREATE TABLE my_schema_1.ts1 (a int, b text); diff --git a/contrib/sepgsql/sql/label.sql b/contrib/sepgsql/sql/label.sql index 5ceacd1dff..d19c6edb4c 100644 --- a/contrib/sepgsql/sql/label.sql +++ b/contrib/sepgsql/sql/label.sql @@ -107,14 +107,14 @@ SELECT objtype, objname, label FROM pg_seclabels 'tpart', 'tpart_ones', 'tpart_tens') - ORDER BY objname ASC; + ORDER BY objname COLLATE "C" ASC; SELECT objtype, objname, label FROM pg_seclabels WHERE provider = 'selinux' AND objtype = 'column' AND (objname like 't3.%' OR objname like 't4.%' OR objname like 'tpart.%' OR objname like 'tpart_ones.%' OR objname like 'tpart_tens.%') - ORDER BY objname ASC; + ORDER BY objname COLLATE "C" ASC; -- -- Tests for SECURITY LABEL