aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-04-12 19:52:37 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-04-12 19:52:37 +0300
commit65dfe9d167e925cd8892dedb51dde29f69b7388d (patch)
treee26827607d829f497918f22d68a5ac140ca5cafe
parent084cae55131f71f32e15a6b2b7897aa1c7382c0a (diff)
downloadpostgresql-65dfe9d167e925cd8892dedb51dde29f69b7388d.tar.gz
postgresql-65dfe9d167e925cd8892dedb51dde29f69b7388d.zip
Move libpq encryption negotiation tests
The test targets libpq's options, so 'src/test/interfaces/libpq/t' is a more natural place for it. While doing this, I noticed that I had missed adding the libpq_encryption subdir to the Makefile. That's why this commit only needs to remove it from the meson.build file. Per Peter Eisentraut's suggestion. Discussion: https://www.postgresql.org/message-id/09d4bf5d-d0fa-4c66-a1d7-5ec757609646@eisentraut.org
-rw-r--r--src/interfaces/libpq/Makefile2
-rw-r--r--src/interfaces/libpq/meson.build7
-rw-r--r--src/interfaces/libpq/t/005_negotiate_encryption.pl (renamed from src/test/libpq_encryption/t/001_negotiate_encryption.pl)2
-rw-r--r--src/test/libpq_encryption/Makefile25
-rw-r--r--src/test/libpq_encryption/README31
-rw-r--r--src/test/libpq_encryption/meson.build18
-rw-r--r--src/test/meson.build1
7 files changed, 8 insertions, 78 deletions
diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
index fe2af575c5d..b36a7657648 100644
--- a/src/interfaces/libpq/Makefile
+++ b/src/interfaces/libpq/Makefile
@@ -13,7 +13,7 @@ subdir = src/interfaces/libpq
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
-export with_ssl
+export with_ssl with_gssapi with_krb_srvnam
PGFILEDESC = "PostgreSQL Access Library"
diff --git a/src/interfaces/libpq/meson.build b/src/interfaces/libpq/meson.build
index be6fadaea23..ed2a4048d18 100644
--- a/src/interfaces/libpq/meson.build
+++ b/src/interfaces/libpq/meson.build
@@ -118,8 +118,13 @@ tests += {
't/002_api.pl',
't/003_load_balance_host_list.pl',
't/004_load_balance_dns.pl',
+ 't/005_negotiate_encryption.pl',
],
- 'env': {'with_ssl': ssl_library},
+ 'env': {
+ 'with_ssl': ssl_library,
+ 'with_gssapi': gssapi.found() ? 'yes' : 'no',
+ 'with_krb_srvnam': 'postgres',
+ },
},
}
diff --git a/src/test/libpq_encryption/t/001_negotiate_encryption.pl b/src/interfaces/libpq/t/005_negotiate_encryption.pl
index d07d9498bbc..b369289ef1d 100644
--- a/src/test/libpq_encryption/t/001_negotiate_encryption.pl
+++ b/src/interfaces/libpq/t/005_negotiate_encryption.pl
@@ -129,7 +129,7 @@ if ($gss_supported != 0)
if ($ssl_supported != 0)
{
- my $certdir = dirname(__FILE__) . "/../../ssl/ssl";
+ my $certdir = dirname(__FILE__) . "/../../../test/ssl/ssl";
copy "$certdir/server-cn-only.crt", "$pgdata/server.crt"
|| die "copying server.crt: $!";
diff --git a/src/test/libpq_encryption/Makefile b/src/test/libpq_encryption/Makefile
deleted file mode 100644
index 3ad3da7031b..00000000000
--- a/src/test/libpq_encryption/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-#-------------------------------------------------------------------------
-#
-# Makefile for src/test/libpq_encryption
-#
-# Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
-# Portions Copyright (c) 1994, Regents of the University of California
-#
-# src/test/libpq_encryption/Makefile
-#
-#-------------------------------------------------------------------------
-
-subdir = src/test/libpq_encryption
-top_builddir = ../../..
-include $(top_builddir)/src/Makefile.global
-
-export with_ssl with_gssapi with_krb_srvnam
-
-check:
- $(prove_check)
-
-installcheck:
- $(prove_installcheck)
-
-clean distclean:
- rm -rf tmp_check
diff --git a/src/test/libpq_encryption/README b/src/test/libpq_encryption/README
deleted file mode 100644
index 8ceb1945277..00000000000
--- a/src/test/libpq_encryption/README
+++ /dev/null
@@ -1,31 +0,0 @@
-src/test/libpq_encryption/README
-
-Tests for negotiating network encryption method
-===============================================
-
-This directory contains a test suite for the libpq options to
-negotiate encryption with the server. This requires reconfiguring a
-test server, enabling/disabling SSL and GSSAPI, and is therefore kept
-separate and not run by default.
-
-CAUTION: The test server run by this test is configured to listen for TCP
-connections on localhost. Any user on the same host is able to log in to the
-test server while the tests are running. Do not run this suite on a multi-user
-system where you don't trust all local users! Also, this test suite creates a
-KDC server that listens for TCP/IP connections on localhost without any real
-access control.
-
-Running the tests
-=================
-
-NOTE: You must have given the --enable-tap-tests argument to configure.
-
-Run
- make check PG_TEST_EXTRA=libpq_encryption
-
-You can use "make installcheck" if you previously did "make install".
-In that case, the code in the installation tree is tested. With
-"make check", a temporary installation tree is built from the current
-sources and then tested.
-
-See src/test/perl/README for more info about running these tests.
diff --git a/src/test/libpq_encryption/meson.build b/src/test/libpq_encryption/meson.build
deleted file mode 100644
index ac1db10d742..00000000000
--- a/src/test/libpq_encryption/meson.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright (c) 2022-2024, PostgreSQL Global Development Group
-
-tests += {
- 'name': 'libpq_encryption',
- 'sd': meson.current_source_dir(),
- 'bd': meson.current_build_dir(),
- 'tap': {
- 'tests': [
- 't/001_negotiate_encryption.pl',
- ],
- 'env': {
- 'with_ssl': ssl_library,
- 'OPENSSL': openssl.found() ? openssl.path() : '',
- 'with_gssapi': gssapi.found() ? 'yes' : 'no',
- 'with_krb_srvnam': 'postgres',
- },
- },
-}
diff --git a/src/test/meson.build b/src/test/meson.build
index 702213bc6f6..c3d0dfedf1c 100644
--- a/src/test/meson.build
+++ b/src/test/meson.build
@@ -4,7 +4,6 @@ subdir('regress')
subdir('isolation')
subdir('authentication')
-subdir('libpq_encryption')
subdir('recovery')
subdir('subscription')
subdir('modules')