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