diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-09-08 09:32:50 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-09-08 09:32:50 -0400 |
commit | ed8a7c6fcf92b6b57ed8003bbd4a4eb92a6039bc (patch) | |
tree | 7b4a3b9e7c149b66136c29e41c62262451859d38 /src/test/perl/PostgresNode.pm | |
parent | f0a0c17c1b126882a37ec6bf42ab45a963794c3e (diff) | |
download | postgresql-ed8a7c6fcf92b6b57ed8003bbd4a4eb92a6039bc.tar.gz postgresql-ed8a7c6fcf92b6b57ed8003bbd4a4eb92a6039bc.zip |
Add much-more-extensive TAP tests for pgbench.
Fabien Coelho, reviewed by Nikolay Shaplov and myself
Discussion: https://postgr.es/m/alpine.DEB.2.20.1704171422500.4025@lancre
Diffstat (limited to 'src/test/perl/PostgresNode.pm')
-rw-r--r-- | src/test/perl/PostgresNode.pm | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm index 3a81c1c60b7..edcac6fb9f6 100644 --- a/src/test/perl/PostgresNode.pm +++ b/src/test/perl/PostgresNode.pm @@ -155,8 +155,9 @@ sub new _logfile => "$TestLib::log_path/${testname}_${name}.log" }; bless $self, $class; - mkdir $self->{_basedir} or - BAIL_OUT("could not create data directory \"$self->{_basedir}\": $!"); + mkdir $self->{_basedir} + or + BAIL_OUT("could not create data directory \"$self->{_basedir}\": $!"); $self->dump_info; return $self; @@ -934,8 +935,7 @@ sub get_new_node # Retain the errno on die() if set, else assume a generic errno of 1. # This will instruct the END handler on how to handle artifacts left # behind from tests. -$SIG{__DIE__} = sub -{ +$SIG{__DIE__} = sub { if ($!) { $died = $!; @@ -965,7 +965,7 @@ END # clean basedir on clean test invocation $node->clean_node - if TestLib::all_tests_passing() && !defined $died && !$exit_code; + if TestLib::all_tests_passing() && !defined $died && !$exit_code; } $? = $exit_code; @@ -1325,9 +1325,9 @@ sub command_ok =pod -=item $node->command_fails(...) - TestLib::command_fails with our PGPORT +=item $node->command_fails(...) -See command_ok(...) +TestLib::command_fails with our PGPORT. See command_ok(...) =cut @@ -1359,6 +1359,23 @@ sub command_like =pod +=item $node->command_checks_all(...) + +TestLib::command_checks_all with our PGPORT. See command_ok(...) + +=cut + +sub command_checks_all +{ + my $self = shift; + + local $ENV{PGPORT} = $self->port; + + TestLib::command_checks_all(@_); +} + +=pod + =item $node->issues_sql_like(cmd, expected_sql, test_name) Run a command on the node, then verify that $expected_sql appears in the |