postgresql/src/test/kerberos
Peter Eisentraut d56cb42b54 Activate perlcritic InputOutput::RequireCheckedSyscalls and fix resulting warnings
This checks that certain I/O-related Perl functions properly check
their return value.  Some parts of the PostgreSQL code had been a bit
sloppy about that.  The new perlcritic warnings are fixed here.  I
didn't design any beautiful error messages, mostly just used "or die
$!", which mostly matches existing code, and also this is
developer-level code, so having the system error plus source code
reference should be ok.

Initially, we only activate this check for a subset of what the
perlcritic check would warn about.  The effective list is

    chmod flock open read rename seek symlink system

The initial set of functions is picked because most existing code
already checked the return value of those, so any omissions are
probably unintended, or because it seems important for test
correctness.

The actual perlcritic configuration is written as an exclude list.
That seems better so that we are clear on what we are currently not
checking.  Maybe future patches want to investigate checking some of
the other functions.  (In principle, we might eventually want to check
all of them, but since this is test and build support code, not
production code, there are probably some reasonable compromises to be
made.)

Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://www.postgresql.org/message-id/flat/88b7d4f2-46d9-4cc7-b1f7-613c90f9a76a%40eisentraut.org
2024-03-19 07:09:31 +01:00
..
t Activate perlcritic InputOutput::RequireCheckedSyscalls and fix resulting warnings 2024-03-19 07:09:31 +01:00
.gitignore Tests for Kerberos/GSSAPI authentication 2018-03-06 10:57:36 -05:00
Makefile Update copyright for 2024 2024-01-03 20:49:05 -05:00
README Expand some more uses of "deleg" to "delegation" or "delegated". 2023-05-21 10:55:18 -04:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00

README

src/test/kerberos/README

Tests for Kerberos/GSSAPI functionality
=======================================

This directory contains a test suite for Kerberos/GSSAPI
functionality.  This requires a full MIT Kerberos installation,
including server and client tools, 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.
Also, to use "make installcheck", you must have built and installed
contrib/dblink and contrib/postgres_fdw in addition to the core code.

Run
    make check PG_TEST_EXTRA=kerberos
or
    make installcheck PG_TEST_EXTRA=kerberos
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.

Either way, this test initializes, starts, and stops a test Postgres
cluster, as well as a test KDC server.

See src/test/perl/README for more info about running these tests.

Requirements
============

MIT Kerberos server and client tools are required.  Heimdal is not
supported.

Debian/Ubuntu packages: krb5-admin-server krb5-kdc krb5-user

RHEL/CentOS/Fedora packages: krb5-server krb5-workstation

FreeBSD port: krb5 (base system has Heimdal)