Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Feb 2021 16:23:38 GMT
From:      Olivier Cochard <olivier@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: b67df8d7c203 - main - diff: Use unprivileged_user with report_identical test
Message-ID:  <202102031623.113GNckF044701@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by olivier (ports committer):

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

commit b67df8d7c203a139b5afbe72e1947fbb8c32dc73
Author:     Olivier Cochard <olivier@FreeBSD.org>
AuthorDate: 2021-02-03 16:18:59 +0000
Commit:     Olivier Cochard <olivier@FreeBSD.org>
CommitDate: 2021-02-03 16:18:59 +0000

    diff: Use unprivileged_user with report_identical test
    
    Approved by:    bapt
    Sponsored by:   Netflix
    Differential Revision:  https://reviews.freebsd.org/D28466
---
 usr.bin/diff/tests/diff_test.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh
index 60b56f0d9067..b9d1698d982e 100755
--- a/usr.bin/diff/tests/diff_test.sh
+++ b/usr.bin/diff/tests/diff_test.sh
@@ -228,13 +228,18 @@ label_body()
 		-s exit:1 diff --label hello --label world `which diff` `which ls`
 }
 
+report_identical_head()
+{
+	atf_set "require.config" unprivileged_user
+}
 report_identical_body()
 {
+	UNPRIVILEGED_USER=$(atf_config_get unprivileged_user)
 	printf "\tA\n" > A
 	printf "\tB\n" > B
 	chmod -r B
 	atf_check -s exit:2 -e inline:"diff: B: Permission denied\n" \
-		-o empty diff -s A B
+		-o empty su -m "$UNPRIVILEGED_USER" -c 'diff -s A B'
 }
 
 non_regular_file_body()



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