Commit 58f2ea04 authored by Christian Göttsche's avatar Christian Göttsche

New upstream version 3.13.0

parent 578dd769
......@@ -4,7 +4,25 @@ All notable changes to this project will be documented in this file.
## [UNRELEASED]
[UNRELEASED]: https://github.com/logrotate/logrotate/compare/3.12.3...master
[UNRELEASED]: https://github.com/logrotate/logrotate/compare/3.13.0...master
## [3.13.0] - 2017-10-13
- make distribution tarballs report logrotate version properly
[RHBZ#1500264](https://bugzilla.redhat.com/1500264)
- make ```(un)compress work``` even if stdin and/or stdout are closed (#154)
- remove ```-s``` from ```DEFAULT_MAIL_COMMAND``` and improve its documenation (#152)
- uncompress logs before mailing them even if ```delaycompress``` is enabled (#151)
- handle unlink of a non-existing log file as a warning only (#144)
- include compile-time options in the output of ```logrotate --version``` (#145)
- make ```logrotate --version``` print to stdout instead of stderr (#145)
- flush write buffers before syncing state file (#148)
- specify (un)compress utility explicitly in tests (#137)
- enable running tests in parallel (#132)
- explicitly map root UID/GID to 0 on Cygwin (#133)
- add ```.dpkg-bak``` and ```.dpkg-del``` to default tabooext list (#134)
[3.13.0]: https://github.com/logrotate/logrotate/compare/3.12.3...3.13.0
## [3.12.3] - 2017-06-30
......
......@@ -6,21 +6,17 @@ The logrotate utility is designed to simplify the administration of log files on
The latest release is:
* [logrotate-3.12.3](https://github.com/logrotate/logrotate/releases/download/3.12.3/logrotate-3.12.3.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.12.3/logrotate-3.12.3.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.12.3))
* [logrotate-3.13.0](https://github.com/logrotate/logrotate/releases/download/3.13.0/logrotate-3.13.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.13.0/logrotate-3.13.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.13.0))
Previous releases:
* [logrotate-3.12.3](https://github.com/logrotate/logrotate/releases/download/3.12.3/logrotate-3.12.3.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.12.3/logrotate-3.12.3.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.12.3))
* [logrotate-3.12.2](https://github.com/logrotate/logrotate/releases/download/3.12.2/logrotate-3.12.2.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.12.2/logrotate-3.12.2.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.12.2))
* [logrotate-3.12.1](https://github.com/logrotate/logrotate/releases/download/3.12.1/logrotate-3.12.1.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.12.1/logrotate-3.12.1.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.12.1))
* [logrotate-3.12.0](https://github.com/logrotate/logrotate/releases/download/3.12.0/logrotate-3.12.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.12.0/logrotate-3.12.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.12.0))
* [logrotate-3.11.0](https://github.com/logrotate/logrotate/releases/download/3.11.0/logrotate-3.11.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.11.0/logrotate-3.11.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.11.0))
* [logrotate-3.10.0](https://github.com/logrotate/logrotate/releases/download/3.10.0/logrotate-3.10.0.tar.gz) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.10.0))
* [logrotate-3.9.2](https://github.com/logrotate/logrotate/releases/download/3.9.2/logrotate-3.9.2.tar.gz) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.9.2))
* [logrotate-3.9.1](https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.9.1.tar.gz)
* [logrotate-3.9.0](https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.9.0.tar.gz)
* [logrotate-3.8.9](https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.8.9.tar.gz)
* [logrotate-3.8.8](https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.8.8.tar.gz)
* [logrotate-3.8.7](https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.8.7.tar.gz)
## Git checkout
......@@ -46,7 +42,7 @@ and verify the PGP signature on the distribution tarball:
$ gpg --verify logrotate-3.11.0.tar.xz.asc logrotate-3.11.0.tar.xz
If succesful your GPG output should look like this:
If successful your GPG output should look like this:
gpg: Signature made Fri 02 Dec 2016 08:30:39 AM EST
gpg: using RSA key 873DB37572A37B36
......
......@@ -189,7 +189,8 @@ then
v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
v_from_git=1
elif test "x$fallback" = x || git --version >/dev/null 2>&1; then
v=UNKNOWN
# fallback for tarballs produced by 'make dist' (use directory suffix)
v="`basename "$PWD" | sed 's/^[^-]*-//'`"
else
v=$fallback
fi
......
......@@ -130,6 +130,8 @@ static const char *defTabooExts[] = {
",v",
".cfsaved",
".disabled",
".dpkg-bak",
".dpkg-del",
".dpkg-dist",
".dpkg-new",
".dpkg-old",
......@@ -254,15 +256,50 @@ static char *readPath(const char *configFile, int lineNum, const char *key,
return NULL;
}
/* set *pUid to UID of the given user, return non-zero on failure */
static int resolveUid(const char *userName, uid_t *pUid)
{
struct passwd *pw;
#ifdef __CYGWIN__
if (strcmp(userName, "root") == 0) {
*pUid = 0;
return 0;
}
#endif
pw = getpwnam(userName);
if (!pw)
return -1;
*pUid = pw->pw_uid;
endpwent();
return 0;
}
/* set *pGid to GID of the given group, return non-zero on failure */
static int resolveGid(const char *groupName, gid_t *pGid)
{
struct group *gr;
#ifdef __CYGWIN__
if (strcmp(groupName, "root") == 0) {
*pGid = 0;
return 0;
}
#endif
gr = getgrnam(groupName);
if (!gr)
return -1;
*pGid = gr->gr_gid;
endgrent();
return 0;
}
static int readModeUidGid(const char *configFile, int lineNum, char *key,
const char *directive, mode_t *mode, uid_t *uid,
gid_t *gid) {
const char *directive, mode_t *mode, uid_t *pUid,
gid_t *pGid)
{
char u[200], g[200];
unsigned int m;
char tmp;
int rc;
struct group *group;
struct passwd *pw = NULL;
if (!strcmp("su", directive))
/* do not read <mode> for the 'su' directive */
......@@ -291,24 +328,18 @@ static int readModeUidGid(const char *configFile, int lineNum, char *key,
}
if (rc > 1) {
pw = getpwnam(u);
if (!pw) {
if (resolveUid(u, pUid) != 0) {
message(MESS_ERROR, "%s:%d unknown user '%s'\n",
configFile, lineNum, u);
return -1;
}
*uid = pw->pw_uid;
endpwent();
}
if (rc > 2) {
group = getgrnam(g);
if (!group) {
if (resolveGid(g, pGid) != 0) {
message(MESS_ERROR, "%s:%d unknown group '%s'\n",
configFile, lineNum, g);
return -1;
}
*gid = group->gr_gid;
endgrent();
}
return 0;
......@@ -440,7 +471,7 @@ static void copyLogInfo(struct logInfo *to, struct logInfo *from)
to->oldDir = strdup(from->oldDir);
to->criterium = from->criterium;
to->weekday = from->weekday;
to->threshhold = from->threshhold;
to->threshold = from->threshold;
to->minsize = from->minsize;
to->maxsize = from->maxsize;
to->rotateCount = from->rotateCount;
......@@ -658,7 +689,7 @@ int readAllConfigPaths(const char **paths)
.numFiles = 0,
.oldDir = NULL,
.criterium = ROT_SIZE,
.threshhold = 1024 * 1024,
.threshold = 1024 * 1024,
.minsize = 0,
.maxsize = 0,
.rotateCount = 0,
......@@ -1130,7 +1161,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
}
if (!strncmp(opt, "size", 4)) {
newlog->criterium = ROT_SIZE;
newlog->threshhold = size;
newlog->threshold = size;
} else if (!strncmp(opt, "maxsize", 7)) {
newlog->maxsize = size;
} else {
......@@ -1158,7 +1189,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
newlog->criterium = ROT_HOURLY;
} else if (!strcmp(key, "daily")) {
newlog->criterium = ROT_DAYS;
newlog->threshhold = 1;
newlog->threshold = 1;
} else if (!strcmp(key, "monthly")) {
newlog->criterium = ROT_MONTHLY;
} else if (!strcmp(key, "weekly")) {
......@@ -1449,7 +1480,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
newlog->compress_prog);
compresscmd_base = strdup(basename(newlog->compress_prog));
/* we check whether we changed the compress_cmd. In case we use the apropriate extension
/* we check whether we changed the compress_cmd. In case we use the appropriate extension
as listed in compress_cmd_list */
for(i = 0; i < compress_cmd_list_size; i++) {
if (!strcmp(compress_cmd_list[i].cmd, compresscmd_base)) {
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for logrotate 3.12.3.
# Generated by GNU Autoconf 2.69 for logrotate 3.13.0.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
......@@ -577,8 +577,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='logrotate'
PACKAGE_TARNAME='logrotate'
PACKAGE_VERSION='3.12.3'
PACKAGE_STRING='logrotate 3.12.3'
PACKAGE_VERSION='3.13.0'
PACKAGE_STRING='logrotate 3.13.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL='https://github.com/logrotate/logrotate'
......@@ -1286,7 +1286,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures logrotate 3.12.3 to adapt to many kinds of systems.
\`configure' configures logrotate 3.13.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1356,7 +1356,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of logrotate 3.12.3:";;
short | recursive ) echo "Configuration of logrotate 3.13.0:";;
esac
cat <<\_ACEOF
......@@ -1384,7 +1384,7 @@ Optional Packages:
path to state file (/var/lib/logrotate.status by
default)
--with-default-mail-command=COMMAND
default mail command (e.g. /bin/mail -s)
default mail command (e.g. /bin/mail)
--with-compress-command=COMMAND
compress command (default: /bin/gzip)
--with-uncompress-command=COMMAND
......@@ -1469,7 +1469,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
logrotate configure 3.12.3
logrotate configure 3.13.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1891,7 +1891,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by logrotate $as_me 3.12.3, which was
It was created by logrotate $as_me 3.13.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -2240,8 +2240,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
am__api_version='1.15'
ac_aux_dir=
......@@ -2757,7 +2755,7 @@ fi
# Define the identity of the package.
PACKAGE='logrotate'
VERSION='3.12.3'
VERSION='3.13.0'
cat >>confdefs.h <<_ACEOF
......@@ -5900,7 +5898,7 @@ case "$host" in
DEFAULT_MAIL_COMMAND="/usr/bin/mailx"
;;
*-netbsd*)
DEFAULT_MAIL_COMMAND="/usr/bin/mail -s"
DEFAULT_MAIL_COMMAND="/usr/bin/mail"
COMPRESS_COMMAND="/usr/bin/gzip"
UNCOMPRESS_COMMAND="/usr/bin/gunzip"
;;
......@@ -6042,7 +6040,7 @@ done
ac_config_headers="$ac_config_headers config.h"
AM_CFLAGS="-Wall"
AM_CFLAGS="-Wall -Wextra -Wmissing-format-attribute -Wmissing-noreturn -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef -Wunused -Wwrite-strings"
# Check whether --enable-werror was given.
if test "${enable_werror+set}" = set; then :
enableval=$enable_werror; enable_werror="$enableval"
......@@ -6591,7 +6589,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by logrotate $as_me 3.12.3, which was
This file was extended by logrotate $as_me 3.13.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -6658,7 +6656,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
logrotate config.status 3.12.3
logrotate config.status 3.13.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
AC_INIT([logrotate],m4_esyscmd([build-aux/git-version-gen --prefix '' .tarball-version]),
[],[],[https://github.com/logrotate/logrotate])
dnl serial-test not supported prior version 1.12
m4_define([serial_tests], [
m4_esyscmd([automake --version |
perl -nae '{@v = split("[.]", $F[-1]);
if ($v[0] >= 1 && $v[1] >= 12)
{print "serial-tests\n";}
exit;}'
])
])
dnl foreign: Do not require AUTHORS, ChangeLog, NEWS, and README to exist
dnl serial_tests: Do not hide standard output of our sequential test-suite
dnl dist-xz: Produce tar.xz version of the release archive
AM_INIT_AUTOMAKE(foreign dist-xz serial_tests)
AM_INIT_AUTOMAKE(foreign dist-xz)
# --enable-silent-rules
m4_ifdef([AM_SILENT_RULES],
......@@ -82,7 +71,7 @@ case "$host" in
DEFAULT_MAIL_COMMAND="/usr/bin/mailx"
;;
*-netbsd*)
DEFAULT_MAIL_COMMAND="/usr/bin/mail -s"
DEFAULT_MAIL_COMMAND="/usr/bin/mail"
COMPRESS_COMMAND="/usr/bin/gzip"
UNCOMPRESS_COMMAND="/usr/bin/gunzip"
;;
......@@ -110,7 +99,7 @@ AC_SUBST(STATE_FILE_PATH)
AC_ARG_WITH([default-mail-command],
AC_HELP_STRING([--with-default-mail-command=COMMAND],
[default mail command (e.g. /bin/mail -s)]),
[default mail command (e.g. /bin/mail)]),
[
case "$withval" in
yes|no)
......@@ -178,7 +167,7 @@ AC_SUBST(ROOT_UID)
AC_CHECK_FUNCS([asprintf fork madvise qsort strndup strptime vfork vsyslog])
AC_CONFIG_HEADERS([config.h])
AM_CFLAGS="-Wall"
AM_CFLAGS="-Wall -Wextra -Wmissing-format-attribute -Wmissing-noreturn -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef -Wunused -Wwrite-strings"
AC_ARG_ENABLE([werror],
[AS_HELP_STRING([--enable-werror],
[Treat warnings as errors (default: warnings are not errors)])],
......
......@@ -37,6 +37,7 @@ void logToSyslog(int enable) {
#endif
}
__attribute__((format (printf, 3, 0)))
static void log_once(FILE *where, int level, const char *format, va_list args)
{
switch (level) {
......@@ -53,6 +54,7 @@ static void log_once(FILE *where, int level, const char *format, va_list args)
fflush(where);
}
__attribute__((format (printf, 2, 3)))
void message(int level, const char *format, ...)
{
va_list args;
......
.TH LOGROTATE 8 "3.12.3" "Linux" "System Administrator's Manual"
.TH LOGROTATE 8 "3.13.0" "Linux" "System Administrator's Manual"
.SH NAME
logrotate \(hy rotates, compresses, and mails system logs
.SH SYNOPSIS
......@@ -63,9 +63,9 @@ output logged to that file is the same as when running \fBlogrotate\fR with
.TP
\fB\-m\fR, \fB\-\-mail\fR \fIcommand\fR
Tells \fBlogrotate\fR which command to use when mailing logs. This
command should accept two arguments:
command should accept the following arguments:
.IP
1) the subject of the message
1) the subject of the message given with '-s subject'
.br
2) the recipient.
.IP
......@@ -576,6 +576,8 @@ is replaced. At startup, the taboo extension list
.IR ,v ,
.IR .cfsaved ,
.IR .disabled ,
.IR .dpkg\-bak ,
.IR .dpkg\-del ,
.IR .dpkg\-dist ,
.IR .dpkg\-new ,
.IR .dpkg\-old ,
......@@ -600,7 +602,7 @@ is replaced. At startup, the taboo pattern list is empty.
\fBweekly\fR [\fIweekday\fR]
Log files are rotated once each \fIweekday\fR, or if the date is advanced by at
least 7 days since the last rotation (while ignoring the exact time). The
\fIweekday\fR intepretation is following: 0 means Sunday, 1 means Monday, ...,
\fIweekday\fR interpretation is following: 0 means Sunday, 1 means Monday, ...,
6 means Saturday; the special value 7 means each 7 days, irrespectively of
weekday. Defaults to 0 if the \fIweekday\fR argument is omitted.
......
......@@ -63,9 +63,9 @@ output logged to that file is the same as when running \fBlogrotate\fR with
.TP
\fB\-m\fR, \fB\-\-mail\fR \fIcommand\fR
Tells \fBlogrotate\fR which command to use when mailing logs. This
command should accept two arguments:
command should accept the following arguments:
.IP
1) the subject of the message
1) the subject of the message given with '-s subject'
.br
2) the recipient.
.IP
......@@ -576,6 +576,8 @@ is replaced. At startup, the taboo extension list
.IR ,v ,
.IR .cfsaved ,
.IR .disabled ,
.IR .dpkg\-bak ,
.IR .dpkg\-del ,
.IR .dpkg\-dist ,
.IR .dpkg\-new ,
.IR .dpkg\-old ,
......@@ -600,7 +602,7 @@ is replaced. At startup, the taboo pattern list is empty.
\fBweekly\fR [\fIweekday\fR]
Log files are rotated once each \fIweekday\fR, or if the date is advanced by at
least 7 days since the last rotation (while ignoring the exact time). The
\fIweekday\fR intepretation is following: 0 means Sunday, 1 means Monday, ...,
\fIweekday\fR interpretation is following: 0 means Sunday, 1 means Monday, ...,
6 means Saturday; the special value 7 means each 7 days, irrespectively of
weekday. Defaults to 0 if the \fIweekday\fR argument is omitted.
......
This diff is collapsed.
......@@ -49,7 +49,7 @@ struct logInfo {
enum { ROT_HOURLY, ROT_DAYS, ROT_WEEKLY, ROT_MONTHLY, ROT_YEARLY, ROT_SIZE
} criterium;
int weekday; /* used by ROT_WEEKLY only */
off_t threshhold;
off_t threshold;
off_t maxsize;
off_t minsize;
int rotateCount;
......
Summary: Rotates, compresses, removes and mails system log files
Name: logrotate
Version: 3.12.3
Version: 3.13.0
Release: 1%{?dist}
License: GPLv2+
Group: System Environment/Base
......
#! /bin/sh
# test-driver - basic testsuite driver script.
scriptversion=2013-07-13.22; # UTC
# Copyright (C) 2011-2014 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
# Make unconditional expansion of undefined variables an error. This
# helps a lot in preventing typo-related bugs.
set -u
usage_error ()
{
echo "$0: $*" >&2
print_usage >&2
exit 2
}
print_usage ()
{
cat <<END
Usage:
test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
[--expect-failure={yes|no}] [--color-tests={yes|no}]
[--enable-hard-errors={yes|no}] [--]
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
END
}
test_name= # Used for reporting.
log_file= # Where to save the output of the test script.
trs_file= # Where to save the metadata of the test run.
expect_failure=no
color_tests=no
enable_hard_errors=yes
while test $# -gt 0; do
case $1 in
--help) print_usage; exit $?;;
--version) echo "test-driver $scriptversion"; exit $?;;
--test-name) test_name=$2; shift;;
--log-file) log_file=$2; shift;;
--trs-file) trs_file=$2; shift;;
--color-tests) color_tests=$2; shift;;
--expect-failure) expect_failure=$2; shift;;
--enable-hard-errors) enable_hard_errors=$2; shift;;
--) shift; break;;
-*) usage_error "invalid option: '$1'";;
*) break;;
esac
shift
done
missing_opts=
test x"$test_name" = x && missing_opts="$missing_opts --test-name"
test x"$log_file" = x && missing_opts="$missing_opts --log-file"
test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
if test x"$missing_opts" != x; then
usage_error "the following mandatory options are missing:$missing_opts"
fi
if test $# -eq 0; then
usage_error "missing argument"
fi
if test $color_tests = yes; then
# Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
red='' # Red.
grn='' # Green.
lgn='' # Light green.
blu='' # Blue.
mgn='' # Magenta.
std='' # No color.
else
red= grn= lgn= blu= mgn= std=
fi
do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
trap "st=129; $do_exit" 1
trap "st=130; $do_exit" 2
trap "st=141; $do_exit" 13
trap "st=143; $do_exit" 15
# Test script is run here.
"$@" >$log_file 2>&1
estatus=$?
if test $enable_hard_errors = no && test $estatus -eq 99; then
tweaked_estatus=1
else
tweaked_estatus=$estatus
fi
case $tweaked_estatus:$expect_failure in
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
0:*) col=$grn res=PASS recheck=no gcopy=no;;
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
*:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
esac
# Report the test outcome and exit status in the logs, so that one can
# know whether the test passed or failed simply by looking at the '.log'
# file, without the need of also peaking into the corresponding '.trs'
# file (automake bug#11814).
echo "$res $test_name (exit status: $estatus)" >>$log_file
# Report outcome to console.
echo "${col}${res}${std}: $test_name"
# Register the test result, and other relevant metadata.
echo ":test-result: $res" > $trs_file
echo ":global-test-result: $res" >> $trs_file
echo ":recheck: $recheck" >> $trs_file
echo ":copy-in-global-log: $gcopy" >> $trs_file
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
TEST_CASES = \
test-0001.sh \
test-0002.sh \
test-0003.sh \
test-0004.sh \
test-0005.sh \
test-0006.sh \
test-0007.sh \
test-0008.sh \
test-0009.sh \
test-0010.sh \
test-0011.sh \
test-0012.sh \
test-0013.sh \
test-0014.sh \
test-0015.sh \
test-0016.sh \
test-0017.sh \
test-0018.sh \
test-0019.sh \
test-0020.sh \
test-0021.sh \
test-0022.sh \
test-0023.sh \
test-0024.sh \
test-0025.sh \
test-0026.sh \
test-0027.sh \
test-0028.sh \
test-0029.sh \
test-0030.sh \
test-0031.sh \
test-0032.sh \
test-0033.sh \
test-0034.sh \
test-0035.sh \
test-0036.sh \
test-0037.sh \
test-0038.sh \
test-0039.sh \
test-0040.sh \
test-0041.sh \
test-0042.sh \
test-0043.sh \
test-0044.sh \
test-0045.sh \
test-0046.sh \
test-0047.sh \
test-0048.sh \
test-0049.sh \
test-0050.sh \
test-0051.sh \
test-0052.sh \
test-0053.sh \
test-0054.sh \
test-0055.sh \
test-0056.sh \
test-0057.sh \
test-0058.sh \
test-0059.sh \
test-0060.sh \
test-0061.sh \
test-0062.sh \
test-0063.sh \
test-0064.sh \
test-0065.sh \
test-0066.sh \
test-0067.sh \
test-0068.sh \
test-0069.sh \
test-0070.sh \
test-0071.sh \
test-0072.sh \
test-0073.sh \
test-0074.sh \
test-0075.sh \
test-0076.sh \
test-0100.sh \
test-0101.sh
EXTRA_DIST = \
compress \
compress-error \
mailer \
test \
test-common.sh \
test-common-acl.sh \
test-common-selinux.sh \
$(TEST_CASES) \
$(top_srcdir)/test/test-config.*.in
DISTCLEANFILES = \
test.ACL \
test.SELINUX \
test.example
test.example \
test-????/*
# this needs to run exactly once even if tests run in parallel
all:
test $(top_srcdir) = $(top_builddir) || ln -fs $(top_srcdir)/test/* .
TESTS_ENVIRONMENT = \
test $(top_srcdir) = $(top_builddir) || ln -fs $(top_srcdir)/test/* . ; \
export LOGROTATE=$(top_builddir)/logrotate ;
TESTS = test
TESTS = $(TEST_CASES)