1# $NetBSD: quotas_common.sh,v 1.2 2011/03/06 17:08:41 bouyer Exp $ 2 3create_with_quotas() 4{ 5 local endian=$1; shift 6 local vers=$1; shift 7 local uid=$(id -u) 8 local gid=$(id -g) 9 10 atf_check -o ignore -e ignore newfs -B ${endian} -O ${vers} \ 11 -s 4000 -F ${IMG} 12 atf_check -o ignore -e ignore tunefs -q user -q group -F ${IMG} 13 atf_check -s exit:0 -o 'match:NO USER QUOTA INODE \(CREATED\)' \ 14 -o 'match:USER QUOTA MISMATCH FOR ID '${uid}': 0/0 SHOULD BE 1/1' \ 15 -o 'match:GROUP QUOTA MISMATCH FOR ID '${gid}': 0/0 SHOULD BE 1/1' \ 16 fsck_ffs -p -F ${IMG} 17} 18 19# from tests/ipf/h_common.sh via tests/sbin/resize_ffs 20test_case() 21{ 22 local name="${1}"; shift 23 local check_function="${1}"; shift 24 local descr="${1}"; shift 25 26 atf_test_case "${name}" 27 28 eval "${name}_head() { \ 29 atf_set "descr" "Checks ${descr} quotas inodes" 30 }" 31 eval "${name}_body() { \ 32 ${check_function} " "${@}" "; \ 33 }" 34 tests="${tests} ${name}" 35} 36 37atf_init_test_cases() 38{ 39 IMG=fsimage 40 DIR=target 41 for i in ${tests}; do 42 atf_add_test_case $i 43 done 44} 45