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