timescaledb/tsl/test/t/005_add_data_node.pl
Markos Fountoulakis 9d0d159ac1 Port perl tests to support PG15
Port the timescaledb perl tests and the corresponding infrastructure to
support the new perl namespace introduced in PG15.

https://github.com/postgres/postgres/commit/b3b4d8e6
2022-09-23 11:40:48 +03:00

40 lines
930 B
Perl

# This file and its contents are licensed under the Timescale License.
# Please see the included NOTICE for copyright information and
# LICENSE-TIMESCALE for a copy of the license.
use strict;
use warnings;
use AccessNode;
use DataNode;
use Test::More tests => 1;
#
# Make sure AN does not crash and produce correct error in case if the
# DN is not properly configured.
#
# Issue:
# https://github.com/timescale/timescaledb/issues/3951
my $an = AccessNode->create('an');
my $dn =
($ENV{PG_VERSION_MAJOR} >= 15)
? PostgreSQL::Test::Cluster->new('dn')
: PostgresNode->get_new_node('dn');
$dn->init();
$dn->start();
my $name = $dn->name;
my $host = $dn->host;
my $port = $dn->port;
my ($ret, $stdout, $stderr) =
$an->psql('postgres',
"SELECT add_data_node('$name', host => '$host', port => $port)");
like(
$stderr,
qr/extension "timescaledb" must be preloaded/,
'failure when adding data node');
done_testing();
1;