Commit ff18115a authored by Peter Eisentraut's avatar Peter Eisentraut

Prevent LDAP and SSL tests from running without support in build

Add checks in each test file that the build supports the feature,
otherwise skip all the tests.  Before, if someone were to (accidentally)
invoke these tests without build support, they would fail in confusing
ways.

based on patch from Michael Paquier <michael@paquier.xyz>
parent fdb34824
...@@ -13,6 +13,8 @@ subdir = src/test/ldap ...@@ -13,6 +13,8 @@ subdir = src/test/ldap
top_builddir = ../../.. top_builddir = ../../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
export with_ldap
check: check:
$(prove_check) $(prove_check)
......
...@@ -2,7 +2,16 @@ use strict; ...@@ -2,7 +2,16 @@ use strict;
use warnings; use warnings;
use TestLib; use TestLib;
use PostgresNode; use PostgresNode;
use Test::More tests => 19; use Test::More;
if ($ENV{with_ldap} eq 'yes')
{
plan tests => 19;
}
else
{
plan skip_all => 'LDAP not supported by this build';
}
my ($slapd, $ldap_bin_dir, $ldap_schema_dir); my ($slapd, $ldap_bin_dir, $ldap_schema_dir);
......
...@@ -13,6 +13,8 @@ subdir = src/test/ssl ...@@ -13,6 +13,8 @@ subdir = src/test/ssl
top_builddir = ../../.. top_builddir = ../../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
export with_openssl
CERTIFICATES := server_ca server-cn-and-alt-names \ CERTIFICATES := server_ca server-cn-and-alt-names \
server-cn-only server-single-alt-name server-multiple-alt-names \ server-cn-only server-single-alt-name server-multiple-alt-names \
server-no-names server-revoked server-ss \ server-no-names server-revoked server-ss \
......
...@@ -2,10 +2,19 @@ use strict; ...@@ -2,10 +2,19 @@ use strict;
use warnings; use warnings;
use PostgresNode; use PostgresNode;
use TestLib; use TestLib;
use Test::More tests => 62; use Test::More;
use ServerSetup; use ServerSetup;
use File::Copy; use File::Copy;
if ($ENV{with_openssl} eq 'yes')
{
plan tests => 62;
}
else
{
plan skip_all => 'SSL not supported by this build';
}
#### Some configuration #### Some configuration
# This is the hostname used to connect to the server. This cannot be a # This is the hostname used to connect to the server. This cannot be a
......
...@@ -4,10 +4,19 @@ use strict; ...@@ -4,10 +4,19 @@ use strict;
use warnings; use warnings;
use PostgresNode; use PostgresNode;
use TestLib; use TestLib;
use Test::More tests => 6; use Test::More;
use ServerSetup; use ServerSetup;
use File::Copy; use File::Copy;
if ($ENV{with_openssl} eq 'yes')
{
plan tests => 6;
}
else
{
plan skip_all => 'SSL not supported by this build';
}
# This is the hostname used to connect to the server. # This is the hostname used to connect to the server.
my $SERVERHOSTADDR = '127.0.0.1'; my $SERVERHOSTADDR = '127.0.0.1';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment