aboutsummaryrefslogtreecommitdiff
path: root/src/test/perl/PostgresNode.pm
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2021-09-01 10:28:01 +0900
committerMichael Paquier <michael@paquier.xyz>2021-09-01 10:28:01 +0900
commitde1d4fef71cb00370aa5f794fe05355c1d063aea (patch)
treed830d2f7c50cfa555292fda6b21b291d4230dd46 /src/test/perl/PostgresNode.pm
parent0f6aa893cb58c2a5a92016914c94865635345a22 (diff)
downloadpostgresql-de1d4fef71cb00370aa5f794fe05355c1d063aea.tar.gz
postgresql-de1d4fef71cb00370aa5f794fe05355c1d063aea.zip
Add PostgresNode::command_fails_like()
This is useful to test for a command failure with some default connection parameters associated to a node, in combination with checks on error patterns expected. This routine will be used by an upcoming future patch, but could be also plugged into some of the existing tests. Extracted from a larger patch by the same author. Author: Ronan Dunklau Discussion: https://postgr.es/m/5742739.ga3mSNWIix@aivenronan
Diffstat (limited to 'src/test/perl/PostgresNode.pm')
-rw-r--r--src/test/perl/PostgresNode.pm20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index 8158ea5b2f5..c59da758c7e 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -2267,6 +2267,26 @@ sub command_like
=pod
+=item $node->command_fails_like(...)
+
+TestLib::command_fails_like with our connection parameters. See command_ok(...)
+
+=cut
+
+sub command_fails_like
+{
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
+ my $self = shift;
+
+ local %ENV = $self->_get_env();
+
+ TestLib::command_fails_like(@_);
+ return;
+}
+
+=pod
+
=item $node->command_checks_all(...)
TestLib::command_checks_all with our connection parameters. See