mirror of
https://github.com/postgres/postgres.git
synced 2025-08-31 17:02:12 +03:00
Check availability of module injection_points in TAP tests
This fixes defects with installcheck for TAP tests that expect the
module injection_points to exist in an installation, but the contents of
src/test/modules are not installed by default with installcheck. This
would cause, for example, failures under installcheck-world for a build
with injection points enabled, when the contents of src/test/modules/
are not installed.
The availability of the module can be done with a scan of
pg_available_extension. This has been introduced in 2cdcae9da6
, and
it is refactored here as a new routine in Cluster.pm.
Tests are changed in different ways depending on what they need:
- The libpq TAP test sets up a node even without injection points, so it
is enough to check that CREATE EXTENSION can be used. There is no need
for the variable enable_injection_points.
- In test_misc, 006_signal_autovacuum requires a runtime check.
- 041_checkpoint_at_promote in recovery tests and 005_timeouts in
test_misc are updated to use the routine introduced in Cluster.pm.
- test_slru's 001_multixact, injection_points's 001_stats and
modules/gin/ do not require a check as these modules disable
installcheck entirely.
Discussion: https://postgr.es/m/ZtesYQ-WupeAK7xK@paquier.xyz
This commit is contained in:
@@ -15,7 +15,7 @@ subdir = src/interfaces/libpq
|
||||
top_builddir = ../../..
|
||||
include $(top_builddir)/src/Makefile.global
|
||||
|
||||
export with_ssl with_gssapi with_krb_srvnam enable_injection_points
|
||||
export with_ssl with_gssapi with_krb_srvnam
|
||||
|
||||
PGFILEDESC = "PostgreSQL Access Library"
|
||||
|
||||
|
@@ -121,7 +121,6 @@ tests += {
|
||||
't/005_negotiate_encryption.pl',
|
||||
],
|
||||
'env': {
|
||||
'enable_injection_points': get_option('injection_points') ? 'yes' : 'no',
|
||||
'with_ssl': ssl_library,
|
||||
'with_gssapi': gssapi.found() ? 'yes' : 'no',
|
||||
'with_krb_srvnam': 'postgres',
|
||||
|
@@ -90,8 +90,6 @@ my $kerberos_enabled =
|
||||
$ENV{PG_TEST_EXTRA} && $ENV{PG_TEST_EXTRA} =~ /\bkerberos\b/;
|
||||
my $ssl_supported = $ENV{with_ssl} eq 'openssl';
|
||||
|
||||
my $injection_points_supported = $ENV{enable_injection_points} eq 'yes';
|
||||
|
||||
###
|
||||
### Prepare test server for GSSAPI and SSL authentication, with a few
|
||||
### different test users and helper functions. We don't actually
|
||||
@@ -151,6 +149,11 @@ if ($ssl_supported != 0)
|
||||
|
||||
$node->start;
|
||||
|
||||
# Check if the extension injection_points is available, as it may be
|
||||
# possible that this script is run with installcheck, where the module
|
||||
# would not be installed by default.
|
||||
my $injection_points_supported = $node->check_extension('injection_points');
|
||||
|
||||
$node->safe_psql('postgres', 'CREATE USER localuser;');
|
||||
$node->safe_psql('postgres', 'CREATE USER testuser;');
|
||||
$node->safe_psql('postgres', 'CREATE USER ssluser;');
|
||||
|
Reference in New Issue
Block a user