Skip to content

Commit 14870a8

Browse files
committed
Add TAP framework.
1 parent 38ab850 commit 14870a8

4 files changed

Lines changed: 30 additions & 2 deletions

File tree

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ PGFILEDESC = "pgAudit - An audit logging extension for PostgreSQL"
99

1010
REGRESS = pgaudit
1111
REGRESS_OPTS = --temp-config=$(top_srcdir)/contrib/pgaudit/pgaudit.conf
12+
TAP_TESTS = 1
1213

1314
ifdef USE_PGXS
1415
PG_CONFIG = pg_config

t/010_all.pl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
use strict;
2+
use warnings FATAL => 'all';
3+
use Test::More;
4+
5+
use DBI;
6+
use PostgreSQL::Test::Cluster;
7+
8+
# Initialize and start cluster
9+
my $node = PostgreSQL::Test::Cluster->new('main');
10+
$node->init;
11+
$node->append_conf('postgresql.conf', "shared_preload_libraries = 'pgaudit'");
12+
$node->start;
13+
14+
# Connect to cluster
15+
my $db = DBI->connect(
16+
"dbi:Pg:dbname=postgres;port=" . $node->port() . ";host=" . $node->host(),
17+
"postgres", undef,
18+
{AutoCommit => 0, RaiseError => 1, PrintError => 1});
19+
20+
# !!! REPLACE WITH REAL TESTS
21+
is($db->do("select 1"), 1);
22+
23+
# Disconnect and stop cluster
24+
undef($db);
25+
$node->stop;
26+
27+
done_testing();

test/Dockerfile.debian

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM ubuntu:jammy
33
# Install packages
44
RUN apt-get update
55
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y sudo wget gnupg tzdata locales lsb-release apt-utils make gcc libssl-dev \
6-
libkrb5-dev
6+
libkrb5-dev libdbd-pg-perl
77

88
# Create postgres user/group with specific IDs
99
ARG UID=1000

test/Dockerfile.rhel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM rockylinux/rockylinux:8
22

33
# Install packages
4-
RUN dnf install -y sudo make gcc llvm-toolset openssl-devel redhat-rpm-config
4+
RUN dnf install -y sudo make gcc llvm-toolset openssl-devel redhat-rpm-config perl perl-DBD-Pg
55

66
# Install and enable EPEL repository
77
RUN dnf -y install epel-release

0 commit comments

Comments
 (0)