1 1.1.2.1 bouyer # $NetBSD: quotas_common.sh,v 1.1.2.1 2011/01/20 14:25:04 bouyer Exp $ 2 1.1.2.1 bouyer 3 1.1.2.1 bouyer create_with_quotas() 4 1.1.2.1 bouyer { 5 1.1.2.1 bouyer local endian=$1; shift 6 1.1.2.1 bouyer local vers=$1; shift 7 1.1.2.1 bouyer local type=$1; shift 8 1.1.2.1 bouyer local op; 9 1.1.2.1 bouyer if [ ${type} = "both" ]; then 10 1.1.2.1 bouyer op="-q user -q group" 11 1.1.2.1 bouyer else 12 1.1.2.1 bouyer op="-q ${type}" 13 1.1.2.1 bouyer fi 14 1.1.2.1 bouyer atf_check -o ignore -e ignore newfs ${op} \ 15 1.1.2.1 bouyer -B ${endian} -O ${vers} -s 4000 -F ${IMG} 16 1.1.2.1 bouyer } 17 1.1.2.1 bouyer 18 1.1.2.1 bouyer # from tests/ipf/h_common.sh via tests/sbin/resize_ffs 19 1.1.2.1 bouyer test_case() 20 1.1.2.1 bouyer { 21 1.1.2.1 bouyer local name="${1}"; shift 22 1.1.2.1 bouyer local check_function="${1}"; shift 23 1.1.2.1 bouyer local descr="${1}"; shift 24 1.1.2.1 bouyer 25 1.1.2.1 bouyer atf_test_case "${name}" 26 1.1.2.1 bouyer 27 1.1.2.1 bouyer eval "${name}_head() { \ 28 1.1.2.1 bouyer atf_set "descr" "Checks ${descr} quotas inodes" 29 1.1.2.1 bouyer }" 30 1.1.2.1 bouyer eval "${name}_body() { \ 31 1.1.2.1 bouyer ${check_function} " "${@}" "; \ 32 1.1.2.1 bouyer }" 33 1.1.2.1 bouyer tests="${tests} ${name}" 34 1.1.2.1 bouyer } 35 1.1.2.1 bouyer 36 1.1.2.1 bouyer atf_init_test_cases() 37 1.1.2.1 bouyer { 38 1.1.2.1 bouyer IMG=fsimage 39 1.1.2.1 bouyer DIR=target 40 1.1.2.1 bouyer for i in ${tests}; do 41 1.1.2.1 bouyer atf_add_test_case $i 42 1.1.2.1 bouyer done 43 1.1.2.1 bouyer } 44