Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Sep 2025 19:33:43 GMT
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: f221f410920d - main - tests/newsyslog: don't hardcode -F for newsyslog execution
Message-ID:  <202509231933.58NJXhgf058617@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=f221f410920df17a2044cd47a23a6f2a1268b44a

commit f221f410920df17a2044cd47a23a6f2a1268b44a
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2025-09-23 09:23:00 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2025-09-23 19:32:26 +0000

    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.
---
 usr.sbin/newsyslog/tests/legacy_test.sh | 38 ++++++++++++++++-----------------
 1 file 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}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202509231933.58NJXhgf058617>