summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Berg2015-07-17 20:29:30 +0000
committerChristoph Berg2015-07-17 20:29:30 +0000
commit2185a428ffa7a16a02ad10141e0fdf814bbdbcee (patch)
tree71d2f7a0ade44c247f7862295defdb8196ba339c
parent1e06b0d8754ec0953d7f4976e3d8dff125718df4 (diff)
Add test for --action=wal_files --lsfunc
-rwxr-xr-xcheck_postgres.pl4
-rw-r--r--t/02_wal_files.t14
2 files changed, 17 insertions, 1 deletions
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<Version 2.22.0> 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;