Commit 4af81adb authored by Christoph Berg's avatar Christoph Berg

t/003_package_checks.t: Add test case for logrotate.

parent 71fa3aec
......@@ -6,6 +6,7 @@ postgresql-common (153) UNRELEASED; urgency=medium
version (squeeze->wheezy, precise->trusty).
* postgresql-common.postinst: Stop debconf later so ucf can use it.
* postgresql-common.postinst: Call su without - to avoid a warning.
* t/003_package_checks.t: Add test case for logrotate.
* t/020_create_sql_remove.t: Make pipe writes unbuffered.
-- Christoph Berg <christoph.berg@credativ.de> Thu, 09 Jan 2014 12:49:19 +0100
......
......@@ -6,7 +6,7 @@ use lib 't';
use TestLib;
use POSIX qw/setlocale LC_ALL LC_MESSAGES/;
use Test::More tests => 8 + ($#MAJORS+1)*7;
use Test::More tests => 9 + ($#MAJORS+1)*7;
print "Info: PostgreSQL versions installed: @MAJORS\n";
......@@ -25,6 +25,7 @@ foreach my $v (@MAJORS) {
}
ok ((deb_installed 'libecpg-dev'), 'libecpg-dev installed');
ok ((deb_installed 'logrotate'), 'logrotate installed');
ok ((deb_installed 'procps'), 'procps installed');
ok ((deb_installed 'netcat-openbsd'), 'netcat-openbsd installed');
......
......@@ -4,8 +4,9 @@ use strict;
use lib 't';
use TestLib;
use Dpkg::Version;
use Test::More tests => (@MAJORS) * 4;
use Test::More tests => (@MAJORS) * 4 + 1;
# Debian/Ubuntu packages are linked against libedit. If your psql binaries are
# linked against libreadline, set PG_READLINE=1 when running this testsuite.
......@@ -18,4 +19,18 @@ foreach my $v (@MAJORS) {
"psql is not linked against $avoid_lib");
}
my $lrversion = `dpkg-query -f '\${Version}' --show logrotate`;
my $is_logrotate_38 = ($lrversion >= '3.8');
note "logrotate version $lrversion is " . ($is_logrotate_38 ? 'greater' : 'smaller') . " than 3.8";
my $f = "/etc/logrotate.d/postgresql-common";
open F, $f;
undef $/; # slurp mode
my $t = <F>;
close F;
if ($is_logrotate_38) {
like $t, qr/\bsu /, "$f contains su directive";
} else {
unlike $t, qr/\bsu /, "$f does not contain su directive";
}
# vim: filetype=perl
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment