logo

utils

~/.local/bin tools and git-hooks git clone https://hacktivis.me/git/utils.git
commit: 350b3f01d7811fc9368fce7ad750066f95b28238
parent a0dfb2e9316895985f17eefde0596126a26c59d2
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat, 12 Mar 2022 02:35:45 +0100

test-bin/id: Increase coverage of `noetc` test case

Diffstat:

Mtest-bin/id15++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/test-bin/id b/test-bin/id @@ -37,17 +37,26 @@ group_body() { atf_test_case noetc noetc_body() { - bwrap_args="--ro-bind-try /usr /usr --ro-bind-try /lib /lib --ro-bind-try /lib64 /lib64 --ro-bind ../bin /bin" + bwrap_args="--bind / / --bind /var/empty /etc" command -v bwrap >/dev/null 2>/dev/null || atf_skip "'bwrap' command not found" set -f # shellcheck disable=SC2086 - atf_check -o "inline:uid=$(id -u) gid=$(id -g)\n" -x -- bwrap ${bwrap_args} /bin/id + atf_check -o "inline:uid=$(id -u) gid=$(id -g)\n" -- bwrap ${bwrap_args} ../bin/id + # shellcheck disable=SC2086 + atf_check -o "inline:uid=$(id -ur) gid=$(id -gr)\n" -- bwrap ${bwrap_args} ../bin/id -r # shellcheck disable=SC2086 - atf_check -s exit:1 -x -- bwrap ${bwrap_args} /bin/id -n + atf_check -s exit:1 -- bwrap ${bwrap_args} ../bin/id -n + # shellcheck disable=SC2086 + atf_check -s exit:1 -- bwrap ${bwrap_args} ../bin/id -nr + + # shellcheck disable=SC2086 + atf_check -o "inline:$(id -g)\n" -- bwrap ${bwrap_args} ../bin/id -g + # shellcheck disable=SC2086 + atf_check -o "inline:$(id -gr)\n" -- bwrap ${bwrap_args} ../bin/id -gr } atf_init_test_cases() {