Source-Changes-HG archive

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

[src/trunk]: src Use librumphijack for quota commands instead of rumpifed ver...



details:   https://anonhg.NetBSD.org/src/rev/9fdf98ec5700
branches:  trunk
changeset: 763069:9fdf98ec5700
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed Mar 09 19:04:57 2011 +0000

description:
Use librumphijack for quota commands instead of rumpifed versions.

diffstat:

 distrib/sets/lists/tests/mi          |  10 ++--
 tests/fs/ffs/clients/Makefile        |  61 ------------------------
 tests/fs/ffs/clients/quota_rumpops.c |  89 ------------------------------------
 tests/fs/ffs/t_clearquota.sh         |  10 ++--
 tests/fs/ffs/t_getquota.sh           |  10 ++--
 tests/fs/ffs/t_miscquota.sh          |  10 ++--
 tests/fs/ffs/t_quotalimit.sh         |  42 ++++++++--------
 tests/fs/ffs/t_setquota.sh           |  30 ++++++------
 8 files changed, 56 insertions(+), 206 deletions(-)

diffs (truncated from 555 to 300 lines):

diff -r 90b364801079 -r 9fdf98ec5700 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Wed Mar 09 19:02:04 2011 +0000
+++ b/distrib/sets/lists/tests/mi       Wed Mar 09 19:04:57 2011 +0000
@@ -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
diff -r 90b364801079 -r 9fdf98ec5700 tests/fs/ffs/clients/Makefile
--- a/tests/fs/ffs/clients/Makefile     Wed Mar 09 19:02:04 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -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>
diff -r 90b364801079 -r 9fdf98ec5700 tests/fs/ffs/clients/quota_rumpops.c
--- a/tests/fs/ffs/clients/quota_rumpops.c      Wed Mar 09 19:02:04 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -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;
-}
diff -r 90b364801079 -r 9fdf98ec5700 tests/fs/ffs/t_clearquota.sh
--- a/tests/fs/ffs/t_clearquota.sh      Wed Mar 09 19:02:04 2011 +0000
+++ b/tests/fs/ffs/t_clearquota.sh      Wed Mar 09 19:04:57 2011 +0000
@@ -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 @@
 #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 @@
                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
 }
diff -r 90b364801079 -r 9fdf98ec5700 tests/fs/ffs/t_getquota.sh
--- a/tests/fs/ffs/t_getquota.sh        Wed Mar 09 19:02:04 2011 +0000
+++ b/tests/fs/ffs/t_getquota.sh        Wed Mar 09 19:04:57 2011 +0000
@@ -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 @@
                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 @@
                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
 }
diff -r 90b364801079 -r 9fdf98ec5700 tests/fs/ffs/t_miscquota.sh
--- a/tests/fs/ffs/t_miscquota.sh       Wed Mar 09 19:02:04 2011 +0000
+++ b/tests/fs/ffs/t_miscquota.sh       Wed Mar 09 19:04:57 2011 +0000
@@ -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 @@
        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 @@
        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
 }
diff -r 90b364801079 -r 9fdf98ec5700 tests/fs/ffs/t_quotalimit.sh



Home | Main Index | Thread Index | Old Index