logo

utils

~/.local/bin tools and git-hooks git clone https://hacktivis.me/git/utils.git
commit: 287fe45b053c0712bddf646940316a27299f1334
parent f4704a48ca14f1d05d2cf1d325c8085900fd2d53
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue, 15 Mar 2022 13:27:18 +0100

test-sbin/memsys: Add devfull test

Diffstat:

Mtest-sbin/memsys8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/test-sbin/memsys b/test-sbin/memsys @@ -26,9 +26,17 @@ chmod_000_cleanup() { rm -f tmp-memsys.000 } +atf_test_case devfull +devfull_body() { + command -v bwrap >/dev/null 2>/dev/null || atf_skip "'bwrap' command not found" + + atf_check -s exit:1 -e 'inline:memsys: open("/sys/power/state"): Permission denied\n' -- bwrap --bind / / --bind /dev/full /sys/power/state ../sbin/memsys +} + atf_init_test_cases() { cd "$(atf_get_srcdir)" || exit 1 atf_add_test_case basic atf_add_test_case chmod_000 + atf_add_test_case devfull }