Home | History | Annotate | Line # | Download | only in newfs
      1  1.3  jruoho # $NetBSD: t_enable_quotas.sh,v 1.3 2012/03/18 09:31:50 jruoho Exp $
      2  1.2  bouyer #
      3  1.2  bouyer #  Copyright (c) 2011 Manuel Bouyer
      4  1.2  bouyer #  All rights reserved.
      5  1.3  jruoho #
      6  1.2  bouyer #  Redistribution and use in source and binary forms, with or without
      7  1.2  bouyer #  modification, are permitted provided that the following conditions
      8  1.2  bouyer #  are met:
      9  1.2  bouyer #  1. Redistributions of source code must retain the above copyright
     10  1.2  bouyer #     notice, this list of conditions and the following disclaimer.
     11  1.2  bouyer #  2. Redistributions in binary form must reproduce the above copyright
     12  1.2  bouyer #     notice, this list of conditions and the following disclaimer in the
     13  1.2  bouyer #     documentation and/or other materials provided with the distribution.
     14  1.3  jruoho #
     15  1.2  bouyer #  THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     16  1.2  bouyer #  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     17  1.2  bouyer #  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     18  1.2  bouyer #  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     19  1.2  bouyer #  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     20  1.2  bouyer #  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     21  1.2  bouyer #  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     22  1.2  bouyer #  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     23  1.2  bouyer #  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     24  1.2  bouyer #  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     25  1.2  bouyer #  POSSIBILITY OF SUCH DAMAGE.
     26  1.2  bouyer #
     27  1.2  bouyer 
     28  1.2  bouyer for e in le be; do
     29  1.2  bouyer   for v in 1 2; do
     30  1.2  bouyer     for q in "user" "group"; do
     31  1.2  bouyer       test_case enabled_${e}_${v}_${q} quota_enabled_single \
     32  1.2  bouyer 	 "creation of" ${e} ${v} ${q}
     33  1.2  bouyer     done
     34  1.2  bouyer     test_case enabled_${e}_${v}_"both" quota_enabled_both \
     35  1.2  bouyer 	 "creation of" ${e} ${v} "both"
     36  1.2  bouyer   done
     37  1.2  bouyer done
     38  1.2  bouyer 
     39  1.2  bouyer quota_enabled_single()
     40  1.2  bouyer {
     41  1.2  bouyer 	create_with_quotas $*
     42  1.3  jruoho 
     43  1.2  bouyer # check that the quota inode creation didn't corrupt the filesystem
     44  1.2  bouyer 	atf_check -s exit:0 -o "match:already clean" -o "match:2 files" \
     45  1.2  bouyer 		-o "match:Phase 6 - Check Quotas" \
     46  1.2  bouyer 		fsck_ffs -nf -F ${IMG}
     47  1.2  bouyer }
     48  1.2  bouyer 
     49  1.2  bouyer quota_enabled_both()
     50  1.2  bouyer {
     51  1.2  bouyer 	create_with_quotas $*
     52  1.3  jruoho 
     53  1.2  bouyer # check that the quota inode creation didn't corrupt the filesystem
     54  1.2  bouyer 	atf_check -s exit:0 -o "match:already clean" -o "match:3 files" \
     55  1.2  bouyer 		-o "match:Phase 6 - Check Quotas" \
     56  1.2  bouyer 		fsck_ffs -nf -F ${IMG}
     57  1.2  bouyer }
     58