summaryrefslogtreecommitdiff
path: root/src/test/perl/PostgreSQL/Test/Utils.pm
Commit message (Collapse)AuthorAgeFilesLines
* Fix Utils.pm's locale-munging so that Perl itself is also affected.Tom Lane2023-04-181-0/+2
| | | | | | | | | | | | | | | | | | | Utils.pm has a BEGIN block that editorializes on the locale-related environment variables, primarily in order to stabilize the behavior of child programs. It turns out that if the calling test script has already done "use locale", this fails to affect the behavior of Perl itself, causing locale behavior to be different between Perl and child programs. That breaks commit cd82e5c79's attempt to deal with locale-specific behavior in psql. To fix, we just need to call setlocale() to redo the calculation of locale. Per report from Aleksander Alekseev. No back-patch for now, since there are no locale-dependent TAP tests in prior branches, and I'm not yet convinced that this won't have side-effects of its own. Discussion: https://postgr.es/m/CAJ7c6TO9KpYYxoVVseWEQB5KtjWDkt8NfyAeKPcHoe2Jq+ykpw@mail.gmail.com
* De-Revert "Add support for Kerberos credential delegation"Stephen Frost2023-04-131-0/+27
| | | | | | | | | | | | | | | | | | This reverts commit 3d03b24c3 (Revert Add support for Kerberos credential delegation) which was committed on the grounds of concern about portability, but on further review and discussion, it's clear that we are better off explicitly requiring MIT Kerberos as that appears to be the only GSSAPI library currently that's under proper maintenance and ongoing development. The API used for storing credentials was added to MIT Kerberos over a decade ago while for the other libraries which appear to be mainly based on Heimdal, which exists explicitly to be a re-implementation of MIT Kerberos, the API never made it to a released version (even though it was added to the Heimdal git repo over 5 years ago..). This post-feature-freeze change was approved by the RMT. Discussion: https://postgr.es/m/ZDDO6jaESKaBgej0%40tamriel.snowman.net
* Revert "Add support for Kerberos credential delegation"Stephen Frost2023-04-081-27/+0
| | | | | | | | | | | This reverts commit 3d4fa227bce4294ce1cc214b4a9d3b7caa3f0454. Per discussion and buildfarm, this depends on APIs that seem to not be available on at least one platform (NetBSD). Should be certainly possible to rework to be optional on that platform if necessary but bit late for that at this point. Discussion: https://postgr.es/m/3286097.1680922218@sss.pgh.pa.us
* Add support for Kerberos credential delegationStephen Frost2023-04-071-0/+27
| | | | | | | | | | | | | | | | | | | Support GSSAPI/Kerberos credentials being delegated to the server by a client. With this, a user authenticating to PostgreSQL using Kerberos (GSSAPI) credentials can choose to delegate their credentials to the PostgreSQL server (which can choose to accept them, or not), allowing the server to then use those delegated credentials to connect to another service, such as with postgres_fdw or dblink or theoretically any other service which is able to be authenticated using Kerberos. Both postgres_fdw and dblink are changed to allow non-superuser password-less connections but only when GSSAPI credentials have been delegated to the server by the client and GSSAPI is used to authenticate to the remote system. Authors: Stephen Frost, Peifeng Qiu Reviewed-By: David Christensen Discussion: https://postgr.es/m/CO1PR05MB8023CC2CB575E0FAAD7DF4F8A8E29@CO1PR05MB8023.namprd05.prod.outlook.com
* Update copyright for 2023Bruce Momjian2023-01-021-1/+1
| | | | Backpatch-through: 11
* Account for IPC::Run::result() Windows behavior change.Noah Misch2022-11-171-8/+4
| | | | | | | | | This restores compatibility with the not-yet-released successor of version 20220807.0. Back-patch to 9.4, which introduced this code. Reviewed by Andrew Dunstan. Discussion: https://postgr.es/m/20221117061805.GA4020280@rfd.leadboat.com
* Split TESTDIR into TESTLOGDIR and TESTDATADIRAndres Freund2022-09-191-5/+5
| | | | | | | | | | | | | | | | | The motivation for this is twofold. For one the meson patchset would like to have more control over the logfiles. For another, the log file location for tap tests (tmp_check/log) is not symmetric to the log location for pg_regress/isolation tests (log/). This commit does not change the default location for log files for tap tests, as that'd break the buildfarm log collection, it just provides the infrastructure for doing so. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Reviewed-by: Justin Pryzby <pryzby@telsasoft.com> Discussion: https://postgr.es/m/1131990.1660661896@sss.pgh.pa.us Discussion: https://postgr.es/m/20220828170806.GN2342@telsasoft.com
* Don't hardcode tmp_check/ as test directory for tap testsAndres Freund2022-09-191-1/+1
| | | | | | | | | | | | | | | | | | This is motivated by the meson patchset, which wants to put the log / data for tests in a different place than the autoconf build. Right now log files for tap tests have to be inside $TESTDIR/tmp_check, whereas log files for pg_regress/isolationtester are outside of tmp_check. This change doesn't fix the latter, but is a prerequisite. The only test that needs adjustment is 010_tab_completion.pl, as it hardcoded the tmp_check/ directory. Instead create a dedicated directory for the test files. It's also a bit cleaner independently, because it doesn't intermingle the test files with more important things like the log/ directory. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Discussion: https://postgr.es/m/1131990.1660661896@sss.pgh.pa.us Discussion: https://postgr.es/m/d861493c-ed20-c251-7a89-7924f5197341@enterprisedb.com
* Pre-beta mechanical code beautification.Tom Lane2022-05-121-6/+11
| | | | | Run pgindent, pgperltidy, and reformat-dat-files. I manually fixed a couple of comments that pgindent uglified.
* Add diagnostic output on error in pump_untilDaniel Gustafsson2022-03-311-2/+10
| | | | | | | | | When pump_until was moved to Utils.pm in commit 6da65a3f9 the diag calls were removed, this puts them back. Per request from Andres Freund. Discussion: https://postgr.es/m/20220329225819.ahk5u2tax3ez6d2t@alap3.anarazel.de
* Introduce PG_TEST_TIMEOUT_DEFAULT for TAP suite non-elapsing timeouts.Noah Misch2022-03-041-2/+6
| | | | | | | | | | | | Slow hosts may avoid load-induced, spurious failures by setting environment variable PG_TEST_TIMEOUT_DEFAULT to some number of seconds greater than 180. Developers may see faster failures by setting that environment variable to some lesser number of seconds. In tests, write $PostgreSQL::Test::Utils::timeout_default wherever the convention has been to write 180. This change raises the default for some briefer timeouts. Back-patch to v10 (all supported versions). Discussion: https://postgr.es/m/20220218052842.GA3627003@rfd.leadboat.com
* Add function to pump IPC process until string matchDaniel Gustafsson2022-02-231-0/+23
| | | | | | | | | | Refactor the recovery tests to not carry a local duplicated copy of the pump_until function which pumps a process until a defined string is seen on a stream. This reduces duplication, and is in preparation for another patch which will also use this functionality. Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion https://postgr.es/m/YgynUafCyIu3jIhC@paquier.xyz
* Remove most msys special processing in TAP testsAndrew Dunstan2022-02-201-6/+0
| | | | | | | | | | Following migration of Windows buildfarm members running TAP tests to use of ucrt64 perl for those tests, special processing for msys perl is no longer necessary and so is removed. Backpatch to release 10 Discussion: https://postgr.es/m/c65a8781-77ac-ea95-d185-6db291e1baeb@dunslane.net
* Remove PostgreSQL::Test::Utils::perl2host completelyAndrew Dunstan2022-02-201-58/+0
| | | | | | | | | | | Commit f1ac4a74de disabled this processing, and as nothing has broken (as expected) here we proceed to remove the routine and adjust all the call sites. Backpatch to release 10 Discussion: https://postgr.es/m/0ba775a2-8aa0-0d56-d780-69427cf6f33d@dunslane.net Discussion: https://postgr.es/m/20220125023609.5ohu3nslxgoygihl@alap3.anarazel.de
* Disable perl2host() processing in TAP testsAndrew Dunstan2022-02-171-1/+1
| | | | | | | This is a preliminary step towards removing it altogether, but this lets us double check that nothing breaks in the buildfarm before we do. Discussion: https://postgr.es/m/0ba775a2-8aa0-0d56-d780-69427cf6f33d@dunslane.net
* Improve msys2 detection for TAP testsAndrew Dunstan2022-01-271-1/+2
| | | | | | | | Perl instances on some msys toolchains (e.g. UCRT64) have their configured osname set to 'MSWin32' rather than 'msys'. The test for the msys2 platform is adjusted accordingly. Backpatch to release 14.
* On sparc64+ext4, suppress test failures from known WAL read failure.Noah Misch2022-01-261-0/+23
| | | | | | | | | | Buildfarm members kittiwake, tadarida and snapper began to fail frequently when commits 3cd9c3b921977272e6650a5efbeade4203c4bca2 and f47ed79cc8a0cfa154dc7f01faaf59822552363f added tests of concurrency, but the problem was reachable before those commits. Back-patch to v10 (all supported versions). Discussion: https://postgr.es/m/20220116210241.GC756210@rfd.leadboat.com
* Update copyright for 2022Bruce Momjian2022-01-071-1/+1
| | | | Backpatch-through: 10
* Doc: update some things relevant to minimum Test::More version.Tom Lane2021-11-211-2/+1
| | | | | | | Oversights in commit 405f32fc4. Also, add a tip (discovered the hard way) about getting Test::More 0.98 to pass its regression tests on recent Linux platforms.
* Require version 0.98 of Test::More for TAP testsAndrew Dunstan2021-11-201-1/+1
| | | | | | | | | This means that the subtest feature will be available for use. We expect that this change will make prairiedog go red until it is updated, but other buildfarm animals should be fine. Discussion: https://postgr.es/m/f5e1d308-4e33-37a7-bdf1-f6e0c75119de@dunslane.net
* Move Perl test modules to a better namespaceAndrew Dunstan2021-10-241-0/+1007
The five modules in our TAP test framework all had names in the top level namespace. This is unwise because, even though we're not exporting them to CPAN, the names can leak, for example if they are exported by the RPM build process. We therefore move the modules to the PostgreSQL::Test namespace. In the process PostgresNode is renamed to Cluster, and TestLib is renamed to Utils. PostgresVersion becomes simply PostgreSQL::Version, to avoid possible confusion about what it's the version of. Discussion: https://postgr.es/m/aede93a4-7d92-ef26-398f-5094944c2504@dunslane.net Reviewed by Erik Rijkers and Michael Paquier