Move libpq encryption negotiation tests
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 12 Apr 2024 16:52:37 +0000 (19:52 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 12 Apr 2024 16:52:37 +0000 (19:52 +0300)
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

src/interfaces/libpq/Makefile
src/interfaces/libpq/meson.build
src/interfaces/libpq/t/005_negotiate_encryption.pl [moved from src/test/libpq_encryption/t/001_negotiate_encryption.pl with 99% similarity]
src/test/libpq_encryption/Makefile [deleted file]
src/test/libpq_encryption/README [deleted file]
src/test/libpq_encryption/meson.build [deleted file]
src/test/meson.build

index fe2af575c5d3d9ccdefc5947e268710dc02413b2..b36a7657648a737174d39183cfc8fc791052e7db 100644 (file)
@@ -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"
 
index be6fadaea2355cb8621e5228822ee5ab3c8b8252..ed2a4048d18e21d9b9d8bc30ea76788d6c59d1cf 100644 (file)
@@ -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',
+    },
   },
 }
 
similarity index 99%
rename from src/test/libpq_encryption/t/001_negotiate_encryption.pl
rename to src/interfaces/libpq/t/005_negotiate_encryption.pl
index d07d9498bbc3518c75ce007b193262235dd5fe00..b369289ef1d01489a7addc87a07bb1ef059410fe 100644 (file)
@@ -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 (file)
index 3ad3da7..0000000
+++ /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 (file)
index 8ceb194..0000000
+++ /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 (file)
index ac1db10..0000000
+++ /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',
-    },
-  },
-}
index 702213bc6f6335f8ff7becb751f5ea206225dca8..c3d0dfedf1c5f854800a6681f669dbb0d81b7857 100644 (file)
@@ -4,7 +4,6 @@ subdir('regress')
 subdir('isolation')
 
 subdir('authentication')
-subdir('libpq_encryption')
 subdir('recovery')
 subdir('subscription')
 subdir('modules')