Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/bouyer-quota2]: src/tests/fs/ffs Check that a new id properly get limits...



details:   https://anonhg.NetBSD.org/src/rev/967c0657b7c8
branches:  bouyer-quota2
changeset: 761105:967c0657b7c8
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed Feb 02 21:01:08 2011 +0000

description:
Check that a new id properly get limits from the defaults.

diffstat:

 tests/fs/ffs/t_quotalimit.sh |  110 ++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 109 insertions(+), 1 deletions(-)

diffs (128 lines):

diff -r 8caca4bc8a29 -r 967c0657b7c8 tests/fs/ffs/t_quotalimit.sh
--- a/tests/fs/ffs/t_quotalimit.sh      Wed Feb 02 19:17:08 2011 +0000
+++ b/tests/fs/ffs/t_quotalimit.sh      Wed Feb 02 21:01:08 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_quotalimit.sh,v 1.1.2.1 2011/02/02 19:17:08 bouyer Exp $ 
+# $NetBSD: t_quotalimit.sh,v 1.1.2.2 2011/02/02 21:01:08 bouyer Exp $ 
 #
 #  Copyright (c) 2011 Manuel Bouyer
 #  All rights reserved.
@@ -36,6 +36,10 @@
         "hit hard limit ino quota with ${q} enabled" ${e} ${v} ${q}
       test_case_root sinolimit_${e}_${v}_${q} limit_softiquota \
         "hit soft limit ino quota with ${q} enabled after grace time" ${e} ${v} ${q}
+      test_case_root herit_defq_${e}_${v}_${q} inherit_defaultquota \
+        "new id herit from default for ${q} quota" ${e} ${v} ${q}
+      test_case_root herit_idefq_${e}_${v}_${q} inherit_defaultiquota \
+        "new id herit from default for ${q} ino quota" ${e} ${v} ${q}
     done
   done
 done
@@ -227,3 +231,107 @@
        done
        rump_shutdown
 }
+
+inherit_defaultquota()
+{
+       create_with_quotas_server $*
+       local q=$3
+       local expect
+       local id=1
+
+       case ${q} in
+       user)
+               expect=u
+               fail=g
+               ;;
+       group)
+               expect=g
+               fail=u
+               ;;
+       both)
+               expect="u g"
+               fail=""
+               ;;
+       *)
+               atf_fail "wrong quota type"
+               ;;
+       esac
+
+       for q in ${expect} ; do
+               atf_check -s exit:0 \
+                  $(atf_get_srcdir)/rump_edquota -$q -s2k/4 -h3k/6 \
+                  -t 2h/2h -d
+       done
+       for q in ${expect} ; do
+               atf_check -s exit:0 \
+                   -o match:'Disk quotas for .*id 1\): none' \
+                   $(atf_get_srcdir)/rump_quota -$q -v ${id}
+       done
+       atf_check -s exit:0 rump.halt
+
+       #now start the server which does the limits tests
+       atf_check -s exit:0 -o ignore \
+-e match:'test 0: write up to hard limit returned 69: Disc quota exceeded' \
+           $(atf_get_srcdir)/h_quota2_tests -b 0 ${IMG} ${RUMP_SERVER}
+       for q in ${expect} ; do
+               atf_check -s exit:0 \
+                   -o match:'/mnt   2560 B\*  2048 B   3072 B     2:0      2       4       6         ' \
+                   $(atf_get_srcdir)/rump_quota -$q -h ${id}
+               atf_check -s exit:0 \
+                   -o match:'daemon    \+-        2        2        3    2:0         2       4       6' \
+                   $(atf_get_srcdir)/rump_repquota -$q /mnt
+       done
+       rump_shutdown
+}
+
+inherit_defaultiquota()
+{
+       create_with_quotas_server $*
+       local q=$3
+       local expect
+       local id=1
+
+       case ${q} in
+       user)
+               expect=u
+               fail=g
+               ;;
+       group)
+               expect=g
+               fail=u
+               ;;
+       both)
+               expect="u g"
+               fail=""
+               ;;
+       *)
+               atf_fail "wrong quota type"
+               ;;
+       esac
+
+       for q in ${expect} ; do
+               atf_check -s exit:0 \
+                  $(atf_get_srcdir)/rump_edquota -$q -s2m/4 -h3m/6 \
+                  -t 2h/2h -d
+       done
+       for q in ${expect} ; do
+               atf_check -s exit:0 \
+                   -o match:'Disk quotas for .*id 1\): none' \
+                   $(atf_get_srcdir)/rump_quota -$q -v ${id}
+       done
+       atf_check -s exit:0 rump.halt
+
+       #now start the server which does the limits tests
+       atf_check -s exit:0 -o ignore \
+-e match:'test 2: create file up to hard limit returned 69: Disc quota exceeded' \
+           $(atf_get_srcdir)/h_quota2_tests -b 2 ${IMG} ${RUMP_SERVER}
+       for q in ${expect} ; do
+               atf_check -s exit:0 \
+                   -o match:'/mnt   2560 B   2048 K   3072 K              5 \*     4       6      2:0' \
+                   $(atf_get_srcdir)/rump_quota -$q -h ${id}
+               atf_check -s exit:0 \
+                   -o match:'daemon    -\+        2     2048     3072                5       4       6    2:0' \
+                   $(atf_get_srcdir)/rump_repquota -$q /mnt
+       done
+       rump_shutdown
+}



Home | Main Index | Thread Index | Old Index