Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/tests/sbin/newfs/quotas_common.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -u -p -r1.1 -r1.2 --- src/tests/sbin/newfs/quotas_common.sh 2011/01/20 14:25:04 1.1 +++ src/tests/sbin/newfs/quotas_common.sh 2011/03/06 17:08:41 1.2 @@ -0,0 +1,43 @@ +# $NetBSD: quotas_common.sh,v 1.2 2011/03/06 17:08:41 bouyer Exp $ + +create_with_quotas() +{ + local endian=$1; shift + local vers=$1; shift + local type=$1; shift + local op; + if [ ${type} = "both" ]; then + op="-q user -q group" + else + op="-q ${type}" + fi + atf_check -o ignore -e ignore newfs ${op} \ + -B ${endian} -O ${vers} -s 4000 -F ${IMG} +} + +# from tests/ipf/h_common.sh via tests/sbin/resize_ffs +test_case() +{ + local name="${1}"; shift + local check_function="${1}"; shift + local descr="${1}"; shift + + atf_test_case "${name}" + + eval "${name}_head() { \ + atf_set "descr" "Checks ${descr} quotas inodes" + }" + eval "${name}_body() { \ + ${check_function} " "${@}" "; \ + }" + tests="${tests} ${name}" +} + +atf_init_test_cases() +{ + IMG=fsimage + DIR=target + for i in ${tests}; do + atf_add_test_case $i + done +}