From: Christoph Berg Date: Fri, 17 Jul 2015 20:29:30 +0000 (+0200) Subject: Add test for --action=wal_files --lsfunc X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=2185a428ffa7a16a02ad10141e0fdf814bbdbcee;p=check_postgres.git Add test for --action=wal_files --lsfunc --- diff --git a/check_postgres.pl b/check_postgres.pl index 7f4aefe7e..97e0ad596 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -10127,6 +10127,10 @@ Items not specifically attributed are by GSM (Greg Sabino Mullane). Add Spanish message translations (Luis Vazquez) + Allow a wrapper function to run wal_files and archive_ready actions as + non-superuser + (Joshua Elsasser) + =item B June 30, 2015 Add xact timestamp support to hot_standby_delay. diff --git a/t/02_wal_files.t b/t/02_wal_files.t index 7241825e0..c8e080554 100644 --- a/t/02_wal_files.t +++ b/t/02_wal_files.t @@ -6,7 +6,7 @@ use 5.006; use strict; use warnings; use Data::Dumper; -use Test::More tests => 11; +use Test::More tests => 12; use lib 't','.'; use CP_Testing; @@ -64,6 +64,18 @@ is ($cp->run('--critical=1 --output=mrtg'), "99\n0\n\n\n", $t); $t=qq{$S returns correct MRTG information}; is ($cp->run('--critical=101 --output=mrtg'), "99\n0\n\n\n", $t); +# test --lsfunc +$dbh->do(q{CREATE FUNCTION ls_xlog_dir() + RETURNS SETOF TEXT + AS $$ SELECT pg_ls_dir('pg_xlog') $$ + LANGUAGE SQL + SECURITY DEFINER}); +$cp->create_fake_pg_table('ls_xlog_dir', ' '); +$dbh->do(q{INSERT INTO cptest.ls_xlog_dir SELECT 'ABCDEF123456ABCDEF123456' FROM generate_series(1,55)}); +$dbh->commit(); +$t=qq{$S returns correct number of files}; +like ($cp->run('--critical=1 --lsfunc=ls_xlog_dir'), qr{^$label CRITICAL.+ 55 \|}, $t); + $cp->drop_schema_if_exists(); exit;