]> granicus.if.org Git - postgresql/commitdiff
Make sepgsql regression tests robust vs. collation differences
authorJoe Conway <mail@joeconway.com>
Sun, 9 Apr 2017 22:59:02 +0000 (15:59 -0700)
committerJoe Conway <mail@joeconway.com>
Sun, 9 Apr 2017 22:59:02 +0000 (15:59 -0700)
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

contrib/sepgsql/expected/dml.out
contrib/sepgsql/expected/label.out
contrib/sepgsql/sql/dml.sql
contrib/sepgsql/sql/label.sql

index e2d277c9b23a8acfd1a09e62efeb33d749f5d1f6..995e425aca105657fa18f58aa918a34d7d8f19d9 100644 (file)
@@ -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
index f46d6f74e99a39c87dae22d501827c80939af0ef..0300bc6fb45e17c621df622821e5e06f88ccd676 100644 (file)
@@ -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)
 
 --
index 2df70dfb98b6161e1cb36163e6c4e5f632b9c938..fc318110faf06976d98acacab073eb84f12b36f0 100644 (file)
@@ -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);
index 5ceacd1dff80f3d5f524f3de5f24b6faef2c5139..d19c6edb4ca8f4d7c315474baef09a22342e2048 100644 (file)
@@ -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