t_miscquota.sh revision 1.1.2.2 1 1.1.2.2 bouyer # $NetBSD: t_miscquota.sh,v 1.1.2.2 2011/02/11 17:28:29 bouyer Exp $
2 1.1.2.1 bouyer #
3 1.1.2.1 bouyer # Copyright (c) 2011 Manuel Bouyer
4 1.1.2.1 bouyer # All rights reserved.
5 1.1.2.1 bouyer #
6 1.1.2.1 bouyer # Redistribution and use in source and binary forms, with or without
7 1.1.2.1 bouyer # modification, are permitted provided that the following conditions
8 1.1.2.1 bouyer # are met:
9 1.1.2.1 bouyer # 1. Redistributions of source code must retain the above copyright
10 1.1.2.1 bouyer # notice, this list of conditions and the following disclaimer.
11 1.1.2.1 bouyer # 2. Redistributions in binary form must reproduce the above copyright
12 1.1.2.1 bouyer # notice, this list of conditions and the following disclaimer in the
13 1.1.2.1 bouyer # documentation and/or other materials provided with the distribution.
14 1.1.2.1 bouyer #
15 1.1.2.1 bouyer # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16 1.1.2.1 bouyer # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17 1.1.2.1 bouyer # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 1.1.2.1 bouyer # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19 1.1.2.1 bouyer # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 1.1.2.1 bouyer # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 1.1.2.1 bouyer # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 1.1.2.1 bouyer # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 1.1.2.1 bouyer # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 1.1.2.1 bouyer # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 1.1.2.1 bouyer # POSSIBILITY OF SUCH DAMAGE.
26 1.1.2.1 bouyer #
27 1.1.2.1 bouyer
28 1.1.2.2 bouyer test_case_root walk_list_user quota_walk_list \
29 1.1.2.1 bouyer "walk user quota list over several disk blocks" -b le 1 user
30 1.1.2.1 bouyer
31 1.1.2.1 bouyer quota_walk_list()
32 1.1.2.1 bouyer {
33 1.1.2.1 bouyer create_with_quotas_server $*
34 1.1.2.1 bouyer local q=$4
35 1.1.2.1 bouyer local expect
36 1.1.2.1 bouyer
37 1.1.2.1 bouyer case ${q} in
38 1.1.2.1 bouyer user)
39 1.1.2.1 bouyer expect=u
40 1.1.2.1 bouyer fail=g
41 1.1.2.1 bouyer ;;
42 1.1.2.1 bouyer group)
43 1.1.2.1 bouyer expect=g
44 1.1.2.1 bouyer fail=u
45 1.1.2.1 bouyer ;;
46 1.1.2.1 bouyer *)
47 1.1.2.1 bouyer atf_fail "wrong quota type"
48 1.1.2.1 bouyer ;;
49 1.1.2.1 bouyer esac
50 1.1.2.1 bouyer
51 1.1.2.1 bouyer # create 100 users, all in the same hash list
52 1.1.2.1 bouyer local i=1;
53 1.1.2.1 bouyer while [ $i -lt 101 ]; do
54 1.1.2.1 bouyer atf_check -s exit:0 \
55 1.1.2.1 bouyer $(atf_get_srcdir)/rump_edquota -${expect} \
56 1.1.2.1 bouyer -s10k/20 -h40M/50k -t 2W/3D $((i * 4096))
57 1.1.2.1 bouyer i=$((i + 1))
58 1.1.2.1 bouyer done
59 1.1.2.1 bouyer # do a repquota
60 1.1.2.1 bouyer atf_check -s exit:0 -o 'match:<integer>0x64000' \
61 1.1.2.1 bouyer $(atf_get_srcdir)/rump_repquota -x -${expect} /mnt
62 1.1.2.1 bouyer rump_shutdown
63 1.1.2.1 bouyer }
64