git: efba49ee5a64 - main - diff: tests: loosen up requirements for report_identical
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 19 Apr 2022 04:04:42 UTC
The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=efba49ee5a64f8f56f49e58887484284d785d542 commit efba49ee5a64f8f56f49e58887484284d785d542 Author: Kyle Evans <kevans@FreeBSD.org> AuthorDate: 2022-04-19 04:04:13 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2022-04-19 04:04:13 +0000 diff: tests: loosen up requirements for report_identical This test cannot run without an unprivileged_user being specified anyways, so just run as the unprivileged user. Revoking read permisions works just as well if you're guaranteed non-root. Reviewed by: pstef Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D34950 --- usr.bin/diff/tests/diff_test.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh index fa76c7ada3eb..e0968706acfb 100755 --- a/usr.bin/diff/tests/diff_test.sh +++ b/usr.bin/diff/tests/diff_test.sh @@ -243,17 +243,15 @@ label_body() report_identical_head() { - atf_set "require.config" unprivileged_user - atf_set "require.user" root + atf_set "require.user" unprivileged } 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 su -m "$UNPRIVILEGED_USER" -c 'diff -s A B' + -o empty diff -s A B } non_regular_file_body()