sepgsql-testing.patch

text/x-patch

Filename: sepgsql-testing.patch
Type: text/x-patch
Part: 0
Message: Re: contrib/sepgsql regression tests are a no-go

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
contrib/sepgsql/chkselinuxenv 0 0
contrib/sepgsql/Makefile 0 0
diff --git a/contrib/sepgsql/Makefile b/contrib/sepgsql/Makefile
index 033c41a..140419a 100644
*** a/contrib/sepgsql/Makefile
--- b/contrib/sepgsql/Makefile
*************** OBJS = hooks.o selinux.o uavc.o label.o 
*** 5,15 ****
  	database.o schema.o relation.o proc.o
  DATA_built = sepgsql.sql
  
! REGRESS = label dml misc
! REGRESS_PREP = check_selinux_environment
! REGRESS_OPTS = --launcher $(top_builddir)/contrib/sepgsql/launcher
! 
! EXTRA_CLEAN = -r tmp *.pp sepgsql-regtest.if sepgsql-regtest.fc
  
  ifdef USE_PGXS
  PG_CONFIG = pg_config
--- 5,13 ----
  	database.o schema.o relation.o proc.o
  DATA_built = sepgsql.sql
  
! # Note: because we don't tell the Makefile there are any regression tests,
! # we have to clean those result files explicitly
! EXTRA_CLEAN = -r $(pg_regress_clean_files) tmp *.pp sepgsql-regtest.if sepgsql-regtest.fc
  
  ifdef USE_PGXS
  PG_CONFIG = pg_config
*************** include $(top_srcdir)/contrib/contrib-gl
*** 23,28 ****
  endif
  
  SHLIB_LINK += -lselinux
- 
- check_selinux_environment:
- 	@$(top_builddir)/contrib/sepgsql/chkselinuxenv "$(bindir)" "$(datadir)"
--- 21,23 ----
diff --git a/contrib/sepgsql/chkselinuxenv b/contrib/sepgsql/chkselinuxenv
index a7c81b2..2eeeb67 100755
*** a/contrib/sepgsql/chkselinuxenv
--- b/contrib/sepgsql/chkselinuxenv
***************
*** 1,11 ****
  #!/bin/sh
  #
! # SELinux environment checks to ensure configuration of the operating system
! # satisfies prerequisites to run regression test.
! # If incorrect settings are found, this script suggest user a hint.
  #
! PG_BINDIR="$1"
! PG_DATADIR="$2"
  
  echo
  echo "============== checking selinux environment           =============="
--- 1,18 ----
  #!/bin/sh
  #
! # Run the sepgsql regression tests, after making a lot of environmental checks
! # to try to ensure that the SELinux environment is set up appropriately and
! # the database is configured correctly.
  #
! # Note that this must be run against an installed Postgres database.
! # There's no equivalent of "make check", and that wouldn't be terribly useful
! # since much of the value is in checking that you installed sepgsql into
! # your database correctly.
! #
! # This must be run in the contrib/sepgsql directory of a Postgres build tree.
! #
! 
! PG_BINDIR=`pg_config --bindir`
  
  echo
  echo "============== checking selinux environment           =============="
*************** fi
*** 224,230 ****
  echo "found ${NUM}"
  
  #
! # check complete - 
  #
! echo ""
! exit 0
--- 231,242 ----
  echo "found ${NUM}"
  
  #
! # checking complete - let's run the tests
  #
! 
! echo
! echo "============== running sepgsql regression tests       =============="
! 
! make REGRESS="label dml misc" REGRESS_OPTS="--launcher ./launcher" installcheck
! 
! # exit with the exit code provided by "make"