aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2025-09-23 09:23:00 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2025-09-23 19:32:26 +0000
commitf221f410920df17a2044cd47a23a6f2a1268b44a (patch)
treed629841900847f42f1cae416cf2e5afadbb934cf
parent874eaa3821dd678ca27706af3f023844e3094b2e (diff)
tests/newsyslog: don't hardcode -F for newsyslog execution
At the moment all tests need forced rotation, but future tests may not, so let the tests themselves decide if -F is needed. Should be no functional change.
-rw-r--r--usr.sbin/newsyslog/tests/legacy_test.sh38
1 files changed, 19 insertions, 19 deletions
diff --git a/usr.sbin/newsyslog/tests/legacy_test.sh b/usr.sbin/newsyslog/tests/legacy_test.sh
index 1ec48d5a0cc7..c8c18a754977 100644
--- a/usr.sbin/newsyslog/tests/legacy_test.sh
+++ b/usr.sbin/newsyslog/tests/legacy_test.sh
@@ -206,7 +206,7 @@ tmpdir_clean()
run_newsyslog()
{
- newsyslog -f ../newsyslog.conf -F -r "$@"
+ newsyslog -f ../newsyslog.conf -r "$@"
}
tests_normal_rotate() {
@@ -216,17 +216,17 @@ tests_normal_rotate() {
dir="$2"
if [ -n "$dir" ]; then
- newsyslog_args=" -a ${dir}"
+ newsyslog_args="-F -a ${dir}"
name_postfix="${ext} archive dir"
else
- newsyslog_args=""
+ newsyslog_args="-F"
name_postfix="${ext}"
fi
tmpdir_create
begin "create file ${name_postfix}" -newdir
- run_newsyslog -C
+ run_newsyslog -CF
ckfe $LOGFNAME
cknt ${dir}${LOGFNAME}.0${ext}
end
@@ -294,17 +294,17 @@ tests_normal_rotate_keepn() {
dir="$3"
if [ -n "$dir" ]; then
- newsyslog_args=" -a ${dir}"
+ newsyslog_args="-F -a ${dir}"
name_postfix="${ext} archive dir"
else
- newsyslog_args=""
+ newsyslog_args="-F"
name_postfix="${ext}"
fi
tmpdir_create
begin "create file ${name_postfix}" -newdir
- run_newsyslog -C
+ run_newsyslog -CF
ckfe $LOGFNAME
cknt ${dir}${LOGFNAME}.0${ext}
end
@@ -363,10 +363,10 @@ tests_time_rotate() {
dir="$2"
if [ -n "$dir" ]; then
- newsyslog_args="-t DEFAULT -a ${dir}"
+ newsyslog_args="-F -t DEFAULT -a ${dir}"
name_postfix="${ext} archive dir"
else
- newsyslog_args="-t DEFAULT"
+ newsyslog_args="-F -t DEFAULT"
name_postfix="${ext}"
fi
@@ -424,17 +424,17 @@ tests_rfc5424() {
dir="$2"
if [ -n "$dir" ]; then
- newsyslog_args=" -a ${dir}"
+ newsyslog_args="-F -a ${dir}"
name_postfix="${ext} archive dir"
else
- newsyslog_args=""
+ newsyslog_args="-F"
name_postfix="${ext}"
fi
tmpdir_create
begin "RFC-5424 - create file ${name_postfix}" -newdir
- run_newsyslog -C
+ run_newsyslog -CF
ckfe $LOGFNAME
cknt ${dir}${LOGFNAME}.0${ext}
ckfe $LOGFNAME5424
@@ -466,23 +466,23 @@ tests_p_flag_rotate() {
tmpdir_create
begin "create file"
- run_newsyslog -C
+ run_newsyslog -CF
ckfe $LOGFNAME
cknt ${LOGFNAME}.0
cknt ${LOGFNAME}.0${ext}
end
begin "rotate p flag 1 ${ext}"
- run_newsyslog
+ run_newsyslog -F
ckfe $LOGFNAME
ckfe ${LOGFNAME}.0
cknt ${LOGFNAME}.0${ext}
- run_newsyslog
+ run_newsyslog -F
ckfe $LOGFNAME
ckfe ${LOGFNAME}.0
cknt ${LOGFNAME}.0${ext}
ckfe ${LOGFNAME}.1${ext}
- run_newsyslog
+ run_newsyslog -F
ckfe $LOGFNAME
ckfe ${LOGFNAME}.0
cknt ${LOGFNAME}.0${ext}
@@ -501,13 +501,13 @@ tests_normal_rotate_recompress() {
tmpdir_create
begin "create file recompress"
- run_newsyslog -C
+ run_newsyslog -CF
ckfe $LOGFNAME
cknt ${LOGFNAME}.0${ext}
end
begin "rotate normal 1"
- run_newsyslog
+ run_newsyslog -F
ckfe $LOGFNAME
ckfe ${LOGFNAME}.0${ext}
cknt ${LOGFNAME}.1${ext}
@@ -517,7 +517,7 @@ tests_normal_rotate_recompress() {
gunzip ${LOGFNAME}.0${ext}
ckfe ${LOGFNAME}.0
cknt ${LOGFNAME}.0${ext}
- run_newsyslog
+ run_newsyslog -F
ckfe $LOGFNAME
ckfe ${LOGFNAME}.0${ext}
ckfe ${LOGFNAME}.1${ext}