FAQ
How about an idea that allows to launch environment checker (typically shell scripts) prior
to regression tests?

The following stuffs should be preconfigured to run sepgsql's regression test.
- SELinux must be run and configured to enforcing mode.
- The sepgsql-regtest policy module must be loaded.
- The boolean of sepgsql_regression_test_mode must be turned on.
- The psql command should be labeled as 'bin_t'

If checkinstall optionally allows to launch an environment checker on regression test,
we may be possible to suggest users to fix up their configuration. It seems to me quite
helpful.

For example, one idea is to inject a dummy variable (mostly, initialized to empty) as
dependency of installcheck, being available to overwrite in Makefile of contrib, as follows:

# against installed postmaster
installcheck: submake $(REGRESS_PRE)
$(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)

Thanks,
--
NEC Europe Ltd, SAP Global Competence Center
KaiGai Kohei <kohei.kaigai@emea.nec.com>

Search Discussions

  • Robert Haas at Jul 21, 2011 at 12:35 pm

    On Thu, Jul 21, 2011 at 6:16 AM, Kohei Kaigai wrote:
    How about an idea that allows to launch environment checker (typically shell scripts) prior
    to regression tests?

    The following stuffs should be preconfigured to run sepgsql's regression test.
    - SELinux must be run and configured to enforcing mode.
    - The sepgsql-regtest policy module must be loaded.
    - The boolean of sepgsql_regression_test_mode must be turned on.
    - The psql command should be labeled as 'bin_t'

    If checkinstall optionally allows to launch an environment checker on regression test,
    we may be possible to suggest users to fix up their configuration. It seems to me quite
    helpful.

    For example, one idea is to inject a dummy variable (mostly, initialized to empty) as
    dependency of installcheck, being available to overwrite in Makefile of contrib, as follows:

    # against installed postmaster
    installcheck: submake $(REGRESS_PRE)
    $(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
    Seems reasonable.

    --
    Robert Haas
    EnterpriseDB: http://www.enterprisedb.com
    The Enterprise PostgreSQL Company
  • Joe Conway at Jul 22, 2011 at 3:42 pm

    On 07/21/2011 05:35 AM, Robert Haas wrote:
    On Thu, Jul 21, 2011 at 6:16 AM, Kohei Kaigai wrote:
    How about an idea that allows to launch environment checker (typically shell scripts) prior
    to regression tests?

    The following stuffs should be preconfigured to run sepgsql's regression test.
    - SELinux must be run and configured to enforcing mode.
    - The sepgsql-regtest policy module must be loaded.
    - The boolean of sepgsql_regression_test_mode must be turned on.
    - The psql command should be labeled as 'bin_t'

    If checkinstall optionally allows to launch an environment checker on regression test,
    we may be possible to suggest users to fix up their configuration. It seems to me quite
    helpful.

    For example, one idea is to inject a dummy variable (mostly, initialized to empty) as
    dependency of installcheck, being available to overwrite in Makefile of contrib, as follows:

    # against installed postmaster
    installcheck: submake $(REGRESS_PRE)
    $(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
    Seems reasonable.
    +1
    it would have been helpful to me last month while looking at this.

    Joe

    --
    Joe Conway
    credativ LLC: http://www.credativ.us
    Linux, PostgreSQL, and general Open Source
    Training, Service, Consulting, & 24x7 Support
  • Kohei KaiGai at Jul 25, 2011 at 8:36 am
    The attached patch enables to check prerequisites to run regression
    test of sepgsql module.
    It adds a dependency to installcheck that allows us to launch
    a script to check environment of operating system.
    I'd like to add this patch next commit-fest.

    E.g, this example does not turn on sepgsql_regression_test_mode
    boolean parameter of selinux.

    [kaigai@iwashi sepgsql]$ make installcheck
    :
    ============== checking selinux environment ==============
    test unconfined_t domain ... ok
    test runon command ... ok
    test sestatus command ... ok
    test getsebool command ... ok
    test enforcing mode ... ok
    test sepgsql-regtest policy ... ok
    test selinux boolean ... failed

    The boolean variable of 'sepgsql_regression_test_mode' must be
    turned. It affects an internal state of SELinux policy, then
    a set of rules to run regression test will be activated.
    You can turn on this variable as follows:

    $ su -
    # setsebool sepgsql_regression_test_mode 1

    Also note that we recommend to turn off this variable after the
    regression test, because it activates unnecessary rules.

    make: *** [check_selinux_environment] Error 1
    [kaigai@iwashi sepgsql]$

    Then, we can turn on it according to the suggestion.

    [kaigai@iwashi sepgsql]$ su -
    Password:
    [root@iwashi ~]# setsebool sepgsql_regression_test_mode 1
    [root@iwashi ~]# logout
    [kaigai@iwashi sepgsql]$ make installcheck
    :
    ============== checking selinux environment ==============
    test unconfined_t domain ... ok
    test runon command ... ok
    test sestatus command ... ok
    test getsebool command ... ok
    test enforcing mode ... ok
    test sepgsql-regtest policy ... ok
    test selinux boolean ... ok
    test label of psql ... ok
    test sepgsql installation ... ok
    test template1 database ... ok

    ../../src/test/regress/pg_regress --inputdir=.
    --psqldir='/usr/local/pgsql/bin' --dbname=contrib_regression
    --launcher ../../contrib/sepgsql/launcher label dml misc
    (using postmaster on Unix socket, default port)
    ============== dropping database "contrib_regression" ==============
    DROP DATABASE
    ============== creating database "contrib_regression" ==============
    CREATE DATABASE
    ALTER DATABASE
    ============== running regression test queries ==============
    test label ... ok
    test dml ... ok
    test misc ... ok

    =====================
    All 3 tests passed.
    =====================

    Thanks,

    2011/7/22 Joe Conway <mail@joeconway.com>:
    On 07/21/2011 05:35 AM, Robert Haas wrote:
    On Thu, Jul 21, 2011 at 6:16 AM, Kohei Kaigai wrote:
    How about an idea that allows to launch environment checker (typically shell scripts) prior
    to regression tests?

    The following stuffs should be preconfigured to run sepgsql's regression test.
    - SELinux must be run and configured to enforcing mode.
    - The sepgsql-regtest policy module must be loaded.
    - The boolean of sepgsql_regression_test_mode must be turned on.
    - The psql command should be labeled as 'bin_t'

    If checkinstall optionally allows to launch an environment checker on regression test,
    we may be possible to suggest users to fix up their configuration. It seems to me quite
    helpful.

    For example, one idea is to inject a dummy variable (mostly, initialized to empty) as
    dependency of installcheck, being available to overwrite in Makefile of contrib, as follows:

    # against installed postmaster
    installcheck: submake $(REGRESS_PRE)
    $(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
    Seems reasonable.
    +1
    it would have been helpful to me last month while looking at this.

    Joe

    --
    Joe Conway
    credativ LLC: http://www.credativ.us
    Linux, PostgreSQL, and general Open Source
    Training, Service, Consulting, & 24x7 Support

    --
    Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
    To make changes to your subscription:
    http://www.postgresql.org/mailpref/pgsql-hackers


    --
    KaiGai Kohei <kaigai@kaigai.gr.jp>
  • Robert Haas at Jul 25, 2011 at 2:52 pm

    On Mon, Jul 25, 2011 at 4:36 AM, Kohei KaiGai wrote:
    The attached patch enables to check prerequisites to run regression
    test of sepgsql module.
    It adds a dependency to installcheck that allows us to launch
    a script to check environment of operating system.
    Committed.

    --
    Robert Haas
    EnterpriseDB: http://www.enterprisedb.com
    The Enterprise PostgreSQL Company

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedJul 21, '11 at 10:16a
activeJul 25, '11 at 2:52p
posts5
users4
websitepostgresql.org...
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase