1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00

diff: Use unprivileged_user with report_identical test

Approved by:	bapt
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28466

(cherry picked from commit b67df8d7c2)
This commit is contained in:
Olivier Cochard 2021-02-03 17:18:59 +01:00 committed by Piotr Pawel Stefaniak
parent e81b2348d2
commit 108633bb15

View File

@ -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()