Use librumphijack for quota commands instead of rumpifed versions.
This commit is contained in:
parent
d0066d8269
commit
37628c8c74
@ -1,4 +1,4 @@
|
||||
# $NetBSD: mi,v 1.261 2011/03/08 12:42:14 pooka Exp $
|
||||
# $NetBSD: mi,v 1.262 2011/03/09 19:04:57 bouyer Exp $
|
||||
#
|
||||
# Note: don't delete entries from here - mark them as "obsolete" instead.
|
||||
#
|
||||
@ -1193,10 +1193,10 @@
|
||||
./usr/tests/fs/ffs/Atffile tests-fs-tests atf
|
||||
./usr/tests/fs/ffs/h_quota2_server tests-fs-tests atf
|
||||
./usr/tests/fs/ffs/h_quota2_tests tests-fs-tests atf
|
||||
./usr/tests/fs/ffs/rump_edquota tests-fs-tests atf
|
||||
./usr/tests/fs/ffs/rump_quota tests-fs-tests atf
|
||||
./usr/tests/fs/ffs/rump_quotactl tests-fs-tests atf
|
||||
./usr/tests/fs/ffs/rump_repquota tests-fs-tests atf
|
||||
./usr/tests/fs/ffs/rump_edquota tests-obsolete obsolete
|
||||
./usr/tests/fs/ffs/rump_quota tests-obsolete obsolete
|
||||
./usr/tests/fs/ffs/rump_quotactl tests-obsolete obsolete
|
||||
./usr/tests/fs/ffs/rump_repquota tests-obsolete obsolete
|
||||
./usr/tests/fs/ffs/t_fifos tests-fs-tests atf
|
||||
./usr/tests/fs/ffs/t_mount tests-fs-tests atf
|
||||
./usr/tests/fs/ffs/t_renamerace tests-obsolete obsolete
|
||||
|
@ -1,61 +0,0 @@
|
||||
# $NetBSD: Makefile,v 1.3 2011/03/07 03:29:26 enami Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
TESTSDIR= ${TESTSBASE}/fs/ffs
|
||||
WARNS= 4
|
||||
|
||||
PROGS= rump_quota rump_repquota rump_edquota rump_quotactl
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/usr.bin/quota
|
||||
SRCS.rump_quota= quota.c printquota.c getvfsquota.c quota_rumpops.c \
|
||||
quotautil.c
|
||||
SRCS.rump_repquota= printquota.c quota_rumpops.c quotautil.c
|
||||
SRCS.rump_edquota= printquota.c getvfsquota.c quota_rumpops.c
|
||||
CPPFLAGS.quota.c+= -I${NETBSDSRCDIR}/usr.bin/quota
|
||||
CPPFLAGS.printquota.c+= -I${NETBSDSRCDIR}/usr.bin/quota
|
||||
CPPFLAGS.getvfsquota.c+=-I${NETBSDSRCDIR}/usr.bin/quota -I${NETBSDSRCDIR}/sys
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/usr.sbin/repquota
|
||||
SRCS.rump_repquota+= repquota.c
|
||||
CPPFLAGS.repquota.c+= -I${NETBSDSRCDIR}/sys -I${NETBSDSRCDIR}/usr.bin/quota
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/usr.sbin/edquota
|
||||
SRCS.rump_edquota+= edquota.c quotautil.c
|
||||
CPPFLAGS.edquota.c+= -I${NETBSDSRCDIR}/sys -I${NETBSDSRCDIR}/usr.bin/quota
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/usr.sbin/quotactl
|
||||
SRCS.rump_quotactl+= quotactl.c quota_rumpops.c
|
||||
CPPFLAGS.quotactl.c+= -I${NETBSDSRCDIR}/sys
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/sys/ufs/ufs
|
||||
SRCS.rump_quota+= quota2_prop.c quota2_subr.c quota1_subr.c
|
||||
SRCS.rump_repquota+= quota2_prop.c quota2_subr.c quota1_subr.c
|
||||
SRCS.rump_edquota+= quota2_prop.c quota1_subr.c
|
||||
SRCS.rump_quotactl+= quota2_prop.c
|
||||
CPPFLAGS.quota2_prop.c+=-I${NETBSDSRCDIR}/sys
|
||||
CPPFLAGS.quota1_subr.c+=-I${NETBSDSRCDIR}/sys
|
||||
CPPFLAGS.quota2_subr.c+=-I${NETBSDSRCDIR}/sys
|
||||
|
||||
DPADD.rump_quota= ${LIBRPCSVC} ${LIBPROP} ${LIBRUMPCLIENT}
|
||||
LDADD.rump_quota= -lrpcsvc -lprop -lrumpclient
|
||||
MAN.rump_quota= # empty
|
||||
BINDIR.rump_quota= ${TESTSDIR}
|
||||
|
||||
DPADD.rump_repquota= ${LIBRPCSVC} ${LIBPROP} ${LIBRUMPCLIENT}
|
||||
LDADD.rump_repquota= -lrpcsvc -lprop -lrumpclient
|
||||
MAN.rump_repquota= # empty
|
||||
BINDIR.rump_repquota= ${TESTSDIR}
|
||||
|
||||
DPADD.rump_edquota= ${LIBRPCSVC} ${LIBPROP} ${LIBRUMPCLIENT}
|
||||
LDADD.rump_edquota= -lrpcsvc -lprop -lrumpclient
|
||||
MAN.rump_edquota= # empty
|
||||
BINDIR.rump_edquota= ${TESTSDIR}
|
||||
|
||||
DPADD.rump_quotactl= ${LIBRPCSVC} ${LIBPROP} ${LIBRUMPCLIENT}
|
||||
LDADD.rump_quotactl= -lrpcsvc -lprop -lrumpclient
|
||||
MAN.rump_quotactl= # empty
|
||||
BINDIR.rump_quotactl= ${TESTSDIR}
|
||||
|
||||
.include <bsd.test.mk>
|
@ -1,89 +0,0 @@
|
||||
/* $NetBSD: quota_rumpops.c,v 1.2 2011/03/06 17:08:41 bouyer Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: quota_rumpops.c,v 1.2 2011/03/06 17:08:41 bouyer Exp $");
|
||||
#endif /* !lint */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <err.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/quota.h>
|
||||
#include <sys/statvfs.h>
|
||||
|
||||
#include <rump/rump.h>
|
||||
#include <rump/rump_syscalls.h>
|
||||
#include <rump/rumpclient.h>
|
||||
|
||||
#ifdef DEBUGJACK
|
||||
#define DPRINTF(x) mydprintf x
|
||||
static void
|
||||
mydprintf(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
if (ISDUP2D(STDERR_FILENO))
|
||||
return;
|
||||
|
||||
va_start(ap, fmt);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
#else
|
||||
#define DPRINTF(x)
|
||||
#endif
|
||||
|
||||
static void __attribute__((constructor))
|
||||
rcinit(void)
|
||||
{
|
||||
DPRINTF("rcinit\n");
|
||||
if (rumpclient_init() == -1)
|
||||
err(1, "rump client init");
|
||||
}
|
||||
|
||||
int __quotactl50(const char *, struct plistref *);
|
||||
int
|
||||
__quotactl50(const char * mnt, struct plistref *p)
|
||||
{
|
||||
int error;
|
||||
error = rump_sys_quotactl(mnt, p);
|
||||
DPRINTF(("quotactl <- %d\n", error));
|
||||
return error;
|
||||
}
|
||||
|
||||
int
|
||||
getvfsstat(struct statvfs *buf, size_t bufsize, int flags)
|
||||
{
|
||||
int error;
|
||||
|
||||
error = rump_sys_getvfsstat(buf, bufsize, flags);
|
||||
DPRINTF(("getvfsstat <- %d\n", error));
|
||||
return error;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: t_clearquota.sh,v 1.2 2011/03/06 17:08:40 bouyer Exp $
|
||||
# $NetBSD: t_clearquota.sh,v 1.3 2011/03/09 19:04:58 bouyer Exp $
|
||||
#
|
||||
# Copyright (c) 2011 Manuel Bouyer
|
||||
# All rights reserved.
|
||||
@ -67,17 +67,17 @@ clear_quota()
|
||||
#set and check the expected quota
|
||||
for q in ${expect} ; do
|
||||
atf_check -s exit:0 \
|
||||
$(atf_get_srcdir)/rump_edquota -$q -s10k/20 -h40M/50k \
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s10k/20 -h40M/50k \
|
||||
-t 2W/3D ${id}
|
||||
atf_check -s exit:0 \
|
||||
-o "match:/mnt 0 10 40960 2weeks 0 20 51200 3days" \
|
||||
-o "match:Disk quotas for .*: $" \
|
||||
$(atf_get_srcdir)/rump_quota -${q} -v ${id}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v ${id}
|
||||
done
|
||||
#now clear the quotas
|
||||
for q in ${expect} ; do
|
||||
atf_check -s exit:0 \
|
||||
$(atf_get_srcdir)/rump_edquota -$q -c ${id}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -c ${id}
|
||||
done;
|
||||
|
||||
#check that we do not get positive reply for any quota type
|
||||
@ -85,7 +85,7 @@ clear_quota()
|
||||
atf_check -s exit:0 -o "not-match:/mnt" \
|
||||
-o "not-match:Disk quotas for .*: $" \
|
||||
-o "match:Disk quotas for .*: none$" \
|
||||
$(atf_get_srcdir)/rump_quota -${q} -v ${id}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v ${id}
|
||||
done
|
||||
rump_shutdown
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: t_getquota.sh,v 1.2 2011/03/06 17:08:40 bouyer Exp $
|
||||
# $NetBSD: t_getquota.sh,v 1.3 2011/03/09 19:04:58 bouyer Exp $
|
||||
#
|
||||
# Copyright (c) 2011 Manuel Bouyer
|
||||
# All rights reserved.
|
||||
@ -66,11 +66,11 @@ get_quota()
|
||||
atf_check -s exit:0 \
|
||||
-o "match:/mnt 0 - - 7days 1 - - 7days" \
|
||||
-o "match:Disk quotas for .*: $" \
|
||||
$(atf_get_srcdir)/rump_quota -${q} -v
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v
|
||||
atf_check -s exit:0 \
|
||||
-o "match:-- 0 - - 1 - -" \
|
||||
-o "not-match:\+\+" \
|
||||
$(atf_get_srcdir)/rump_repquota -${q} /mnt
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -${q} /mnt
|
||||
done
|
||||
|
||||
#check that we do not get positive reply for non-expected quota
|
||||
@ -78,10 +78,10 @@ get_quota()
|
||||
atf_check -s exit:0 -o "not-match:/mnt" \
|
||||
-o "not-match:Disk quotas for .*: $" \
|
||||
-o "match:Disk quotas for .*: none$" \
|
||||
$(atf_get_srcdir)/rump_quota -${q} -v
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v
|
||||
atf_check -s exit:0 \
|
||||
-o "not-match:-- 0 - - 1 - -" \
|
||||
$(atf_get_srcdir)/rump_repquota -${q} /mnt
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -${q} /mnt
|
||||
done
|
||||
rump_shutdown
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: t_miscquota.sh,v 1.2 2011/03/06 17:08:40 bouyer Exp $
|
||||
# $NetBSD: t_miscquota.sh,v 1.3 2011/03/09 19:04:58 bouyer Exp $
|
||||
#
|
||||
# Copyright (c) 2011 Manuel Bouyer
|
||||
# All rights reserved.
|
||||
@ -77,13 +77,13 @@ quota_walk_list()
|
||||
local i=1;
|
||||
while [ $i -lt 101 ]; do
|
||||
atf_check -s exit:0 \
|
||||
$(atf_get_srcdir)/rump_edquota -${expect} \
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -${expect} \
|
||||
-s10k/20 -h40M/50k -t 2W/3D $((i * 4096))
|
||||
i=$((i + 1))
|
||||
done
|
||||
# do a repquota
|
||||
atf_check -s exit:0 -o 'match:<integer>0x64000' \
|
||||
$(atf_get_srcdir)/rump_repquota -x -${expect} /mnt
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -x -${expect} /mnt
|
||||
rump_shutdown
|
||||
}
|
||||
|
||||
@ -115,14 +115,14 @@ quota_snap()
|
||||
local i=1;
|
||||
while [ $i -lt 11 ]; do
|
||||
atf_check -s exit:0 \
|
||||
$(atf_get_srcdir)/rump_edquota -${expect} \
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -${expect} \
|
||||
-s10k/20 -h40M/50k -t 2W/3D $i
|
||||
i=$((i + 1))
|
||||
done
|
||||
# we should have 5 files (root + 4 regular files)
|
||||
atf_check -s exit:0 \
|
||||
-o 'match:- - 7days 5 - - 7days' \
|
||||
$(atf_get_srcdir)/rump_repquota -av
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -av
|
||||
#shutdown and check filesystem
|
||||
rump_shutdown
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: t_quotalimit.sh,v 1.2 2011/03/06 17:08:40 bouyer Exp $
|
||||
# $NetBSD: t_quotalimit.sh,v 1.3 2011/03/09 19:04:58 bouyer Exp $
|
||||
#
|
||||
# Copyright (c) 2011 Manuel Bouyer
|
||||
# All rights reserved.
|
||||
@ -79,7 +79,7 @@ limit_quota()
|
||||
|
||||
for q in ${expect} ; do
|
||||
atf_check -s exit:0 \
|
||||
$(atf_get_srcdir)/rump_edquota -$q -s2k/4 -h3k/6 \
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s2k/4 -h3k/6 \
|
||||
-t 2h/2h ${id}
|
||||
done
|
||||
atf_check -s exit:0 rump.halt
|
||||
@ -91,10 +91,10 @@ limit_quota()
|
||||
for q in ${expect} ; do
|
||||
atf_check -s exit:0 \
|
||||
-o match:'/mnt 3072 B\* 2048 B 3072 B 2:0 2 4 6 ' \
|
||||
$(atf_get_srcdir)/rump_quota -$q -h ${id}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -$q -h ${id}
|
||||
atf_check -s exit:0 \
|
||||
-o match:'daemon \+- 3 2 3 2:0 2 4 6' \
|
||||
$(atf_get_srcdir)/rump_repquota -$q /mnt
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -$q /mnt
|
||||
done
|
||||
rump_shutdown
|
||||
}
|
||||
@ -126,7 +126,7 @@ limit_softquota()
|
||||
|
||||
for q in ${expect} ; do
|
||||
atf_check -s exit:0 \
|
||||
$(atf_get_srcdir)/rump_edquota -$q -s2k/4 -h3k/6 \
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s2k/4 -h3k/6 \
|
||||
-t 1s/1d ${id}
|
||||
done
|
||||
atf_check -s exit:0 rump.halt
|
||||
@ -138,10 +138,10 @@ limit_softquota()
|
||||
for q in ${expect} ; do
|
||||
atf_check -s exit:0 \
|
||||
-o match:'/mnt 2560 B\* 2048 B 3072 B none 2 4 6 ' \
|
||||
$(atf_get_srcdir)/rump_quota -$q -h ${id}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -$q -h ${id}
|
||||
atf_check -s exit:0 \
|
||||
-o match:'daemon \+- 2 2 3 none 2 4 6' \
|
||||
$(atf_get_srcdir)/rump_repquota -$q /mnt
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -$q /mnt
|
||||
done
|
||||
rump_shutdown
|
||||
}
|
||||
@ -173,7 +173,7 @@ limit_iquota()
|
||||
|
||||
for q in ${expect} ; do
|
||||
atf_check -s exit:0 \
|
||||
$(atf_get_srcdir)/rump_edquota -$q -s2m/4 -h3m/6 \
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s2m/4 -h3m/6 \
|
||||
-t 2h/2h ${id}
|
||||
done
|
||||
atf_check -s exit:0 rump.halt
|
||||
@ -185,10 +185,10 @@ limit_iquota()
|
||||
for q in ${expect} ; do
|
||||
atf_check -s exit:0 \
|
||||
-o match:'/mnt 3072 B 2048 K 3072 K 6 \* 4 6 2:0' \
|
||||
$(atf_get_srcdir)/rump_quota -$q -h ${id}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -$q -h ${id}
|
||||
atf_check -s exit:0 \
|
||||
-o match:'daemon -\+ 3 2048 3072 6 4 6 2:0' \
|
||||
$(atf_get_srcdir)/rump_repquota -$q /mnt
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -$q /mnt
|
||||
done
|
||||
rump_shutdown
|
||||
}
|
||||
@ -220,7 +220,7 @@ limit_softiquota()
|
||||
|
||||
for q in ${expect} ; do
|
||||
atf_check -s exit:0 \
|
||||
$(atf_get_srcdir)/rump_edquota -$q -s2m/4 -h3m/6 \
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s2m/4 -h3m/6 \
|
||||
-t 1d/1s ${id}
|
||||
done
|
||||
atf_check -s exit:0 rump.halt
|
||||
@ -232,10 +232,10 @@ limit_softiquota()
|
||||
for q in ${expect} ; do
|
||||
atf_check -s exit:0 \
|
||||
-o match:'/mnt 2560 B 2048 K 3072 K 5 \* 4 6 none' \
|
||||
$(atf_get_srcdir)/rump_quota -$q -h ${id}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -$q -h ${id}
|
||||
atf_check -s exit:0 \
|
||||
-o match:'daemon -\+ 2 2048 3072 5 4 6 none' \
|
||||
$(atf_get_srcdir)/rump_repquota -$q /mnt
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -$q /mnt
|
||||
done
|
||||
rump_shutdown
|
||||
}
|
||||
@ -267,13 +267,13 @@ inherit_defaultquota()
|
||||
|
||||
for q in ${expect} ; do
|
||||
atf_check -s exit:0 \
|
||||
$(atf_get_srcdir)/rump_edquota -$q -s2k/4 -h3k/6 \
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt 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}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -$q -v ${id}
|
||||
done
|
||||
atf_check -s exit:0 rump.halt
|
||||
|
||||
@ -284,10 +284,10 @@ inherit_defaultquota()
|
||||
for q in ${expect} ; do
|
||||
atf_check -s exit:0 \
|
||||
-o match:'/mnt 3072 B\* 2048 B 3072 B 2:0 2 4 6 ' \
|
||||
$(atf_get_srcdir)/rump_quota -$q -h ${id}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -$q -h ${id}
|
||||
atf_check -s exit:0 \
|
||||
-o match:'daemon \+- 3 2 3 2:0 2 4 6' \
|
||||
$(atf_get_srcdir)/rump_repquota -$q /mnt
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -$q /mnt
|
||||
done
|
||||
rump_shutdown
|
||||
}
|
||||
@ -319,13 +319,13 @@ inherit_defaultiquota()
|
||||
|
||||
for q in ${expect} ; do
|
||||
atf_check -s exit:0 \
|
||||
$(atf_get_srcdir)/rump_edquota -$q -s2m/4 -h3m/6 \
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt 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}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -$q -v ${id}
|
||||
done
|
||||
atf_check -s exit:0 rump.halt
|
||||
|
||||
@ -336,10 +336,10 @@ inherit_defaultiquota()
|
||||
for q in ${expect} ; do
|
||||
atf_check -s exit:0 \
|
||||
-o match:'/mnt 3072 B 2048 K 3072 K 6 \* 4 6 2:0' \
|
||||
$(atf_get_srcdir)/rump_quota -$q -h ${id}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -$q -h ${id}
|
||||
atf_check -s exit:0 \
|
||||
-o match:'daemon -\+ 3 2048 3072 6 4 6 2:0' \
|
||||
$(atf_get_srcdir)/rump_repquota -$q /mnt
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -$q /mnt
|
||||
done
|
||||
rump_shutdown
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: t_setquota.sh,v 1.2 2011/03/06 17:08:40 bouyer Exp $
|
||||
# $NetBSD: t_setquota.sh,v 1.3 2011/03/09 19:04:58 bouyer Exp $
|
||||
#
|
||||
# Copyright (c) 2011 Manuel Bouyer
|
||||
# All rights reserved.
|
||||
@ -75,29 +75,29 @@ set_quota()
|
||||
for q in ${expect} ; do
|
||||
local id=$(id -${q})
|
||||
atf_check -s exit:0 \
|
||||
$(atf_get_srcdir)/rump_edquota -$q -s10k/20 -h40M/50k \
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s10k/20 -h40M/50k \
|
||||
-t 2W/3D ${id}
|
||||
atf_check -s exit:0 \
|
||||
-o "match:/mnt 0 10 40960 2weeks 1 20 51200 3days" \
|
||||
-o "match:Disk quotas for .*: $" \
|
||||
$(atf_get_srcdir)/rump_quota -${q} -v
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v
|
||||
atf_check -s exit:0 \
|
||||
-o "match:-- 0 10 40960 1 20 51200" \
|
||||
$(atf_get_srcdir)/rump_repquota -${q} /mnt
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -${q} /mnt
|
||||
done
|
||||
|
||||
#check that we do not get positive reply for non-expected quota
|
||||
for q in ${fail} ; do
|
||||
local id=$(id -${q})
|
||||
atf_check -s exit:0 \
|
||||
$(atf_get_srcdir)/rump_edquota -$q -s10k/20 -h40M/50k ${id}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s10k/20 -h40M/50k ${id}
|
||||
atf_check -s exit:0 -o "not-match:/mnt" \
|
||||
-o "not-match:Disk quotas for .*: $" \
|
||||
-o "match:Disk quotas for .*: none$" \
|
||||
$(atf_get_srcdir)/rump_quota -${q} -v
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v
|
||||
atf_check -s exit:0 \
|
||||
-o "not-match:-- 0 - -" \
|
||||
$(atf_get_srcdir)/rump_repquota -${q} /mnt
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt repquota -${q} /mnt
|
||||
done
|
||||
rump_shutdown
|
||||
}
|
||||
@ -131,23 +131,23 @@ set_quota_new()
|
||||
for q in ${expect} ; do
|
||||
local id=1
|
||||
atf_check -s exit:0 \
|
||||
$(atf_get_srcdir)/rump_edquota -$q -s10k/20 -h40M/50k \
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s10k/20 -h40M/50k \
|
||||
-t 120W/255D ${id}
|
||||
atf_check -s exit:0 \
|
||||
-o "match:/mnt 0 10 40960 2years 0 20 51200 9months" \
|
||||
-o "match:Disk quotas for .*: $" \
|
||||
$(atf_get_srcdir)/rump_quota -${q} -v ${id}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v ${id}
|
||||
done
|
||||
|
||||
#check that we do not get positive reply for non-expected quota
|
||||
for q in ${fail} ; do
|
||||
local id=$(id -${q})
|
||||
atf_check -s exit:0 \
|
||||
$(atf_get_srcdir)/rump_edquota -$q -s10k/20 -h40M/50k ${id}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s10k/20 -h40M/50k ${id}
|
||||
atf_check -s exit:0 -o "not-match:/mnt" \
|
||||
-o "not-match:Disk quotas for .*: $" \
|
||||
-o "match:Disk quotas for .*: none$" \
|
||||
$(atf_get_srcdir)/rump_quota -${q} -v ${id}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v ${id}
|
||||
done
|
||||
rump_shutdown
|
||||
}
|
||||
@ -181,23 +181,23 @@ set_quota_default()
|
||||
for q in ${expect} ; do
|
||||
local id="-d"
|
||||
atf_check -s exit:0 \
|
||||
$(atf_get_srcdir)/rump_edquota -$q -s10k/20 -h40M/50k \
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s10k/20 -h40M/50k \
|
||||
-t 2H2M/3540 ${id}
|
||||
atf_check -s exit:0 \
|
||||
-o "match:/mnt 0 10 40960 2:2 0 20 51200 59" \
|
||||
-o "match:Default (user|group) disk quotas: $" \
|
||||
$(atf_get_srcdir)/rump_quota -${q} -v ${id}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v ${id}
|
||||
done
|
||||
|
||||
#check that we do not get positive reply for non-expected quota
|
||||
for q in ${fail} ; do
|
||||
local id="-d"
|
||||
atf_check -s exit:0 \
|
||||
$(atf_get_srcdir)/rump_edquota -$q -s10k/20 -h40M/50k ${id}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt edquota -$q -s10k/20 -h40M/50k ${id}
|
||||
atf_check -s exit:0 -o "not-match:/mnt" \
|
||||
-o "not-match:Default (user|group) disk quotas: $" \
|
||||
-o "match:Default (user|group) disk quotas: none$" \
|
||||
$(atf_get_srcdir)/rump_quota -${q} -v ${id}
|
||||
env LD_PRELOAD=/usr/lib/librumphijack.so RUMPHIJACK=vfs=getvfsstat,blanket=/mnt quota -${q} -v ${id}
|
||||
done
|
||||
rump_shutdown
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user