CVS commit: src/tests/fs/common

2020-06-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun  1 14:42:03 UTC 2020

Modified Files:
src/tests/fs/common: Makefile

Log Message:
LIBISPRIVATE=yes


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tests/fs/common/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/Makefile
diff -u src/tests/fs/common/Makefile:1.13 src/tests/fs/common/Makefile:1.14
--- src/tests/fs/common/Makefile:1.13	Sun Oct 13 03:28:14 2019
+++ src/tests/fs/common/Makefile	Mon Jun  1 10:42:03 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2019/10/13 07:28:14 mrg Exp $
+#	$NetBSD: Makefile,v 1.14 2020/06/01 14:42:03 christos Exp $
 #
 
 .include 
@@ -27,7 +27,7 @@ CPPFLAGS+=	-DDEBUG -DLIBWRAP -DRUMP_RPC
 CPPFLAGS+=	-I${LIBC}/include -I${LIBC}/rpc
 
 
-LIBISPRIVATE=	# yup
+LIBISPRIVATE=	yes
 
 # NFS client stuff
 .PATH:	${NETBSDSRCDIR}/sbin/mount_nfs ${NETBSDSRCDIR}/sbin/mount



CVS commit: src/tests/fs/common

2020-06-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun  1 14:42:03 UTC 2020

Modified Files:
src/tests/fs/common: Makefile

Log Message:
LIBISPRIVATE=yes


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tests/fs/common/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2020-03-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar 15 12:12:42 UTC 2020

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Hardcode a check for ZFS and too little free space in workdir to skip
ZFS tests if the atf working directory is size restricted (ZFS has a
hardcoded minimal size of 64MB for a storage pool and 128 MB disk size).


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2020-03-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar 15 12:12:42 UTC 2020

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Hardcode a check for ZFS and too little free space in workdir to skip
ZFS tests if the atf working directory is size restricted (ZFS has a
hardcoded minimal size of 64MB for a storage pool and 128 MB disk size).


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.42 src/tests/fs/common/h_fsmacros.h:1.43
--- src/tests/fs/common/h_fsmacros.h:1.42	Tue Jun 19 09:20:46 2018
+++ src/tests/fs/common/h_fsmacros.h	Sun Mar 15 12:12:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.42 2018/06/19 09:20:46 gson Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.43 2020/03/15 12:12:42 martin Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -249,6 +249,14 @@ static __inline bool
 atf_check_fstype(const atf_tc_t *tc, const char *fs)
 {
 	const char *fstype;
+	struct statvfs fsstat;
+
+	if (strcmp(fs, "zfs") == 0) {
+		/* XXX ZFS hardcodes a minimal size */
+		if (statvfs(".", ) == 0 &&
+		(fsstat.f_frsize * fsstat.f_bfree) <= 64*1024*1024)
+			atf_tc_skip("not enough free space in work directory");
+	}
 
 	if (!atf_tc_has_config_var(tc, "fstype"))
 		return true;



CVS commit: src/tests/fs/common

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct  5 22:06:29 UTC 2019

Modified Files:
src/tests/fs/common: fstest_nfs.c

Log Message:
sprintf->snprintf


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/fs/common/fstest_nfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2019-10-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct  5 22:06:29 UTC 2019

Modified Files:
src/tests/fs/common: fstest_nfs.c

Log Message:
sprintf->snprintf


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/fs/common/fstest_nfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_nfs.c
diff -u src/tests/fs/common/fstest_nfs.c:1.10 src/tests/fs/common/fstest_nfs.c:1.11
--- src/tests/fs/common/fstest_nfs.c:1.10	Fri Feb  1 09:06:07 2019
+++ src/tests/fs/common/fstest_nfs.c	Sat Oct  5 22:06:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_nfs.c,v 1.10 2019/02/01 09:06:07 mrg Exp $	*/
+/*	$NetBSD: fstest_nfs.c,v 1.11 2019/10/05 22:06:29 mrg Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -87,10 +87,12 @@ donewfs(const atf_tc_t *tc, void **argp,
 	 * First, we start the nfs service.
 	 */
 	srcdir = atf_tc_get_config_var(tc, "srcdir");
-	sprintf(nfsdpath, "%s/../nfs/nfsservice/rumpnfsd", srcdir);
-	sprintf(ethername, "/%s/%s.etherbus", getcwd(cwd, sizeof(cwd)), image);
-	sprintf(ethername_ro, "%s_ro", ethername);
-	sprintf(imagepath, "/%s/%s", cwd, image);
+	snprintf(nfsdpath, sizeof nfsdpath,
+	"%s/../nfs/nfsservice/rumpnfsd", srcdir);
+	snprintf(ethername, sizeof ethername,
+	"/%s/%s.etherbus", getcwd(cwd, sizeof(cwd)), image);
+	snprintf(ethername_ro, sizeof ethername_ro, "%s_ro", ethername);
+	snprintf(imagepath, sizeof imagepath, "/%s/%s", cwd, image);
 
 	nfsdargv[0] = nfsdpath;
 	nfsdargv[1] = ethername;



CVS commit: src/tests/fs/common

2019-08-30 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Fri Aug 30 23:45:13 UTC 2019

Modified Files:
src/tests/fs/common: fstest_lfs.c

Log Message:
The cleaner is compiled into the ATF test harness for the LFS
filesystem tests.  Use the new -J option to pass the raw device into
the cleaner.  This avoids the not rump safe getdiskrawname call and
makes sure we use an internal rump device name for cleaning.  This
should fix bin/54488.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/common/fstest_lfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_lfs.c
diff -u src/tests/fs/common/fstest_lfs.c:1.6 src/tests/fs/common/fstest_lfs.c:1.7
--- src/tests/fs/common/fstest_lfs.c:1.6	Sun Jan 20 14:50:58 2019
+++ src/tests/fs/common/fstest_lfs.c	Fri Aug 30 23:45:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_lfs.c,v 1.6 2019/01/20 14:50:58 gson Exp $	*/
+/*	$NetBSD: fstest_lfs.c,v 1.7 2019/08/30 23:45:13 brad Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -125,7 +125,7 @@ cleaner(void *arg)
 {
 	char thepath[MAXPATHLEN];
 	struct lfstestargs *args = arg;
-	const char *the_argv[7];
+	const char *the_argv[9];
 	char buf[64];
 
 	rump_pub_lwproc_newlwp(rump_sys_getpid());
@@ -139,14 +139,16 @@ cleaner(void *arg)
 	the_argv[1] = "-D"; /* don't fork() & detach */
 	the_argv[2] = "-S";
 	the_argv[3] = buf;
-	the_argv[4] = args->ta_mntpath;
-	the_argv[5] = NULL;
+	the_argv[4] = "-J";
+	the_argv[5] = thepath;
+	the_argv[6] = args->ta_mntpath;
+	the_argv[7] = NULL;
 
 	/* xxxatf */
 	optind = 1;
 	opterr = 1;
 
-	lfs_cleaner_main(5, __UNCONST(the_argv));
+	lfs_cleaner_main(7, __UNCONST(the_argv));
 
 	rump_pub_lwproc_releaselwp();
 



CVS commit: src/tests/fs/common

2019-08-30 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Fri Aug 30 23:45:13 UTC 2019

Modified Files:
src/tests/fs/common: fstest_lfs.c

Log Message:
The cleaner is compiled into the ATF test harness for the LFS
filesystem tests.  Use the new -J option to pass the raw device into
the cleaner.  This avoids the not rump safe getdiskrawname call and
makes sure we use an internal rump device name for cleaning.  This
should fix bin/54488.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/common/fstest_lfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2019-01-20 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Jan 20 14:50:58 UTC 2019

Modified Files:
src/tests/fs/common: fstest_lfs.c

Log Message:
Call rump_pub_lwproc_newlwp() in the lfs cleaner thread to make its
rump system calls all use the same lwp.  Hopefully this will fix
PR kern/53884.  Also call rump_pub_lwproc_releaselwp() at the end.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/common/fstest_lfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2019-01-20 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Jan 20 14:50:58 UTC 2019

Modified Files:
src/tests/fs/common: fstest_lfs.c

Log Message:
Call rump_pub_lwproc_newlwp() in the lfs cleaner thread to make its
rump system calls all use the same lwp.  Hopefully this will fix
PR kern/53884.  Also call rump_pub_lwproc_releaselwp() at the end.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/common/fstest_lfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_lfs.c
diff -u src/tests/fs/common/fstest_lfs.c:1.5 src/tests/fs/common/fstest_lfs.c:1.6
--- src/tests/fs/common/fstest_lfs.c:1.5	Sun Aug 30 18:27:26 2015
+++ src/tests/fs/common/fstest_lfs.c	Sun Jan 20 14:50:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_lfs.c,v 1.5 2015/08/30 18:27:26 dholland Exp $	*/
+/*	$NetBSD: fstest_lfs.c,v 1.6 2019/01/20 14:50:58 gson Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -128,6 +128,8 @@ cleaner(void *arg)
 	const char *the_argv[7];
 	char buf[64];
 
+	rump_pub_lwproc_newlwp(rump_sys_getpid());
+
 	/* this inspired by the cleaner code.  fixme */
 	sprintf(thepath, "/dev/r%s", args->ta_devpath+5);
 	rump_pub_etfs_register(thepath, args->ta_hostpath, RUMP_ETFS_CHR);
@@ -146,6 +148,8 @@ cleaner(void *arg)
 
 	lfs_cleaner_main(5, __UNCONST(the_argv));
 
+	rump_pub_lwproc_releaselwp();
+
 	return NULL;
 }
 



CVS commit: src/tests/fs/common

2015-08-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Aug 30 18:27:26 UTC 2015

Modified Files:
src/tests/fs/common: fstest_lfs.c

Log Message:
Remove rubbish.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/common/fstest_lfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_lfs.c
diff -u src/tests/fs/common/fstest_lfs.c:1.4 src/tests/fs/common/fstest_lfs.c:1.5
--- src/tests/fs/common/fstest_lfs.c:1.4	Fri Jul 30 16:15:05 2010
+++ src/tests/fs/common/fstest_lfs.c	Sun Aug 30 18:27:26 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_lfs.c,v 1.4 2010/07/30 16:15:05 pooka Exp $	*/
+/*	$NetBSD: fstest_lfs.c,v 1.5 2015/08/30 18:27:26 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -48,8 +48,6 @@
 #include h_fsmacros.h
 #include mount_lfs.h
 
-sem_t lfs_clearnerloop;
-
 struct lfstestargs {
 	struct ufs_args ta_uargs;
 	pthread_t ta_cleanerthread;



CVS commit: src/tests/fs/common

2015-08-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Aug 30 18:27:26 UTC 2015

Modified Files:
src/tests/fs/common: fstest_lfs.c

Log Message:
Remove rubbish.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/common/fstest_lfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2015-08-29 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Aug 29 19:19:43 UTC 2015

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Fix glaringly wrong indent.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.39 src/tests/fs/common/h_fsmacros.h:1.40
--- src/tests/fs/common/h_fsmacros.h:1.39	Tue Mar 24 23:22:47 2015
+++ src/tests/fs/common/h_fsmacros.h	Sat Aug 29 19:19:43 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.39 2015/03/24 23:22:47 riastradh Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.40 2015/08/29 19:19:43 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -145,7 +145,7 @@ do {	\
 			atf_tc_fail_errno(unmount r/w failed);	\
 		if (_fs_##_fstest_mount(tc, _fs_##_func_##tmp,		\
 		FSTEST_MNTNAME, MNT_RDONLY) != 0)			\
-		atf_tc_fail_errno(mount ro failed);			\
+			atf_tc_fail_errno(mount ro failed);		\
 		_func_(tc,FSTEST_MNTNAME);\
 		if (_fs_##_fstest_unmount(tc, FSTEST_MNTNAME, 0) != 0) {\
 			rump_pub_vfs_mount_print(FSTEST_MNTNAME, 1);	\



CVS commit: src/tests/fs/common

2015-08-29 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Aug 29 19:19:43 UTC 2015

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Fix glaringly wrong indent.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2015-03-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Mar 24 23:22:47 UTC 2015

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
zfs tests don't actually need privileges.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2015-03-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Mar 24 23:22:47 UTC 2015

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
zfs tests don't actually need privileges.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.38 src/tests/fs/common/h_fsmacros.h:1.39
--- src/tests/fs/common/h_fsmacros.h:1.38	Wed Jun 26 19:29:24 2013
+++ src/tests/fs/common/h_fsmacros.h	Tue Mar 24 23:22:47 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.38 2013/06/26 19:29:24 reinoud Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.39 2015/03/24 23:22:47 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -110,10 +110,6 @@ do {	\
 		atf_tc_set_md_var(tc, descr, type  test for  desc);	\
 		atf_tc_set_md_var(tc, X-fs.type, #fs);		\
 		atf_tc_set_md_var(tc, X-fs.mntname, type);		\
-		if (strcmp(#fs, zfs) == 0) {\
-			/* This should not be necessary. */		\
-			atf_tc_set_md_var(tc, require.user, root);	\
-		}			\
 	}\
 	void *fs##func##tmp;		\
 	\
@@ -136,10 +132,6 @@ do {	\
 		atf_tc_set_md_var(tc, descr,_type_ test for _desc_);\
 		atf_tc_set_md_var(tc, X-fs.type, #_fs_);		\
 		atf_tc_set_md_var(tc, X-fs.mntname, _type_);		\
-		if (strcmp(#_fs_, zfs) == 0) {			\
-			/* This should not be necessary. */		\
-			atf_tc_set_md_var(tc, require.user, root);	\
-		}			\
 	}\
 	void *_fs_##_func_##tmp;	\
 	\



CVS commit: src/tests/fs/common

2014-03-16 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sun Mar 16 10:28:03 UTC 2014

Modified Files:
src/tests/fs/common: fstest_rumpfs.c

Log Message:
Retrict rumpfs to the provided size, like other filesystems.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/common/fstest_rumpfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_rumpfs.c
diff -u src/tests/fs/common/fstest_rumpfs.c:1.1 src/tests/fs/common/fstest_rumpfs.c:1.2
--- src/tests/fs/common/fstest_rumpfs.c:1.1	Thu Nov 11 17:39:29 2010
+++ src/tests/fs/common/fstest_rumpfs.c	Sun Mar 16 10:28:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_rumpfs.c,v 1.1 2010/11/11 17:39:29 pooka Exp $	*/
+/*	$NetBSD: fstest_rumpfs.c,v 1.2 2014/03/16 10:28:03 njoly Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -47,6 +47,13 @@ int
 rumpfs_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image,
 off_t size, void *fspriv)
 {
+	char tmp[64];
+	int res;
+
+	snprintf(tmp, sizeof(tmp), %PRId64, size);
+	res = setenv(RUMP_MEMLIMIT, tmp, 0);
+	if (res == -1)
+		return res;
 
 	return rump_init();
 }



CVS commit: src/tests/fs/common

2014-03-16 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sun Mar 16 10:28:03 UTC 2014

Modified Files:
src/tests/fs/common: fstest_rumpfs.c

Log Message:
Retrict rumpfs to the provided size, like other filesystems.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/common/fstest_rumpfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2013-09-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  9 19:47:38 UTC 2013

Modified Files:
src/tests/fs/common: fstest_puffs.c

Log Message:
Remove what looks like an outdated assert (there was something very sneaky
about this code, but my memory is fading ...)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/fs/common/fstest_puffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_puffs.c
diff -u src/tests/fs/common/fstest_puffs.c:1.10 src/tests/fs/common/fstest_puffs.c:1.11
--- src/tests/fs/common/fstest_puffs.c:1.10	Thu Feb 10 16:35:01 2011
+++ src/tests/fs/common/fstest_puffs.c	Mon Sep  9 19:47:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_puffs.c,v 1.10 2011/02/10 16:35:01 njoly Exp $	*/
+/*	$NetBSD: fstest_puffs.c,v 1.11 2013/09/09 19:47:38 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -386,12 +386,6 @@ puffs_fstest_mount(const atf_tc_t *tc, v
 	if (fd == -1)
 		return fd;
 
-#if 0
-	pa-pa_fd = fd;
-#else
-	assert(fd == 0); /* XXX: FIXME */
-#endif
-
 	if (rump_sys_mkdir(path, 0777) == -1)
 		return -1;
 



CVS commit: src/tests/fs/common

2013-09-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  9 19:47:38 UTC 2013

Modified Files:
src/tests/fs/common: fstest_puffs.c

Log Message:
Remove what looks like an outdated assert (there was something very sneaky
about this code, but my memory is fading ...)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/fs/common/fstest_puffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2013-07-02 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Tue Jul  2 15:00:55 UTC 2013

Modified Files:
src/tests/fs/common: fstest_udf.c

Log Message:
Use the new extension to newfs_udf to generate a decent image for rump to work
on instead of an FFS(!) version.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/common/fstest_udf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_udf.c
diff -u src/tests/fs/common/fstest_udf.c:1.3 src/tests/fs/common/fstest_udf.c:1.4
--- src/tests/fs/common/fstest_udf.c:1.3	Sun Jun 30 15:42:43 2013
+++ src/tests/fs/common/fstest_udf.c	Tue Jul  2 15:00:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_udf.c,v 1.3 2013/06/30 15:42:43 martin Exp $	*/
+/*	$NetBSD: fstest_udf.c,v 1.4 2013/07/02 15:00:55 reinoud Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -62,12 +62,11 @@ udf_fstest_newfs(const atf_tc_t *tc, voi
 	struct udftestargs *args;
 	struct sigaction act, oact;
 
-	size /= 512;
 	/*
-	 * XXX newfs should be newfs_udf here!
-	 * But newfs_udf does not support plain file mode.
+	 * Sectorsize can be specified with -S, as a multiple of 512.
+	 * newfs_udf takes humanized number as size in bytes as -s parameter!
 	 */
-	snprintf(cmd, 1024, newfs -F -s %PRId64 %s /dev/null, size, image);
+	snprintf(cmd, 1024, newfs_udf -F -s %PRId64 %s /dev/null, size, image);
 	memset(act, 0, sizeof(act));
 	act.sa_handler = SIG_DFL;
 	sigaction(SIGCHLD, act, oact);



CVS commit: src/tests/fs/common

2013-06-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun 30 15:05:49 UTC 2013

Modified Files:
src/tests/fs/common: fstest_udf.c

Log Message:
Fix copy  pasto, notice by Nicolas Joly, one step closer to solving
PR kern/47974.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/common/fstest_udf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_udf.c
diff -u src/tests/fs/common/fstest_udf.c:1.1 src/tests/fs/common/fstest_udf.c:1.2
--- src/tests/fs/common/fstest_udf.c:1.1	Wed Jun 26 19:29:24 2013
+++ src/tests/fs/common/fstest_udf.c	Sun Jun 30 15:05:49 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_udf.c,v 1.1 2013/06/26 19:29:24 reinoud Exp $	*/
+/*	$NetBSD: fstest_udf.c,v 1.2 2013/06/30 15:05:49 martin Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include unistd.h
 #include signal.h
 
-#include ufs/ufs/ufsmount.h
+#include fs/udf/udf_mount.h
 
 #include rump/rump.h
 #include rump/rump_syscalls.h
@@ -47,7 +47,7 @@
 #include h_fsmacros.h
 
 struct udftestargs {
-struct ufs_args ta_uargs;
+struct udf_args ta_uargs;
 char ta_devpath[MAXPATHLEN];
 char ta_imgpath[MAXPATHLEN];
 };



CVS commit: src/tests/fs/common

2013-06-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun 30 15:42:43 UTC 2013

Modified Files:
src/tests/fs/common: fstest_udf.c

Log Message:
Initialize mount args version info.
Add comment about a bogusly used newfs where newfs_udf is meant.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/common/fstest_udf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_udf.c
diff -u src/tests/fs/common/fstest_udf.c:1.2 src/tests/fs/common/fstest_udf.c:1.3
--- src/tests/fs/common/fstest_udf.c:1.2	Sun Jun 30 15:05:49 2013
+++ src/tests/fs/common/fstest_udf.c	Sun Jun 30 15:42:43 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_udf.c,v 1.2 2013/06/30 15:05:49 martin Exp $	*/
+/*	$NetBSD: fstest_udf.c,v 1.3 2013/06/30 15:42:43 martin Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -63,6 +63,10 @@ udf_fstest_newfs(const atf_tc_t *tc, voi
 	struct sigaction act, oact;
 
 	size /= 512;
+	/*
+	 * XXX newfs should be newfs_udf here!
+	 * But newfs_udf does not support plain file mode.
+	 */
 	snprintf(cmd, 1024, newfs -F -s %PRId64 %s /dev/null, size, image);
 	memset(act, 0, sizeof(act));
 	act.sa_handler = SIG_DFL;
@@ -83,6 +87,7 @@ udf_fstest_newfs(const atf_tc_t *tc, voi
 	snprintf(args-ta_devpath, MAXPATHLEN, /dev/device%d.udf, num);
 	snprintf(args-ta_imgpath, MAXPATHLEN, %s, image);
 	args-ta_uargs.fspec = args-ta_devpath;
+	args-ta_uargs.version = UDFMNT_VERSION;
 
 	res = rump_pub_etfs_register(args-ta_devpath, image, RUMP_ETFS_BLK);
 	if (res != 0) {



CVS commit: src/tests/fs/common

2013-06-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun 30 15:05:49 UTC 2013

Modified Files:
src/tests/fs/common: fstest_udf.c

Log Message:
Fix copy  pasto, notice by Nicolas Joly, one step closer to solving
PR kern/47974.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/common/fstest_udf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2013-06-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun 30 15:42:43 UTC 2013

Modified Files:
src/tests/fs/common: fstest_udf.c

Log Message:
Initialize mount args version info.
Add comment about a bogusly used newfs where newfs_udf is meant.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/common/fstest_udf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2013-06-26 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Jun 26 19:29:24 UTC 2013

Modified Files:
src/tests/fs/common: Makefile h_fsmacros.h
Added Files:
src/tests/fs/common: fstest_udf.c

Log Message:
Add UDF as one of the filesytems to test. Might help understand why rump is
misbehaving on it.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/fs/common/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/fs/common/fstest_udf.c
cvs rdiff -u -r1.37 -r1.38 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/Makefile
diff -u src/tests/fs/common/Makefile:1.10 src/tests/fs/common/Makefile:1.11
--- src/tests/fs/common/Makefile:1.10	Tue Mar  5 19:58:33 2013
+++ src/tests/fs/common/Makefile	Wed Jun 26 19:29:24 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.10 2013/03/05 19:58:33 christos Exp $
+#	$NetBSD: Makefile,v 1.11 2013/06/26 19:29:24 reinoud Exp $
 #
 
 .include bsd.own.mk
@@ -6,7 +6,7 @@
 LIB=	vfstest
 SRCS=	fstest_ext2fs.c fstest_ffs.c fstest_lfs.c fstest_msdosfs.c	\
 	fstest_nfs.c fstest_puffs.c fstest_rumpfs.c fstest_sysvbfs.c	\
-	fstest_tmpfs.c fstest_v7fs.c
+	fstest_tmpfs.c fstest_udf.c fstest_v7fs.c
 
 .if (${MKZFS} != no)
 SRCS+=	fstest_zfs.c

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.37 src/tests/fs/common/h_fsmacros.h:1.38
--- src/tests/fs/common/h_fsmacros.h:1.37	Sat Mar 16 05:24:59 2013
+++ src/tests/fs/common/h_fsmacros.h	Wed Jun 26 19:29:24 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.37 2013/03/16 05:24:59 jmmv Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.38 2013/06/26 19:29:24 reinoud Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -61,6 +61,7 @@ FSPROTOS(puffs);
 FSPROTOS(rumpfs);
 FSPROTOS(sysvbfs);
 FSPROTOS(tmpfs);
+FSPROTOS(udf);
 FSPROTOS(v7fs);
 FSPROTOS(zfs);
 
@@ -175,6 +176,7 @@ do {	\
   ATF_TC_FSADD(rumpfs,MOUNT_RUMPFS,func,desc)\
   ATF_TC_FSADD(sysvbfs,MOUNT_SYSVBFS,func,desc)\
   ATF_TC_FSADD(tmpfs,MOUNT_TMPFS,func,desc)\
+  ATF_TC_FSADD(udf,MOUNT_UDF,func,desc)\
   ATF_TC_FSADD(v7fs,MOUNT_V7FS,func,desc)
 
 #define ATF_TP_FSAPPLY_NOZFS(func)	\
@@ -189,6 +191,7 @@ do {	\
   ATF_TP_FSADD(rumpfs,func);		\
   ATF_TP_FSADD(sysvbfs,func);		\
   ATF_TP_FSADD(tmpfs,func);		\
+  ATF_TP_FSADD(udf,func);		\
   ATF_TP_FSADD(v7fs,func);
 
 /* XXX: this will not scale */
@@ -228,6 +231,7 @@ do {	\
   ATF_TC_FSADD_RO(nfs,MOUNT_NFS,func,desc,gen)\
   ATF_TC_FSADD_RO(nfsro,MOUNT_NFS,func,desc,gen)			\
   ATF_TC_FSADD_RO(sysvbfs,MOUNT_SYSVBFS,func,desc,gen)			\
+  ATF_TC_FSADD_RO(udf,MOUNT_UDF,func,desc,gen)			\
   ATF_TC_FSADD_RO(v7fs,MOUNT_V7FS,func,desc,gen)
 
 #define ATF_TP_FSAPPLY_RO(func)		\
@@ -238,6 +242,7 @@ do {	\
   ATF_TP_FSADD(nfs,func);		\
   ATF_TP_FSADD(nfsro,func);		\
   ATF_TP_FSADD(sysvbfs,func);		\
+  ATF_TP_FSADD(udf,func);		\
   ATF_TP_FSADD(v7fs,func);
 
 #define ATF_FSAPPLY(func,desc)		\
@@ -286,6 +291,8 @@ atf_check_fstype(const atf_tc_t *tc, con
 (strcmp(atf_tc_get_md_var(tc, X-fs.type), sysvbfs) == 0)
 #define FSTYPE_TMPFS(tc)\
 (strcmp(atf_tc_get_md_var(tc, X-fs.type), tmpfs) == 0)
+#define FSTYPE_UDF(tc)\
+(strcmp(atf_tc_get_md_var(tc, X-fs.type), udf) == 0)
 #define FSTYPE_V7FS(tc)\
 (strcmp(atf_tc_get_md_var(tc, X-fs.type), v7fs) == 0)
 #define FSTYPE_ZFS(tc)\

Added files:

Index: src/tests/fs/common/fstest_udf.c
diff -u /dev/null src/tests/fs/common/fstest_udf.c:1.1
--- /dev/null	Wed Jun 26 19:29:24 2013
+++ src/tests/fs/common/fstest_udf.c	Wed Jun 26 19:29:24 2013
@@ -0,0 +1,149 @@
+/*	$NetBSD: fstest_udf.c,v 1.1 2013/06/26 19:29:24 reinoud Exp $	*/
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nicolas Joly.
+ *
+ * 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 

Re: CVS commit: src/tests/fs/common

2013-03-19 Thread David Laight
On Tue, Mar 19, 2013 at 07:43:06PM +1100, matthew green wrote:
 
   The zfs tests are failing when run as an unprivileged user in
   thread_create() ... because default limit for threads (160) is too
   low ! When run as root, the limit value (2500) seems to be high enough.
  
  So should we increase the default limits?  It's always a tough call to
  set limits for a large ensemble of hardware, big and small, but it also
  seems that limits should be big enough to run our test cases.
 
 i think the default thread limit should be more on the order of 1024 
 to 4096.

Both the soft and hard limits for all the rlimits really need looking at.
In most cases the hard limits are much too high!

I'd have thought the soft thread limit should be relatively low (maybe
more than 160), and the hard limit say 1024 (dunno really).

Similarly for fds, maybe 256 and 4096.
At the moment there are nice local-user DoS because of the hard limit
values.

David

-- 
David Laight: da...@l8s.co.uk


Re: CVS commit: src/tests/fs/common

2013-03-18 Thread Nicolas Joly
On Sat, Mar 16, 2013 at 05:25:00AM +, Julio M. Merino Vidal wrote:
 Module Name:  src
 Committed By: jmmv
 Date: Sat Mar 16 05:25:00 UTC 2013
 
 Modified Files:
   src/tests/fs/common: h_fsmacros.h
 
 Log Message:
 Mark the zfs tests as requiring root.
 
 This is wrong.  The zfs tests already use rump so they should not require
 root.  However, I've already spent much more time than I wanted trying to
 figure out why that's the case without much luck.  If you can find why,
 just remove this hack.

The zfs tests are failing when run as an unprivileged user in
thread_create() ... because default limit for threads (160) is too
low ! When run as root, the limit value (2500) seems to be high enough.

-- 
Nicolas Joly

Biology IT Center
Institut Pasteur, Paris.


Re: CVS commit: src/tests/fs/common

2013-03-18 Thread Greg Troxel

Nicolas Joly nj...@pasteur.fr writes:

 The zfs tests are failing when run as an unprivileged user in
 thread_create() ... because default limit for threads (160) is too
 low ! When run as root, the limit value (2500) seems to be high enough.

So should we increase the default limits?  It's always a tough call to
set limits for a large ensemble of hardware, big and small, but it also
seems that limits should be big enough to run our test cases.



pgpmmHx2QH_Pf.pgp
Description: PGP signature


Re: CVS commit: src/tests/fs/common

2013-03-18 Thread Jukka Ruohonen
On Mon, Mar 18, 2013 at 09:13:35PM +0100, Nicolas Joly wrote:
 That make a 80 CPUs host require a thread limit value of 814
 (=261+7*79) to be able to run this test.

Sounds like a serious test case

- Jukka.


CVS commit: src/tests/fs/common

2013-03-15 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sat Mar 16 05:25:00 UTC 2013

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Mark the zfs tests as requiring root.

This is wrong.  The zfs tests already use rump so they should not require
root.  However, I've already spent much more time than I wanted trying to
figure out why that's the case without much luck.  If you can find why,
just remove this hack.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.36 src/tests/fs/common/h_fsmacros.h:1.37
--- src/tests/fs/common/h_fsmacros.h:1.36	Mon Aug 20 16:39:46 2012
+++ src/tests/fs/common/h_fsmacros.h	Sat Mar 16 05:24:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.36 2012/08/20 16:39:46 pooka Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.37 2013/03/16 05:24:59 jmmv Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -109,6 +109,10 @@ do {	\
 		atf_tc_set_md_var(tc, descr, type  test for  desc);	\
 		atf_tc_set_md_var(tc, X-fs.type, #fs);		\
 		atf_tc_set_md_var(tc, X-fs.mntname, type);		\
+		if (strcmp(#fs, zfs) == 0) {\
+			/* This should not be necessary. */		\
+			atf_tc_set_md_var(tc, require.user, root);	\
+		}			\
 	}\
 	void *fs##func##tmp;		\
 	\
@@ -131,6 +135,10 @@ do {	\
 		atf_tc_set_md_var(tc, descr,_type_ test for _desc_);\
 		atf_tc_set_md_var(tc, X-fs.type, #_fs_);		\
 		atf_tc_set_md_var(tc, X-fs.mntname, _type_);		\
+		if (strcmp(#_fs_, zfs) == 0) {			\
+			/* This should not be necessary. */		\
+			atf_tc_set_md_var(tc, require.user, root);	\
+		}			\
 	}\
 	void *_fs_##_func_##tmp;	\
 	\



CVS commit: src/tests/fs/common

2013-03-15 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sat Mar 16 05:25:00 UTC 2013

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Mark the zfs tests as requiring root.

This is wrong.  The zfs tests already use rump so they should not require
root.  However, I've already spent much more time than I wanted trying to
figure out why that's the case without much luck.  If you can find why,
just remove this hack.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common/nfsrpc

2013-03-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar  5 16:54:08 UTC 2013

Modified Files:
src/tests/fs/common/nfsrpc: svc.c

Log Message:
use the proper fd_set.
XXX: Instead of making a copy of the libc rpc files here we should re-use the
files from libc, and use macros to provide the extra functionality needed here.
SoC project?


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/common/nfsrpc/svc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/nfsrpc/svc.c
diff -u src/tests/fs/common/nfsrpc/svc.c:1.5 src/tests/fs/common/nfsrpc/svc.c:1.6
--- src/tests/fs/common/nfsrpc/svc.c:1.5	Tue Mar  5 00:39:54 2013
+++ src/tests/fs/common/nfsrpc/svc.c	Tue Mar  5 11:54:08 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: svc.c,v 1.5 2013/03/05 05:39:54 christos Exp $	*/
+/*	$NetBSD: svc.c,v 1.6 2013/03/05 16:54:08 christos Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = @(#)svc.c 1.44 88/02/08 Copyr 1984 Sun Micro;
 static char *sccsid = @(#)svc.c	2.4 88/08/11 4.0 RPCSRC;
 #else
-__RCSID($NetBSD: svc.c,v 1.5 2013/03/05 05:39:54 christos Exp $);
+__RCSID($NetBSD: svc.c,v 1.6 2013/03/05 16:54:08 christos Exp $);
 #endif
 #endif
 
@@ -204,7 +204,7 @@ xprt_register(SVCXPRT *xprt)
 		goto out;
 	}
 	__svc_xports[sock] = xprt;
-	FD_SET(sock, svc_fdset);
+	FD_SET(sock, get_fdset());
 	*get_fdsetmax() = max(*get_fdsetmax(), sock);
 	rwlock_unlock(svc_fd_lock);
 	return (TRUE);



CVS commit: src/tests/fs/common/nfsrpc

2013-03-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar  5 16:54:08 UTC 2013

Modified Files:
src/tests/fs/common/nfsrpc: svc.c

Log Message:
use the proper fd_set.
XXX: Instead of making a copy of the libc rpc files here we should re-use the
files from libc, and use macros to provide the extra functionality needed here.
SoC project?


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/common/nfsrpc/svc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2013-03-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar  5 19:58:34 UTC 2013

Modified Files:
src/tests/fs/common: Makefile
Removed Files:
src/tests/fs/common/nfsrpc: Makefile.inc bindresvport.c clnt_bcast.c
clnt_dg.c clnt_generic.c clnt_vc.c namespace.h reentrant.h
rpc_generic.c rpc_internal.h rpc_soc.c rpcb_clnt.c svc.c svc_dg.c
svc_dg.h svc_fdset.h svc_generic.c svc_run.c svc_vc.c

Log Message:
Highly uncool to stash a partial copy of the ti-rpc code here.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/fs/common/Makefile
cvs rdiff -u -r1.3 -r0 src/tests/fs/common/nfsrpc/Makefile.inc \
src/tests/fs/common/nfsrpc/svc_vc.c
cvs rdiff -u -r1.1 -r0 src/tests/fs/common/nfsrpc/bindresvport.c \
src/tests/fs/common/nfsrpc/clnt_dg.c \
src/tests/fs/common/nfsrpc/clnt_generic.c \
src/tests/fs/common/nfsrpc/clnt_vc.c \
src/tests/fs/common/nfsrpc/reentrant.h \
src/tests/fs/common/nfsrpc/rpc_internal.h \
src/tests/fs/common/nfsrpc/rpc_soc.c src/tests/fs/common/nfsrpc/svc_dg.h \
src/tests/fs/common/nfsrpc/svc_fdset.h \
src/tests/fs/common/nfsrpc/svc_generic.c \
src/tests/fs/common/nfsrpc/svc_run.c
cvs rdiff -u -r1.2 -r0 src/tests/fs/common/nfsrpc/clnt_bcast.c \
src/tests/fs/common/nfsrpc/namespace.h \
src/tests/fs/common/nfsrpc/rpc_generic.c \
src/tests/fs/common/nfsrpc/rpcb_clnt.c \
src/tests/fs/common/nfsrpc/svc_dg.c
cvs rdiff -u -r1.6 -r0 src/tests/fs/common/nfsrpc/svc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common/nfsrpc

2013-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar  5 05:39:54 UTC 2013

Modified Files:
src/tests/fs/common/nfsrpc: svc.c

Log Message:
catch up with libc.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/common/nfsrpc/svc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/nfsrpc/svc.c
diff -u src/tests/fs/common/nfsrpc/svc.c:1.4 src/tests/fs/common/nfsrpc/svc.c:1.5
--- src/tests/fs/common/nfsrpc/svc.c:1.4	Thu Sep 23 05:38:14 2010
+++ src/tests/fs/common/nfsrpc/svc.c	Tue Mar  5 00:39:54 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: svc.c,v 1.4 2010/09/23 09:38:14 he Exp $	*/
+/*	$NetBSD: svc.c,v 1.5 2013/03/05 05:39:54 christos Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = @(#)svc.c 1.44 88/02/08 Copyr 1984 Sun Micro;
 static char *sccsid = @(#)svc.c	2.4 88/08/11 4.0 RPCSRC;
 #else
-__RCSID($NetBSD: svc.c,v 1.4 2010/09/23 09:38:14 he Exp $);
+__RCSID($NetBSD: svc.c,v 1.5 2013/03/05 05:39:54 christos Exp $);
 #endif
 #endif
 
@@ -180,9 +180,8 @@ get_fdsetmax()
 /*
  * Activate a transport handle.
  */
-void
-xprt_register(xprt)
-	SVCXPRT *xprt;
+bool_t
+xprt_register(SVCXPRT *xprt)
 {
 	int sock;
 
@@ -194,18 +193,25 @@ xprt_register(xprt)
 	if (__svc_xports == NULL) {
 		__svc_xports = mem_alloc(FD_SETSIZE * sizeof(SVCXPRT *));
 		if (__svc_xports == NULL) {
-			warn(xprt_register);
+			warn(%s: out of memory, __func__);
 			goto out;
 		}
 		memset(__svc_xports, '\0', FD_SETSIZE * sizeof(SVCXPRT *));
 	}
-	if (sock  FD_SETSIZE) {
-		__svc_xports[sock] = xprt;
-		FD_SET(sock, get_fdset());
-		*get_fdsetmax() = max(*get_fdsetmax(), sock);
-	}
+	if (sock = FD_SETSIZE) {
+		warnx(%s: socket descriptor %d too large for setsize %u,
+		__func__, sock, (unsigned)FD_SETSIZE);
+		goto out;
+	}
+	__svc_xports[sock] = xprt;
+	FD_SET(sock, svc_fdset);
+	*get_fdsetmax() = max(*get_fdsetmax(), sock);
+	rwlock_unlock(svc_fd_lock);
+	return (TRUE);
+
 out:
 	rwlock_unlock(svc_fd_lock);
+	return (FALSE);
 }
 
 void



CVS commit: src/tests/fs/common/nfsrpc

2013-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar  5 05:39:54 UTC 2013

Modified Files:
src/tests/fs/common/nfsrpc: svc.c

Log Message:
catch up with libc.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/common/nfsrpc/svc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2012-08-20 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Aug 20 16:39:46 UTC 2012

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Add a vfstest zfs attachment.  This is a compile-time option,
default off, due the large numbers of failing tests (some of them
look like quite trivial failures).


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.35 src/tests/fs/common/h_fsmacros.h:1.36
--- src/tests/fs/common/h_fsmacros.h:1.35	Thu Aug 11 10:52:12 2011
+++ src/tests/fs/common/h_fsmacros.h	Mon Aug 20 16:39:46 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.35 2011/08/11 10:52:12 uch Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.36 2012/08/20 16:39:46 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -62,6 +62,7 @@ FSPROTOS(rumpfs);
 FSPROTOS(sysvbfs);
 FSPROTOS(tmpfs);
 FSPROTOS(v7fs);
+FSPROTOS(zfs);
 
 #ifndef FSTEST_IMGNAME
 #define FSTEST_IMGNAME image.fs
@@ -154,7 +155,7 @@ do {	\
 #define ATF_TP_FSADD(fs,func)		\
   ATF_TP_ADD_TC(tp,fs##_##func)
 
-#define ATF_TC_FSAPPLY(func,desc)	\
+#define ATF_TC_FSAPPLY_NOZFS(func,desc)	\
   ATF_TC_FSADD(ext2fs,MOUNT_EXT2FS,func,desc)\
   ATF_TC_FSADD(ffs,MOUNT_FFS,func,desc)	\
   ATF_TC_FSADD(ffslog,MOUNT_FFS,func,desc)\
@@ -168,7 +169,7 @@ do {	\
   ATF_TC_FSADD(tmpfs,MOUNT_TMPFS,func,desc)\
   ATF_TC_FSADD(v7fs,MOUNT_V7FS,func,desc)
 
-#define ATF_TP_FSAPPLY(func)		\
+#define ATF_TP_FSAPPLY_NOZFS(func)	\
   ATF_TP_FSADD(ext2fs,func);		\
   ATF_TP_FSADD(ffs,func);		\
   ATF_TP_FSADD(ffslog,func);		\
@@ -182,6 +183,24 @@ do {	\
   ATF_TP_FSADD(tmpfs,func);		\
   ATF_TP_FSADD(v7fs,func);
 
+/* XXX: this will not scale */
+#ifdef WANT_ZFS_TESTS
+#define ATF_TC_FSAPPLY(func,desc)	\
+  ATF_TC_FSAPPLY_NOZFS(func,desc)	\
+  ATF_TC_FSADD(zfs,MOUNT_ZFS,func,desc)
+#define ATF_TP_FSAPPLY(func)		\
+  ATF_TP_FSAPPLY_NOZFS(func)		\
+  ATF_TP_FSADD(zfs,func);
+
+#else /* !WANT_ZFS_TESTS */
+
+#define ATF_TC_FSAPPLY(func,desc)	\
+  ATF_TC_FSAPPLY_NOZFS(func,desc)
+#define ATF_TP_FSAPPLY(func)		\
+  ATF_TP_FSAPPLY_NOZFS(func)
+
+#endif /* WANT_ZFS_TESTS */
+
 /*
  * Same as above, but generate a file system image first and perform
  * tests for a r/o mount.
@@ -261,6 +280,8 @@ atf_check_fstype(const atf_tc_t *tc, con
 (strcmp(atf_tc_get_md_var(tc, X-fs.type), tmpfs) == 0)
 #define FSTYPE_V7FS(tc)\
 (strcmp(atf_tc_get_md_var(tc, X-fs.type), v7fs) == 0)
+#define FSTYPE_ZFS(tc)\
+(strcmp(atf_tc_get_md_var(tc, X-fs.type), zfs) == 0)
 
 #define FSTEST_ENTER()			\
 	if (rump_sys_chdir(FSTEST_MNTNAME) == -1)			\



CVS commit: src/tests/fs/common

2012-08-20 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Aug 20 16:39:46 UTC 2012

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Add a vfstest zfs attachment.  This is a compile-time option,
default off, due the large numbers of failing tests (some of them
look like quite trivial failures).


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2012-08-04 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Aug  5 02:03:05 UTC 2012

Modified Files:
src/tests/fs/common: fstest_ffs.c

Log Message:
Fix ffs_fstest_delfs's error branch for rump_pub_etfs_remove.

rump_pub_etfs_remove returns an error code, rather than setting errno
and returning -1.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/common/fstest_ffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_ffs.c
diff -u src/tests/fs/common/fstest_ffs.c:1.5 src/tests/fs/common/fstest_ffs.c:1.6
--- src/tests/fs/common/fstest_ffs.c:1.5	Sun Jun 26 13:06:00 2011
+++ src/tests/fs/common/fstest_ffs.c	Sun Aug  5 02:03:05 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_ffs.c,v 1.5 2011/06/26 13:06:00 christos Exp $	*/
+/*	$NetBSD: fstest_ffs.c,v 1.6 2012/08/05 02:03:05 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -104,8 +104,10 @@ ffs_fstest_delfs(const atf_tc_t *tc, voi
 	struct ffstestargs *args = buf;
 
 	res = rump_pub_etfs_remove(args-ta_devpath);
-	if (res != 0)
-		return res;
+	if (res != 0) {
+		errno = res;
+		return -1;
+	}
 
 	res = unlink(args-ta_imgpath);
 	if (res != 0)



CVS commit: src/tests/fs/common

2012-03-26 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Mar 26 15:10:26 UTC 2012

Modified Files:
src/tests/fs/common: fstest_msdosfs.c

Log Message:
Initialise permissions mask to a sensible value (0755).
While here convert leading spaces to tabs.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/common/fstest_msdosfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_msdosfs.c
diff -u src/tests/fs/common/fstest_msdosfs.c:1.2 src/tests/fs/common/fstest_msdosfs.c:1.3
--- src/tests/fs/common/fstest_msdosfs.c:1.2	Fri Jul 30 16:15:05 2010
+++ src/tests/fs/common/fstest_msdosfs.c	Mon Mar 26 15:10:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_msdosfs.c,v 1.2 2010/07/30 16:15:05 pooka Exp $	*/
+/*	$NetBSD: fstest_msdosfs.c,v 1.3 2012/03/26 15:10:26 njoly Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -75,9 +75,10 @@ msdosfs_fstest_newfs(const atf_tc_t *tc,
 	if (args == NULL)
 		return -1;
 
-snprintf(args-ta_devpath, MAXPATHLEN, /dev/device%d.msdosfs, num);
-snprintf(args-ta_imgpath, MAXPATHLEN, %s, image);
-args-ta_uargs.fspec = args-ta_devpath;
+	snprintf(args-ta_devpath, MAXPATHLEN, /dev/device%d.msdosfs, num);
+	snprintf(args-ta_imgpath, MAXPATHLEN, %s, image);
+	args-ta_uargs.fspec = args-ta_devpath;
+	args-ta_uargs.mask = 0755;
 
 	res = rump_pub_etfs_register(args-ta_devpath, image, RUMP_ETFS_BLK);
 	if (res != 0) {



CVS commit: src/tests/fs/common

2012-03-26 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Mar 26 15:10:26 UTC 2012

Modified Files:
src/tests/fs/common: fstest_msdosfs.c

Log Message:
Initialise permissions mask to a sensible value (0755).
While here convert leading spaces to tabs.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/common/fstest_msdosfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common/nfsrpc

2011-06-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Jun 29 02:36:13 UTC 2011

Modified Files:
src/tests/fs/common/nfsrpc: Makefile.inc

Log Message:
apply some -fno-strict-aliasing

XXX -- someone please fix this properly.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/common/nfsrpc/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/nfsrpc/Makefile.inc
diff -u src/tests/fs/common/nfsrpc/Makefile.inc:1.2 src/tests/fs/common/nfsrpc/Makefile.inc:1.3
--- src/tests/fs/common/nfsrpc/Makefile.inc:1.2	Tue Aug  3 17:24:45 2010
+++ src/tests/fs/common/nfsrpc/Makefile.inc	Wed Jun 29 02:36:13 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.2 2010/08/03 17:24:45 drochner Exp $
+#	$NetBSD: Makefile.inc,v 1.3 2011/06/29 02:36:13 mrg Exp $
 #
 
 # libc rpc using rump syscalls
@@ -8,3 +8,6 @@
 
 CPPFLAGS+=	-DPORTMAP -D_REENTRANT -DRUMP_SYS_NETWORKING
 CPPFLAGS+=	-DDEBUG -DLIBWRAP
+
+# XXX
+CPPFLAGS.clnt_dg.c+=	-fno-strict-aliasing



CVS commit: src/tests/fs/common/nfsrpc

2011-06-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Jun 29 02:36:13 UTC 2011

Modified Files:
src/tests/fs/common/nfsrpc: Makefile.inc

Log Message:
apply some -fno-strict-aliasing

XXX -- someone please fix this properly.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/common/nfsrpc/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2011-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 26 13:06:00 UTC 2011

Modified Files:
src/tests/fs/common: fstest_ffs.c

Log Message:
ggr, how many of those I will need to fix. Fallout from the bogus inclusion
of signal.h in rump_syscallargs.h.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/common/fstest_ffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_ffs.c
diff -u src/tests/fs/common/fstest_ffs.c:1.4 src/tests/fs/common/fstest_ffs.c:1.5
--- src/tests/fs/common/fstest_ffs.c:1.4	Thu Jan 13 07:55:19 2011
+++ src/tests/fs/common/fstest_ffs.c	Sun Jun 26 09:06:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_ffs.c,v 1.4 2011/01/13 12:55:19 pooka Exp $	*/
+/*	$NetBSD: fstest_ffs.c,v 1.5 2011/06/26 13:06:00 christos Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -37,6 +37,7 @@
 #include stdlib.h
 #include string.h
 #include unistd.h
+#include signal.h
 
 #include ufs/ufs/ufsmount.h
 



CVS commit: src/tests/fs/common

2011-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 26 13:06:00 UTC 2011

Modified Files:
src/tests/fs/common: fstest_ffs.c

Log Message:
ggr, how many of those I will need to fix. Fallout from the bogus inclusion
of signal.h in rump_syscallargs.h.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/common/fstest_ffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2011-03-22 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Mar 22 16:50:16 UTC 2011

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Remove unnecessary (and broken) cleanup routines.

The cleanup routines were being used to kill the rump process and to delete
the temporary image file.  These are things automatically done by atf-run,
but it looks like this code was added here to workaround a previous bug in
the atf-run code.

Note that, in the existing form, the cleanup routines segfault (haven't
spent the time to track down why).  atf-run does not care about this
(although it should), buy Kyua does.

As a side effect, this has a teeny-tiny performance speedup in the execution
of the tests including this file.

OKed by njoly@.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.33 src/tests/fs/common/h_fsmacros.h:1.34
--- src/tests/fs/common/h_fsmacros.h:1.33	Sat Mar  5 20:56:28 2011
+++ src/tests/fs/common/h_fsmacros.h	Tue Mar 22 16:50:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.33 2011/03/05 20:56:28 pooka Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.34 2011/03/22 16:50:16 jmmv Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
 } while (/*CONSTCOND*/0);
 
 #define ATF_TC_FSADD(fs,type,func,desc)	\
-	ATF_TC_WITH_CLEANUP(fs##_##func);\
+	ATF_TC(fs##_##func);		\
 	ATF_TC_HEAD(fs##_##func,tc)	\
 	{\
 		atf_tc_set_md_var(tc, descr, type  test for  desc);	\
@@ -120,18 +120,10 @@
 			rump_pub_vfs_mount_print(FSTEST_MNTNAME, 1);	\
 			atf_tc_fail_errno(unmount failed);		\
 		}			\
-	}\
-	\
-	ATF_TC_CLEANUP(fs##_##func,tc)	\
-	{\
-		if (!atf_check_fstype(tc, #fs))\
-			return;		\
-		if (fs##_fstest_delfs(tc, fs##func##tmp) != 0)		\
-			atf_tc_fail_errno(delfs failed);		\
 	}
 
 #define ATF_TC_FSADD_RO(_fs_,_type_,_func_,_desc_,_gen_)		\
-	ATF_TC_WITH_CLEANUP(_fs_##_##_func_);\
+	ATF_TC(_fs_##_##_func_);	\
 	ATF_TC_HEAD(_fs_##_##_func_,tc)	\
 	{\
 		atf_tc_set_md_var(tc, descr,_type_ test for _desc_);\
@@ -156,14 +148,6 @@
 			rump_pub_vfs_mount_print(FSTEST_MNTNAME, 1);	\
 			atf_tc_fail_errno(unmount failed);		\
 		}			\
-	}\
-	\
-	ATF_TC_CLEANUP(_fs_##_##_func_,tc)\
-	{\
-		if (!atf_check_fstype(tc, #_fs_))			\
-			return;		\
-		if (_fs_##_fstest_delfs(tc, _fs_##_func_##tmp) != 0)	\
-			atf_tc_fail_errno(delfs failed);		\
 	}
 
 #define ATF_TP_FSADD(fs,func)		\



CVS commit: src/tests/fs/common

2011-03-22 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Mar 22 16:50:16 UTC 2011

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Remove unnecessary (and broken) cleanup routines.

The cleanup routines were being used to kill the rump process and to delete
the temporary image file.  These are things automatically done by atf-run,
but it looks like this code was added here to workaround a previous bug in
the atf-run code.

Note that, in the existing form, the cleanup routines segfault (haven't
spent the time to track down why).  atf-run does not care about this
(although it should), buy Kyua does.

As a side effect, this has a teeny-tiny performance speedup in the execution
of the tests including this file.

OKed by njoly@.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2011-03-05 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sat Mar  5 20:56:28 UTC 2011

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Put p2k_ffs back there -- i can't repeat any problems in my qemu/anita
runs.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.32 src/tests/fs/common/h_fsmacros.h:1.33
--- src/tests/fs/common/h_fsmacros.h:1.32	Fri Jan  7 19:54:48 2011
+++ src/tests/fs/common/h_fsmacros.h	Sat Mar  5 20:56:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.32 2011/01/07 19:54:48 pooka Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.33 2011/03/05 20:56:28 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -177,6 +177,7 @@
   ATF_TC_FSADD(msdosfs,MOUNT_MSDOS,func,desc)\
   ATF_TC_FSADD(nfs,MOUNT_NFS,func,desc)	\
   ATF_TC_FSADD(puffs,MOUNT_PUFFS,func,desc)\
+  ATF_TC_FSADD(p2k_ffs,MOUNT_PUFFS,func,desc)\
   ATF_TC_FSADD(rumpfs,MOUNT_RUMPFS,func,desc)\
   ATF_TC_FSADD(sysvbfs,MOUNT_SYSVBFS,func,desc)\
   ATF_TC_FSADD(tmpfs,MOUNT_TMPFS,func,desc)
@@ -189,6 +190,7 @@
   ATF_TP_FSADD(msdosfs,func);		\
   ATF_TP_FSADD(nfs,func);		\
   ATF_TP_FSADD(puffs,func);		\
+  ATF_TP_FSADD(p2k_ffs,func);		\
   ATF_TP_FSADD(rumpfs,func);		\
   ATF_TP_FSADD(sysvbfs,func);		\
   ATF_TP_FSADD(tmpfs,func);



CVS commit: src/tests/fs/common

2011-03-05 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sat Mar  5 20:56:28 UTC 2011

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Put p2k_ffs back there -- i can't repeat any problems in my qemu/anita
runs.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2011-02-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 28 21:03:15 UTC 2011

Modified Files:
src/tests/fs/common: fstest_nfs.c

Log Message:
bump nfdsargv[]�size belatedly (and add a few extra for needs of future bugs)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/common/fstest_nfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_nfs.c
diff -u src/tests/fs/common/fstest_nfs.c:1.6 src/tests/fs/common/fstest_nfs.c:1.7
--- src/tests/fs/common/fstest_nfs.c:1.6	Thu Feb 10 16:35:01 2011
+++ src/tests/fs/common/fstest_nfs.c	Mon Feb 28 21:03:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_nfs.c,v 1.6 2011/02/10 16:35:01 njoly Exp $	*/
+/*	$NetBSD: fstest_nfs.c,v 1.7 2011/02/28 21:03:15 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
 	const char *image, off_t size, void *fspriv)
 {
 	const char *srcdir;
-	char *nfsdargv[7];
+	char *nfsdargv[16];
 	char nfsdpath[MAXPATHLEN];
 	char imagepath[MAXPATHLEN];
 	char ethername[MAXPATHLEN], ethername_ro[MAXPATHLEN];



CVS commit: src/tests/fs/common

2011-02-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 28 21:08:13 UTC 2011

Modified Files:
src/tests/fs/common: fstest_nfs.c

Log Message:
g/c unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/fs/common/fstest_nfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_nfs.c
diff -u src/tests/fs/common/fstest_nfs.c:1.7 src/tests/fs/common/fstest_nfs.c:1.8
--- src/tests/fs/common/fstest_nfs.c:1.7	Mon Feb 28 21:03:15 2011
+++ src/tests/fs/common/fstest_nfs.c	Mon Feb 28 21:08:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_nfs.c,v 1.7 2011/02/28 21:03:15 pooka Exp $	*/
+/*	$NetBSD: fstest_nfs.c,v 1.8 2011/02/28 21:08:13 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -66,9 +66,6 @@
 	atf_tc_fail(child died);
 }
 
-struct nfstestargs *theargs;
-
-
 /* fork rump nfsd, configure interface */
 static int
 donewfs(const atf_tc_t *tc, void **argp,



CVS commit: src/tests/fs/common

2011-02-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 28 21:08:46 UTC 2011

Modified Files:
src/tests/fs/common: fstest_nfs.c

Log Message:
g/c use of unused variable too


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/fs/common/fstest_nfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_nfs.c
diff -u src/tests/fs/common/fstest_nfs.c:1.8 src/tests/fs/common/fstest_nfs.c:1.9
--- src/tests/fs/common/fstest_nfs.c:1.8	Mon Feb 28 21:08:13 2011
+++ src/tests/fs/common/fstest_nfs.c	Mon Feb 28 21:08:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_nfs.c,v 1.8 2011/02/28 21:08:13 pooka Exp $	*/
+/*	$NetBSD: fstest_nfs.c,v 1.9 2011/02/28 21:08:46 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -153,7 +153,6 @@
 	strcpy(args-ta_ethername, ethername);
 
 	*argp = args;
-	theargs = args;
 
 	return 0;
 }



CVS commit: src/tests/fs/common

2011-02-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 28 21:03:15 UTC 2011

Modified Files:
src/tests/fs/common: fstest_nfs.c

Log Message:
bump nfdsargv[]�size belatedly (and add a few extra for needs of future bugs)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/common/fstest_nfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2011-02-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Feb 28 21:08:13 UTC 2011

Modified Files:
src/tests/fs/common: fstest_nfs.c

Log Message:
g/c unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/fs/common/fstest_nfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2011-02-12 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Feb 12 18:13:46 UTC 2011

Modified Files:
src/tests/fs/common: snapshot.c

Log Message:
Test the right fd after rump_sys_open().


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/common/snapshot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/snapshot.c
diff -u src/tests/fs/common/snapshot.c:1.5 src/tests/fs/common/snapshot.c:1.6
--- src/tests/fs/common/snapshot.c:1.5	Sun Nov  7 17:51:17 2010
+++ src/tests/fs/common/snapshot.c	Sat Feb 12 18:13:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: snapshot.c,v 1.5 2010/11/07 17:51:17 jmmv Exp $	*/
+/*	$NetBSD: snapshot.c,v 1.6 2011/02/12 18:13:46 bouyer Exp $	*/
 
 #include sys/types.h
 #include sys/ioctl.h
@@ -65,7 +65,7 @@
 		atf_tc_fail_errno(write fail);
 
 	fssfd = rump_sys_open(/dev/rfss0, O_RDWR);
-	if (fd == -1)
+	if (fssfd == -1)
 		atf_tc_fail_errno(cannot open fss);
 	makefile(BAKNAME);
 	memset(fss, 0, sizeof(fss));



CVS commit: src/tests/fs/common

2011-02-12 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Feb 12 18:13:46 UTC 2011

Modified Files:
src/tests/fs/common: snapshot.c

Log Message:
Test the right fd after rump_sys_open().


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/common/snapshot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2011-02-10 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Thu Feb 10 16:35:01 UTC 2011

Modified Files:
src/tests/fs/common: fstest_nfs.c fstest_puffs.c

Log Message:
Do initialise allocated file system args structures for puffs and nfs
(fix some puffs tests failures with MALLOC_OPTIONS=J).
While here, detect and report args allocation failure.

ok from pooka.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/common/fstest_nfs.c
cvs rdiff -u -r1.9 -r1.10 src/tests/fs/common/fstest_puffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_nfs.c
diff -u src/tests/fs/common/fstest_nfs.c:1.5 src/tests/fs/common/fstest_nfs.c:1.6
--- src/tests/fs/common/fstest_nfs.c:1.5	Fri Dec 31 18:11:27 2010
+++ src/tests/fs/common/fstest_nfs.c	Thu Feb 10 16:35:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_nfs.c,v 1.5 2010/12/31 18:11:27 pooka Exp $	*/
+/*	$NetBSD: fstest_nfs.c,v 1.6 2011/02/10 16:35:01 njoly Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -149,6 +149,9 @@
 	 * the mountpath available here.
 	 */
 	args = malloc(sizeof(*args));
+	if (args == NULL)
+		return errno;
+	memset(args, 0, sizeof(*args));
 	args-ta_childpid = childpid;
 	strcpy(args-ta_ethername, ethername);
 

Index: src/tests/fs/common/fstest_puffs.c
diff -u src/tests/fs/common/fstest_puffs.c:1.9 src/tests/fs/common/fstest_puffs.c:1.10
--- src/tests/fs/common/fstest_puffs.c:1.9	Fri Jan  7 11:50:37 2011
+++ src/tests/fs/common/fstest_puffs.c	Thu Feb 10 16:35:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_puffs.c,v 1.9 2011/01/07 11:50:37 pooka Exp $	*/
+/*	$NetBSD: fstest_puffs.c,v 1.10 2011/02/10 16:35:01 njoly Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -260,6 +260,7 @@
 	args = malloc(sizeof(*args));
 	if (args == NULL)
 		return errno;
+	memset(args, 0, sizeof(*args));
 
 	pflags = args-pta_pflags;
 



CVS commit: src/tests/fs/common

2011-02-10 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Thu Feb 10 16:35:01 UTC 2011

Modified Files:
src/tests/fs/common: fstest_nfs.c fstest_puffs.c

Log Message:
Do initialise allocated file system args structures for puffs and nfs
(fix some puffs tests failures with MALLOC_OPTIONS=J).
While here, detect and report args allocation failure.

ok from pooka.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/common/fstest_nfs.c
cvs rdiff -u -r1.9 -r1.10 src/tests/fs/common/fstest_puffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2011-01-13 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jan 13 12:55:19 UTC 2011

Modified Files:
src/tests/fs/common: fstest_ffs.c

Log Message:
wrap system() in SIG_DFL so that child-bearing fs tests (puffs,
nfs) don't go cuckoo when the process executed by system() takes a
backstage left.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/common/fstest_ffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_ffs.c
diff -u src/tests/fs/common/fstest_ffs.c:1.3 src/tests/fs/common/fstest_ffs.c:1.4
--- src/tests/fs/common/fstest_ffs.c:1.3	Fri Jan  7 11:52:59 2011
+++ src/tests/fs/common/fstest_ffs.c	Thu Jan 13 12:55:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_ffs.c,v 1.3 2011/01/07 11:52:59 pooka Exp $	*/
+/*	$NetBSD: fstest_ffs.c,v 1.4 2011/01/13 12:55:19 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -59,10 +59,15 @@
 	int res;
 	static unsigned int num = 0;
 	struct ffstestargs *args;
+	struct sigaction act, oact;
 
 	size /= 512;
 	snprintf(cmd, 1024, newfs -F -s %PRId64 %s /dev/null, size, image);
+	memset(act, 0, sizeof(act));
+	act.sa_handler = SIG_DFL;
+	sigaction(SIGCHLD, act, oact);
 	res = system(cmd);
+	sigaction(SIGCHLD, oact, NULL);
 	if (res != 0)
 		return res;
 



CVS commit: src/tests/fs/common

2011-01-13 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jan 13 12:55:19 UTC 2011

Modified Files:
src/tests/fs/common: fstest_ffs.c

Log Message:
wrap system() in SIG_DFL so that child-bearing fs tests (puffs,
nfs) don't go cuckoo when the process executed by system() takes a
backstage left.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/common/fstest_ffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/tests/fs/common

2011-01-10 Thread YAMAMOTO Takashi
hi,

 On Thu, Jan 06, 2011 at 12:53:28AM +, YAMAMOTO Takashi wrote:
(one nfsro test currently fails with EROFS vs. EACCES.  Hopefully
someone else can debate the correct errno)
   
   the NFS ACCESS procedure, which is used for open time permission checks,
   does not have a way to distinguish EROFS and EACCES.  ie. EACCES is
   the expected behaviour in this case.
 
 Shouldn't the nfs client know that it's supposed to be readonly?

probably.  please feel free to fix it. :-)

however,

 Or is
 this a case where the nfs client is read-write but the server isn't?

i think so, yes.  in this case, the client can't know EROFS at open time.

YAMAMOTO Takashi

 
 -- 
 David A. Holland
 dholl...@netbsd.org


CVS commit: src/tests/fs/common

2011-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jan  7 10:45:46 UTC 2011

Modified Files:
src/tests/fs/common: fstest_puffs.c h_fsmacros.h

Log Message:
Add a puffs-p2k-ffs file system type to automated tests.  Inspired
by the file handle problem in p2k.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/fs/common/fstest_puffs.c
cvs rdiff -u -r1.24 -r1.25 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_puffs.c
diff -u src/tests/fs/common/fstest_puffs.c:1.7 src/tests/fs/common/fstest_puffs.c:1.8
--- src/tests/fs/common/fstest_puffs.c:1.7	Wed Dec 29 22:56:59 2010
+++ src/tests/fs/common/fstest_puffs.c	Fri Jan  7 10:45:45 2011
@@ -1,7 +1,7 @@
-/*	$NetBSD: fstest_puffs.c,v 1.7 2010/12/29 22:56:59 yamt Exp $	*/
+/*	$NetBSD: fstest_puffs.c,v 1.8 2011/01/07 10:45:45 pooka Exp $	*/
 
 /*
- * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -242,14 +242,11 @@
 struct puffstestargs *theargs; /* XXX */
 
 /* XXX: we don't support size */
-int
-puffs_fstest_newfs(const atf_tc_t *tc, void **argp,
-	const char *image, off_t size, void *fspriv)
+static int
+donewfs(const atf_tc_t *tc, void **argp,
+	const char *image, off_t size, void *fspriv, char **theargv)
 {
 	struct puffstestargs *args;
-	char dtfs_path[MAXPATHLEN];
-	char *dtfsargv[6];
-	char **theargv;
 	pid_t childpid;
 	int *pflags;
 	char comfd[16];
@@ -266,24 +263,6 @@
 
 	pflags = args-pta_pflags;
 
-	/* build dtfs exec path from atf test dir */
-	sprintf(dtfs_path, %s/../puffs/h_dtfs/h_dtfs,
-	atf_tc_get_config_var(tc, srcdir));
-
-	if (fspriv) {
-		theargv = fspriv;
-		theargv[0] = dtfs_path;
-	} else {
-		dtfsargv[0] = dtfs_path;
-		dtfsargv[1] = __UNCONST(-i);
-		dtfsargv[2] = __UNCONST(-s);
-		dtfsargv[3] = __UNCONST(dtfs);
-		dtfsargv[4] = __UNCONST(fictional);
-		dtfsargv[5] = NULL;
-
-		theargv = dtfsargv;
-	}
-
 	/* Create sucketpair for communication with the real file server */
 	if (socketpair(PF_LOCAL, SOCK_STREAM, 0, sv) == -1)
 		return errno;
@@ -343,6 +322,59 @@
 }
 
 int
+puffs_fstest_newfs(const atf_tc_t *tc, void **argp,
+	const char *image, off_t size, void *fspriv)
+{
+	char dtfs_path[MAXPATHLEN];
+	char *dtfsargv[6];
+	char **theargv;
+
+	/* build dtfs exec path from atf test dir */
+	sprintf(dtfs_path, %s/../puffs/h_dtfs/h_dtfs,
+	atf_tc_get_config_var(tc, srcdir));
+
+	if (fspriv) {
+		theargv = fspriv;
+		theargv[0] = dtfs_path;
+	} else {
+		dtfsargv[0] = dtfs_path;
+		dtfsargv[1] = __UNCONST(-i);
+		dtfsargv[2] = __UNCONST(-s);
+		dtfsargv[3] = __UNCONST(dtfs);
+		dtfsargv[4] = __UNCONST(fictional);
+		dtfsargv[5] = NULL;
+
+		theargv = dtfsargv;
+	}
+
+	return donewfs(tc, argp, image, size, fspriv, theargv);
+}
+
+int
+p2k_ffs_fstest_newfs(const atf_tc_t *tc, void **argp,
+	const char *image, off_t size, void *fspriv)
+{
+	char *rumpffs_argv[5];
+	int rv;
+
+	rump_init();
+	if ((rv = ffs_fstest_newfs(tc, argp, image, size, fspriv)) != 0)
+		return rv;
+	if (mkdir(p2kffsfake, 0777) == -1)
+		return errno;
+
+	setenv(P2K_NODETACH, 1, 1);
+	rumpffs_argv[0] = __UNCONST(rump_ffs);
+	rumpffs_argv[1] = __UNCONST(image);
+	rumpffs_argv[2] = __UNCONST(p2kffsfake); /* NOTUSED */
+	rumpffs_argv[3] = NULL;
+
+	if ((rv = donewfs(tc, argp, image, size, fspriv, rumpffs_argv)) != 0)
+		ffs_fstest_delfs(tc, argp);
+	return rv;
+}
+
+int
 puffs_fstest_mount(const atf_tc_t *tc, void *arg, const char *path, int flags)
 {
 	struct puffstestargs *pargs = arg;
@@ -374,6 +406,7 @@
 
 	return 0;
 }
+__strong_alias(p2k_ffs_fstest_mount,puffs_fstest_mount);
 
 int
 puffs_fstest_delfs(const atf_tc_t *tc, void *arg)
@@ -384,6 +417,13 @@
 }
 
 int
+p2k_ffs_fstest_delfs(const atf_tc_t *tc, void *arg)
+{
+
+	return ffs_fstest_delfs(tc, arg);
+}
+
+int
 puffs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
 {
 	struct puffstestargs *pargs = theargs;
@@ -410,5 +450,8 @@
 	usleep(500);
 	wait(status);
 
+	rmdir(p2kffsfake);
+
 	return 0;
 }
+__strong_alias(p2k_ffs_fstest_unmount,puffs_fstest_unmount);

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.24 src/tests/fs/common/h_fsmacros.h:1.25
--- src/tests/fs/common/h_fsmacros.h:1.24	Fri Dec 31 18:16:41 2010
+++ src/tests/fs/common/h_fsmacros.h	Fri Jan  7 10:45:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.24 2010/12/31 18:16:41 pooka Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.25 2011/01/07 10:45:45 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -55,6 +55,7 @@
 FSPROTOS(msdosfs);
 FSPROTOS(nfs);
 FSPROTOS(nfsro);
+FSPROTOS(p2k_ffs);
 FSPROTOS(puffs);
 FSPROTOS(rumpfs);
 FSPROTOS(sysvbfs);
@@ -171,6 +172,7 @@
   

CVS commit: src/tests/fs/common

2011-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jan  7 11:36:27 UTC 2011

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Use our internal name instead of MOUNT_FOO to identify file system
since otherwise we now run into dupes (e.g. nfs and nfsro, puffs
and p2k_ffs).


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.25 src/tests/fs/common/h_fsmacros.h:1.26
--- src/tests/fs/common/h_fsmacros.h:1.25	Fri Jan  7 10:45:45 2011
+++ src/tests/fs/common/h_fsmacros.h	Fri Jan  7 11:36:27 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.25 2011/01/07 10:45:45 pooka Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.26 2011/01/07 11:36:27 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
 	ATF_TC_HEAD(_fs_##_##_func_,tc)	\
 	{\
 		atf_tc_set_md_var(tc, descr,_type_ test for _desc_);\
-		atf_tc_set_md_var(tc, X-fs.type, _type_);		\
+		atf_tc_set_md_var(tc, X-fs.type, #_fs_);		\
 	}\
 	void *_fs_##_func_##tmp;	\
 	\
@@ -240,23 +240,27 @@
 }
 
 #define FSTYPE_EXT2FS(tc)\
-(strcmp(atf_tc_get_md_var(tc, X-fs.type), MOUNT_EXT2FS) == 0)
+(strcmp(atf_tc_get_md_var(tc, X-fs.type), ext2fs) == 0)
 #define FSTYPE_FFS(tc)\
-(strcmp(atf_tc_get_md_var(tc, X-fs.type), MOUNT_FFS) == 0)
+(strcmp(atf_tc_get_md_var(tc, X-fs.type), ffs) == 0)
 #define FSTYPE_LFS(tc)\
-(strcmp(atf_tc_get_md_var(tc, X-fs.type), MOUNT_LFS) == 0)
+(strcmp(atf_tc_get_md_var(tc, X-fs.type), lfs) == 0)
 #define FSTYPE_MSDOS(tc)\
-(strcmp(atf_tc_get_md_var(tc, X-fs.type), MOUNT_MSDOS) == 0)
+(strcmp(atf_tc_get_md_var(tc, X-fs.type), msdosfs) == 0)
 #define FSTYPE_NFS(tc)\
-(strcmp(atf_tc_get_md_var(tc, X-fs.type), MOUNT_NFS) == 0)
+(strcmp(atf_tc_get_md_var(tc, X-fs.type), nfs) == 0)
+#define FSTYPE_NFSRO(tc)\
+(strcmp(atf_tc_get_md_var(tc, X-fs.type), nfsro) == 0)
+#define FSTYPE_P2K_FFS(tc)\
+(strcmp(atf_tc_get_md_var(tc, X-fs.type), p2k_ffs) == 0)
 #define FSTYPE_PUFFS(tc)\
-(strcmp(atf_tc_get_md_var(tc, X-fs.type), MOUNT_PUFFS) == 0)
+(strcmp(atf_tc_get_md_var(tc, X-fs.type), puffs) == 0)
 #define FSTYPE_RUMPFS(tc)\
-(strcmp(atf_tc_get_md_var(tc, X-fs.type), MOUNT_RUMPFS) == 0)
+(strcmp(atf_tc_get_md_var(tc, X-fs.type), rumpfs) == 0)
 #define FSTYPE_SYSVBFS(tc)\
-(strcmp(atf_tc_get_md_var(tc, X-fs.type), MOUNT_SYSVBFS) == 0)
+(strcmp(atf_tc_get_md_var(tc, X-fs.type), sysvbfs) == 0)
 #define FSTYPE_TMPFS(tc)\
-(strcmp(atf_tc_get_md_var(tc, X-fs.type), MOUNT_TMPFS) == 0)
+(strcmp(atf_tc_get_md_var(tc, X-fs.type), tmpfs) == 0)
 
 #define FSTEST_ENTER()			\
 	if (rump_sys_chdir(FSTEST_MNTNAME) == -1)			\



CVS commit: src/tests/fs/common

2011-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jan  7 11:41:40 UTC 2011

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
adjust another place where X-fs.type is set


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.26 src/tests/fs/common/h_fsmacros.h:1.27
--- src/tests/fs/common/h_fsmacros.h:1.26	Fri Jan  7 11:36:27 2011
+++ src/tests/fs/common/h_fsmacros.h	Fri Jan  7 11:41:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.26 2011/01/07 11:36:27 pooka Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.27 2011/01/07 11:41:40 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -104,7 +104,7 @@
 	ATF_TC_HEAD(fs##_##func,tc)	\
 	{\
 		atf_tc_set_md_var(tc, descr, type  test for  desc);	\
-		atf_tc_set_md_var(tc, X-fs.type, type);		\
+		atf_tc_set_md_var(tc, X-fs.type, #fs);		\
 	}\
 	void *fs##func##tmp;		\
 	\



CVS commit: src/tests/fs/common

2011-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jan  7 11:50:37 UTC 2011

Modified Files:
src/tests/fs/common: fstest_puffs.c

Log Message:
Don't panic if unnecessary dir already exists.
(helpful when running the test without atf-run)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/fs/common/fstest_puffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_puffs.c
diff -u src/tests/fs/common/fstest_puffs.c:1.8 src/tests/fs/common/fstest_puffs.c:1.9
--- src/tests/fs/common/fstest_puffs.c:1.8	Fri Jan  7 10:45:45 2011
+++ src/tests/fs/common/fstest_puffs.c	Fri Jan  7 11:50:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_puffs.c,v 1.8 2011/01/07 10:45:45 pooka Exp $	*/
+/*	$NetBSD: fstest_puffs.c,v 1.9 2011/01/07 11:50:37 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -360,7 +360,7 @@
 	rump_init();
 	if ((rv = ffs_fstest_newfs(tc, argp, image, size, fspriv)) != 0)
 		return rv;
-	if (mkdir(p2kffsfake, 0777) == -1)
+	if (mkdir(p2kffsfake, 0777) == -1  errno != EEXIST)
 		return errno;
 
 	setenv(P2K_NODETACH, 1, 1);



CVS commit: src/tests/fs/common

2011-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jan  7 11:52:59 UTC 2011

Modified Files:
src/tests/fs/common: fstest_ffs.c h_fsmacros.h

Log Message:
add another fstype for ffs -o log


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/common/fstest_ffs.c
cvs rdiff -u -r1.27 -r1.28 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_ffs.c
diff -u src/tests/fs/common/fstest_ffs.c:1.2 src/tests/fs/common/fstest_ffs.c:1.3
--- src/tests/fs/common/fstest_ffs.c:1.2	Fri Jul 30 16:15:05 2010
+++ src/tests/fs/common/fstest_ffs.c	Fri Jan  7 11:52:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_ffs.c,v 1.2 2010/07/30 16:15:05 pooka Exp $	*/
+/*	$NetBSD: fstest_ffs.c,v 1.3 2011/01/07 11:52:59 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -89,6 +89,7 @@
 
 	return 0;
 }
+__strong_alias(ffslog_fstest_newfs,ffs_fstest_newfs);
 
 int
 ffs_fstest_delfs(const atf_tc_t *tc, void *buf)
@@ -108,6 +109,7 @@
 
 	return 0;
 }
+__strong_alias(ffslog_fstest_delfs,ffs_fstest_delfs);
 
 int
 ffs_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
@@ -125,6 +127,13 @@
 }
 
 int
+ffslog_fstest_mount(const atf_tc_t *tc, void *buf, const char *path, int flags)
+{
+
+	return ffs_fstest_mount(tc, buf, path, flags | MNT_LOG);
+}
+
+int
 ffs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
 {
 	int res;
@@ -136,3 +145,4 @@
 	res = rump_sys_rmdir(path);
 	return res;
 }
+__strong_alias(ffslog_fstest_unmount,ffs_fstest_unmount);

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.27 src/tests/fs/common/h_fsmacros.h:1.28
--- src/tests/fs/common/h_fsmacros.h:1.27	Fri Jan  7 11:41:40 2011
+++ src/tests/fs/common/h_fsmacros.h	Fri Jan  7 11:52:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.27 2011/01/07 11:41:40 pooka Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.28 2011/01/07 11:52:59 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -51,6 +51,7 @@
 
 FSPROTOS(ext2fs);
 FSPROTOS(ffs);
+FSPROTOS(ffslog);
 FSPROTOS(lfs);
 FSPROTOS(msdosfs);
 FSPROTOS(nfs);
@@ -169,6 +170,7 @@
 #define ATF_TC_FSAPPLY(func,desc)	\
   ATF_TC_FSADD(ext2fs,MOUNT_EXT2FS,func,desc)\
   ATF_TC_FSADD(ffs,MOUNT_FFS,func,desc)	\
+  ATF_TC_FSADD(ffslog,MOUNT_FFS,func,desc)\
   ATF_TC_FSADD(lfs,MOUNT_LFS,func,desc)	\
   ATF_TC_FSADD(msdosfs,MOUNT_MSDOS,func,desc)\
   ATF_TC_FSADD(nfs,MOUNT_NFS,func,desc)	\
@@ -181,6 +183,7 @@
 #define ATF_TP_FSAPPLY(func)		\
   ATF_TP_FSADD(ext2fs,func);		\
   ATF_TP_FSADD(ffs,func);		\
+  ATF_TP_FSADD(ffslog,func);		\
   ATF_TP_FSADD(lfs,func);		\
   ATF_TP_FSADD(msdosfs,func);		\
   ATF_TP_FSADD(nfs,func);		\
@@ -204,6 +207,7 @@
 #define ATF_TC_FSAPPLY_RO(func,desc,gen)\
   ATF_TC_FSADD_RO(ext2fs,MOUNT_EXT2FS,func,desc,gen)			\
   ATF_TC_FSADD_RO(ffs,MOUNT_FFS,func,desc,gen)\
+  ATF_TC_FSADD_RO(ffslog,MOUNT_FFS,func,desc,gen)			\
   ATF_TC_FSADD_RO(msdosfs,MOUNT_MSDOS,func,desc,gen)			\
   ATF_TC_FSADD_RO(nfs,MOUNT_NFS,func,desc,gen)\
   ATF_TC_FSADD_RO(nfsro,MOUNT_NFS,func,desc,gen)			\
@@ -212,6 +216,7 @@
 #define ATF_TP_FSAPPLY_RO(func)		\
   ATF_TP_FSADD(ext2fs,func);		\
   ATF_TP_FSADD(ffs,func);		\
+  ATF_TP_FSADD(ffslog,func);		\
   ATF_TP_FSADD(msdosfs,func);		\
   ATF_TP_FSADD(nfs,func);		\
   ATF_TP_FSADD(nfsro,func);		\
@@ -243,6 +248,8 @@
 (strcmp(atf_tc_get_md_var(tc, X-fs.type), ext2fs) == 0)
 #define FSTYPE_FFS(tc)\
 (strcmp(atf_tc_get_md_var(tc, X-fs.type), ffs) == 0)
+#define FSTYPE_FFSLOG(tc)\
+(strcmp(atf_tc_get_md_var(tc, X-fs.type), ffs) == 0)
 #define FSTYPE_LFS(tc)\
 (strcmp(atf_tc_get_md_var(tc, X-fs.type), lfs) == 0)
 #define FSTYPE_MSDOS(tc)\



CVS commit: src/tests/fs/common

2011-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jan  7 11:58:22 UTC 2011

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
antipasto


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.28 src/tests/fs/common/h_fsmacros.h:1.29
--- src/tests/fs/common/h_fsmacros.h:1.28	Fri Jan  7 11:52:59 2011
+++ src/tests/fs/common/h_fsmacros.h	Fri Jan  7 11:58:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.28 2011/01/07 11:52:59 pooka Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.29 2011/01/07 11:58:21 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -249,7 +249,7 @@
 #define FSTYPE_FFS(tc)\
 (strcmp(atf_tc_get_md_var(tc, X-fs.type), ffs) == 0)
 #define FSTYPE_FFSLOG(tc)\
-(strcmp(atf_tc_get_md_var(tc, X-fs.type), ffs) == 0)
+(strcmp(atf_tc_get_md_var(tc, X-fs.type), ffslog) == 0)
 #define FSTYPE_LFS(tc)\
 (strcmp(atf_tc_get_md_var(tc, X-fs.type), lfs) == 0)
 #define FSTYPE_MSDOS(tc)\



CVS commit: src/tests/fs/common

2011-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jan  7 12:00:35 UTC 2011

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Set an extra xvar indicating MOUNT_FOO


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.29 src/tests/fs/common/h_fsmacros.h:1.30
--- src/tests/fs/common/h_fsmacros.h:1.29	Fri Jan  7 11:58:21 2011
+++ src/tests/fs/common/h_fsmacros.h	Fri Jan  7 12:00:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.29 2011/01/07 11:58:21 pooka Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.30 2011/01/07 12:00:34 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -106,6 +106,7 @@
 	{\
 		atf_tc_set_md_var(tc, descr, type  test for  desc);	\
 		atf_tc_set_md_var(tc, X-fs.type, #fs);		\
+		atf_tc_set_md_var(tc, X-fs.mntname, type);		\
 	}\
 	void *fs##func##tmp;		\
 	\
@@ -135,6 +136,7 @@
 	{\
 		atf_tc_set_md_var(tc, descr,_type_ test for _desc_);\
 		atf_tc_set_md_var(tc, X-fs.type, #_fs_);		\
+		atf_tc_set_md_var(tc, X-fs.mntname, _type_);		\
 	}\
 	void *_fs_##_func_##tmp;	\
 	\



CVS commit: src/tests/fs/common

2011-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jan  7 12:16:17 UTC 2011

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Adjust atf_check_type() to make it work again.
Do we need tests for the tests? ;)


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.30 src/tests/fs/common/h_fsmacros.h:1.31
--- src/tests/fs/common/h_fsmacros.h:1.30	Fri Jan  7 12:00:34 2011
+++ src/tests/fs/common/h_fsmacros.h	Fri Jan  7 12:16:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.30 2011/01/07 12:00:34 pooka Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.31 2011/01/07 12:16:17 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -112,7 +112,7 @@
 	\
 	ATF_TC_BODY(fs##_##func,tc)	\
 	{\
-		if (!atf_check_fstype(tc, type))			\
+		if (!atf_check_fstype(tc, #fs))\
 			atf_tc_skip(filesystem not selected);		\
 		FSTEST_CONSTRUCTOR(tc,fs,fs##func##tmp);		\
 		func(tc,FSTEST_MNTNAME);\
@@ -124,7 +124,7 @@
 	\
 	ATF_TC_CLEANUP(fs##_##func,tc)	\
 	{\
-		if (!atf_check_fstype(tc, type))			\
+		if (!atf_check_fstype(tc, #fs))\
 			return;		\
 		if (fs##_fstest_delfs(tc, fs##func##tmp) != 0)		\
 			atf_tc_fail_errno(delfs failed);		\
@@ -142,7 +142,7 @@
 	\
 	ATF_TC_BODY(_fs_##_##_func_,tc)	\
 	{\
-		if (!atf_check_fstype(tc, _type_))			\
+		if (!atf_check_fstype(tc, #_fs_))			\
 			atf_tc_skip(filesystem not selected);		\
 		FSTEST_CONSTRUCTOR(tc,_fs_,_fs_##_func_##tmp);		\
 		_gen_(tc,FSTEST_MNTNAME);\
@@ -160,7 +160,7 @@
 	\
 	ATF_TC_CLEANUP(_fs_##_##_func_,tc)\
 	{\
-		if (!atf_check_fstype(tc, _type_))			\
+		if (!atf_check_fstype(tc, #_fs_))			\
 			return;		\
 		if (_fs_##_fstest_delfs(tc, _fs_##_func_##tmp) != 0)	\
 			atf_tc_fail_errno(delfs failed);		\



CVS commit: src/tests/fs/common

2011-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jan  7 19:54:48 UTC 2011

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Apparently the atf in the qemu runs doesn't like p2k_ffs and hangs
completely.  Remove it for until I have a chance to debug what's
going on.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.31 src/tests/fs/common/h_fsmacros.h:1.32
--- src/tests/fs/common/h_fsmacros.h:1.31	Fri Jan  7 12:16:17 2011
+++ src/tests/fs/common/h_fsmacros.h	Fri Jan  7 19:54:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.31 2011/01/07 12:16:17 pooka Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.32 2011/01/07 19:54:48 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -176,7 +176,6 @@
   ATF_TC_FSADD(lfs,MOUNT_LFS,func,desc)	\
   ATF_TC_FSADD(msdosfs,MOUNT_MSDOS,func,desc)\
   ATF_TC_FSADD(nfs,MOUNT_NFS,func,desc)	\
-  ATF_TC_FSADD(p2k_ffs,MOUNT_PUFFS,func,desc)\
   ATF_TC_FSADD(puffs,MOUNT_PUFFS,func,desc)\
   ATF_TC_FSADD(rumpfs,MOUNT_RUMPFS,func,desc)\
   ATF_TC_FSADD(sysvbfs,MOUNT_SYSVBFS,func,desc)\
@@ -189,7 +188,6 @@
   ATF_TP_FSADD(lfs,func);		\
   ATF_TP_FSADD(msdosfs,func);		\
   ATF_TP_FSADD(nfs,func);		\
-  ATF_TP_FSADD(p2k_ffs,func);		\
   ATF_TP_FSADD(puffs,func);		\
   ATF_TP_FSADD(rumpfs,func);		\
   ATF_TP_FSADD(sysvbfs,func);		\



CVS commit: src/tests/fs/common

2011-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jan  7 10:45:46 UTC 2011

Modified Files:
src/tests/fs/common: fstest_puffs.c h_fsmacros.h

Log Message:
Add a puffs-p2k-ffs file system type to automated tests.  Inspired
by the file handle problem in p2k.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/fs/common/fstest_puffs.c
cvs rdiff -u -r1.24 -r1.25 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2011-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jan  7 11:41:40 UTC 2011

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
adjust another place where X-fs.type is set


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2011-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jan  7 11:50:37 UTC 2011

Modified Files:
src/tests/fs/common: fstest_puffs.c

Log Message:
Don't panic if unnecessary dir already exists.
(helpful when running the test without atf-run)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/fs/common/fstest_puffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2011-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jan  7 11:52:59 UTC 2011

Modified Files:
src/tests/fs/common: fstest_ffs.c h_fsmacros.h

Log Message:
add another fstype for ffs -o log


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/common/fstest_ffs.c
cvs rdiff -u -r1.27 -r1.28 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2011-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jan  7 11:58:22 UTC 2011

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
antipasto


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2011-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jan  7 12:00:35 UTC 2011

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Set an extra xvar indicating MOUNT_FOO


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2011-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jan  7 12:16:17 UTC 2011

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Adjust atf_check_type() to make it work again.
Do we need tests for the tests? ;)


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2011-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jan  7 19:54:48 UTC 2011

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Apparently the atf in the qemu runs doesn't like p2k_ffs and hangs
completely.  Remove it for until I have a chance to debug what's
going on.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/tests/fs/common

2011-01-05 Thread YAMAMOTO Takashi
hi,

 Module Name:  src
 Committed By: pooka
 Date: Fri Dec 31 18:16:41 UTC 2010
 
 Modified Files:
   src/tests/fs/common: h_fsmacros.h
 
 Log Message:
 Introduce r/o tests.  They do two mounts: the first one is r/w and
 runs a generator which primes the fs.  The second one is r/o and
 does the actual testing.  Also, introduce a nfsro fstype which does
 a clientside r/w mount for a r/o server export.
 
 requested by yamt

thanks.

 (one nfsro test currently fails with EROFS vs. EACCES.  Hopefully
 someone else can debate the correct errno)

the NFS ACCESS procedure, which is used for open time permission checks,
does not have a way to distinguish EROFS and EACCES.  ie. EACCES is
the expected behaviour in this case.

YAMAMOTO Takashi

 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.23 -r1.24 src/tests/fs/common/h_fsmacros.h
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


Re: CVS commit: src/tests/fs/common

2011-01-05 Thread David Holland
On Thu, Jan 06, 2011 at 12:53:28AM +, YAMAMOTO Takashi wrote:
   (one nfsro test currently fails with EROFS vs. EACCES.  Hopefully
   someone else can debate the correct errno)
  
  the NFS ACCESS procedure, which is used for open time permission checks,
  does not have a way to distinguish EROFS and EACCES.  ie. EACCES is
  the expected behaviour in this case.

Shouldn't the nfs client know that it's supposed to be readonly? Or is
this a case where the nfs client is read-write but the server isn't?

-- 
David A. Holland
dholl...@netbsd.org


Re: CVS commit: src/tests/fs/common

2011-01-03 Thread Manuel Bouyer
On Fri, Dec 31, 2010 at 07:45:26PM +, David Laight wrote:
 [...]
 From what I remember of the NFS protocol, the following 'rules' applied:
 1) If you export part of a filesystem, you export all of the filesystem.

that's probably trye

 2) If you give anyone access, you give everyone access.
 3) If you give anyone write access, you give everyone write access.

these 2 are not true for NetBSD I think

 This is all because it is the 'mount' protocol that verifies whether
 a client has access - so a client that disobeys the mount protocol, or
 fakes up valid nfs file handles can avoid the access checks.

This was true for the SunOS 4 nfs implementation (and maybe other
implementations derived from the same base), but for NetBSD, some checks are
done at the nfsd level: the source IP address from the NFS request is
checked against the export list, as well as the R/O status for a write
request (and other things such as the uid root is mapped to).
So if you consider IP address are not spoofables in your environnement,
IP-based access and write permissions are fine.

-- 
Manuel Bouyer bou...@antioche.eu.org
 NetBSD: 26 ans d'experience feront toujours la difference
--


Re: CVS commit: src/tests/fs/common

2011-01-02 Thread David Laight
On Sun, Jan 02, 2011 at 05:26:29AM +, David Holland wrote:
 On Sun, Jan 02, 2011 at 05:22:32AM +, David Holland wrote:
   It would also be worthwhile to test that nfsd doesn't allow writing
   via read-only handles, but that's a different issue and will require a
   different test framework that sends raw nfs packets.
 
 Hmm, no, maybe I misunderstood. Anyway, the mountd permissions issue
 is PR 3019, the longest-lived-without-attention bug in the whole bug
 database.

Hm, yes the client side is expected to check for -ro mounts.

David

-- 
David Laight: da...@l8s.co.uk


Re: CVS commit: src/tests/fs/common

2011-01-01 Thread David Holland
On Sat, Jan 01, 2011 at 03:02:00PM +0200, Antti Kantee wrote:
   It is possible that netbsd's nfs server does additional checks but
   they are expensive to do on every nfs request.
  
  That's good advise to someone who is configuring an nfs server.

...which is to say, it's not relevant to this test; a readonly mount
on the client should still be readonly regardless of what the server
export permissions allow.

It would also be worthwhile to test that nfsd doesn't allow writing
via read-only handles, but that's a different issue and will require a
different test framework that sends raw nfs packets.

-- 
David A. Holland
dholl...@netbsd.org


Re: CVS commit: src/tests/fs/common

2011-01-01 Thread David Holland
On Sun, Jan 02, 2011 at 05:22:32AM +, David Holland wrote:
  It would also be worthwhile to test that nfsd doesn't allow writing
  via read-only handles, but that's a different issue and will require a
  different test framework that sends raw nfs packets.

Hmm, no, maybe I misunderstood. Anyway, the mountd permissions issue
is PR 3019, the longest-lived-without-attention bug in the whole bug
database.

-- 
David A. Holland
dholl...@netbsd.org


Re: CVS commit: src/tests/fs/common

2010-12-31 Thread David Laight
On Fri, Dec 31, 2010 at 06:16:41PM +, Antti Kantee wrote:
 Module Name:  src
 Committed By: pooka
 Date: Fri Dec 31 18:16:41 UTC 2010
 
 Modified Files:
   src/tests/fs/common: h_fsmacros.h
 
 Log Message:
 Introduce r/o tests.  They do two mounts: the first one is r/w and
 runs a generator which primes the fs.  The second one is r/o and
 does the actual testing.  Also, introduce a nfsro fstype which does
 a clientside r/w mount for a r/o server export.
 
 requested by yamt
 
 (one nfsro test currently fails with EROFS vs. EACCES.  Hopefully
 someone else can debate the correct errno)

From what I remember of the NFS protocol, the following 'rules' applied:
1) If you export part of a filesystem, you export all of the filesystem.
2) If you give anyone access, you give everyone access.
3) If you give anyone write access, you give everyone write access.
This is all because it is the 'mount' protocol that verifies whether
a client has access - so a client that disobeys the mount protocol, or
fakes up valid nfs file handles can avoid the access checks.

It is possible that netbsd's nfs server does additional checks but
they are expensive to do on every nfs request.

David

-- 
David Laight: da...@l8s.co.uk


CVS commit: src/tests/fs/common

2010-12-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Dec 31 18:12:51 UTC 2010

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Sprinkle some KNF.  No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.22 src/tests/fs/common/h_fsmacros.h:1.23
--- src/tests/fs/common/h_fsmacros.h:1.22	Thu Nov 11 17:39:29 2010
+++ src/tests/fs/common/h_fsmacros.h	Fri Dec 31 18:12:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.22 2010/11/11 17:39:29 pooka Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.23 2010/12/31 18:12:51 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -97,77 +97,80 @@
 		atf_tc_fail_errno(delfs failed);			\
 } while (/*CONSTCOND*/0);
 
-#define ATF_TC_FSADD(fs,type,func,desc) \
-  ATF_TC_WITH_CLEANUP(fs##_##func); \
-  ATF_TC_HEAD(fs##_##func,tc) \
-  { \
-atf_tc_set_md_var(tc, descr, type  test for  desc); \
-atf_tc_set_md_var(tc, X-fs.type, type); \
-  } \
-  void *fs##func##tmp; \
-  ATF_TC_BODY(fs##_##func,tc) \
-  { \
-if (!atf_check_fstype(tc, type)) \
-  atf_tc_skip(filesystem not selected); \
-FSTEST_CONSTRUCTOR(tc,fs,fs##func##tmp); \
-func(tc,FSTEST_MNTNAME); \
-if (fs##_fstest_unmount(tc, FSTEST_MNTNAME, 0) != 0) { \
-  rump_pub_vfs_mount_print(FSTEST_MNTNAME, 1); \
-  atf_tc_fail_errno(unmount failed); \
-} \
-  } \
-  ATF_TC_CLEANUP(fs##_##func,tc) \
-  { \
-if (!atf_check_fstype(tc, type)) \
-  return; \
-if (fs##_fstest_delfs(tc, fs##func##tmp) != 0) \
-  atf_tc_fail_errno(delfs failed); \
-  }
+#define ATF_TC_FSADD(fs,type,func,desc)	\
+	ATF_TC_WITH_CLEANUP(fs##_##func);\
+	ATF_TC_HEAD(fs##_##func,tc)	\
+	{\
+		atf_tc_set_md_var(tc, descr, type  test for  desc);	\
+		atf_tc_set_md_var(tc, X-fs.type, type);		\
+	}\
+	void *fs##func##tmp;		\
+	\
+	ATF_TC_BODY(fs##_##func,tc)	\
+	{\
+		if (!atf_check_fstype(tc, type))			\
+			atf_tc_skip(filesystem not selected);		\
+		FSTEST_CONSTRUCTOR(tc,fs,fs##func##tmp);		\
+		func(tc,FSTEST_MNTNAME);\
+		if (fs##_fstest_unmount(tc, FSTEST_MNTNAME, 0) != 0) {	\
+			rump_pub_vfs_mount_print(FSTEST_MNTNAME, 1);	\
+			atf_tc_fail_errno(unmount failed);		\
+		}			\
+	}\
+	\
+	ATF_TC_CLEANUP(fs##_##func,tc)	\
+	{\
+		if (!atf_check_fstype(tc, type))			\
+			return;		\
+		if (fs##_fstest_delfs(tc, fs##func##tmp) != 0)		\
+			atf_tc_fail_errno(delfs failed);		\
+	}
 
-#define ATF_TP_FSADD(fs,func) \
+#define ATF_TP_FSADD(fs,func)		\
   ATF_TP_ADD_TC(tp,fs##_##func)
 
-#define ATF_TC_FSAPPLY(func,desc) \
-  ATF_TC_FSADD(ext2fs,MOUNT_EXT2FS,func,desc) \
-  ATF_TC_FSADD(ffs,MOUNT_FFS,func,desc) \
-  ATF_TC_FSADD(lfs,MOUNT_LFS,func,desc) \
-  ATF_TC_FSADD(msdosfs,MOUNT_MSDOS,func,desc) \
-  ATF_TC_FSADD(nfs,MOUNT_NFS,func,desc) \
-  ATF_TC_FSADD(puffs,MOUNT_PUFFS,func,desc) \
-  ATF_TC_FSADD(rumpfs,MOUNT_RUMPFS,func,desc) \
-  ATF_TC_FSADD(sysvbfs,MOUNT_SYSVBFS,func,desc) \
+#define ATF_TC_FSAPPLY(func,desc)	\
+  ATF_TC_FSADD(ext2fs,MOUNT_EXT2FS,func,desc)\
+  ATF_TC_FSADD(ffs,MOUNT_FFS,func,desc)	\
+  ATF_TC_FSADD(lfs,MOUNT_LFS,func,desc)	\
+  ATF_TC_FSADD(msdosfs,MOUNT_MSDOS,func,desc)\
+  ATF_TC_FSADD(nfs,MOUNT_NFS,func,desc)	\
+  ATF_TC_FSADD(puffs,MOUNT_PUFFS,func,desc)\
+  ATF_TC_FSADD(rumpfs,MOUNT_RUMPFS,func,desc)\
+  ATF_TC_FSADD(sysvbfs,MOUNT_SYSVBFS,func,desc)\
   ATF_TC_FSADD(tmpfs,MOUNT_TMPFS,func,desc)
 
-#define ATF_TP_FSAPPLY(func) \
-  ATF_TP_FSADD(ext2fs,func); \
-  ATF_TP_FSADD(ffs,func); \
-  ATF_TP_FSADD(lfs,func); \
-  ATF_TP_FSADD(msdosfs,func); \
-  ATF_TP_FSADD(nfs,func); \
-  ATF_TP_FSADD(puffs,func); \
-  ATF_TP_FSADD(rumpfs,func); \
-  ATF_TP_FSADD(sysvbfs,func); \
+#define ATF_TP_FSAPPLY(func)		\
+  ATF_TP_FSADD(ext2fs,func);		\
+  ATF_TP_FSADD(ffs,func);		\
+  ATF_TP_FSADD(lfs,func);		\
+  ATF_TP_FSADD(msdosfs,func);		\
+  ATF_TP_FSADD(nfs,func);		\
+  ATF_TP_FSADD(puffs,func);		\
+  ATF_TP_FSADD(rumpfs,func);		\
+  ATF_TP_FSADD(sysvbfs,func);		\
   ATF_TP_FSADD(tmpfs,func);
 
-#define ATF_FSAPPLY(func,desc) \
-  ATF_TC_FSAPPLY(func,desc); \
-  ATF_TP_ADD_TCS(tp) \
-  { \
-ATF_TP_FSAPPLY(func); \
-return atf_no_error(); \
-  }
+#define ATF_FSAPPLY(func,desc)		\
+	ATF_TC_FSAPPLY(func,desc);	\
+	ATF_TP_ADD_TCS(tp)		\
+	{\
+		ATF_TP_FSAPPLY(func);	\
+		return atf_no_error();	\
+	}
 
 static __inline bool
 atf_check_fstype(const atf_tc_t *tc, const char *fs)
 {
-  const char *fstype;
+	const char *fstype;
+
+	if (!atf_tc_has_config_var(tc, fstype))
+		return true;
 
-  if (!atf_tc_has_config_var(tc, fstype))
-return true;
-  fstype = 

CVS commit: src/tests/fs/common

2010-12-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Dec 31 18:16:41 UTC 2010

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Introduce r/o tests.  They do two mounts: the first one is r/w and
runs a generator which primes the fs.  The second one is r/o and
does the actual testing.  Also, introduce a nfsro fstype which does
a clientside r/w mount for a r/o server export.

requested by yamt

(one nfsro test currently fails with EROFS vs. EACCES.  Hopefully
someone else can debate the correct errno)


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.23 src/tests/fs/common/h_fsmacros.h:1.24
--- src/tests/fs/common/h_fsmacros.h:1.23	Fri Dec 31 18:12:51 2010
+++ src/tests/fs/common/h_fsmacros.h	Fri Dec 31 18:16:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.23 2010/12/31 18:12:51 pooka Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.24 2010/12/31 18:16:41 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -54,6 +54,7 @@
 FSPROTOS(lfs);
 FSPROTOS(msdosfs);
 FSPROTOS(nfs);
+FSPROTOS(nfsro);
 FSPROTOS(puffs);
 FSPROTOS(rumpfs);
 FSPROTOS(sysvbfs);
@@ -126,6 +127,41 @@
 			atf_tc_fail_errno(delfs failed);		\
 	}
 
+#define ATF_TC_FSADD_RO(_fs_,_type_,_func_,_desc_,_gen_)		\
+	ATF_TC_WITH_CLEANUP(_fs_##_##_func_);\
+	ATF_TC_HEAD(_fs_##_##_func_,tc)	\
+	{\
+		atf_tc_set_md_var(tc, descr,_type_ test for _desc_);\
+		atf_tc_set_md_var(tc, X-fs.type, _type_);		\
+	}\
+	void *_fs_##_func_##tmp;	\
+	\
+	ATF_TC_BODY(_fs_##_##_func_,tc)	\
+	{\
+		if (!atf_check_fstype(tc, _type_))			\
+			atf_tc_skip(filesystem not selected);		\
+		FSTEST_CONSTRUCTOR(tc,_fs_,_fs_##_func_##tmp);		\
+		_gen_(tc,FSTEST_MNTNAME);\
+		if (_fs_##_fstest_unmount(tc, FSTEST_MNTNAME, 0) != 0)	\
+			atf_tc_fail_errno(unmount r/w failed);	\
+		if (_fs_##_fstest_mount(tc, _fs_##_func_##tmp,		\
+		FSTEST_MNTNAME, MNT_RDONLY) != 0)			\
+		atf_tc_fail_errno(mount ro failed);			\
+		_func_(tc,FSTEST_MNTNAME);\
+		if (_fs_##_fstest_unmount(tc, FSTEST_MNTNAME, 0) != 0) {\
+			rump_pub_vfs_mount_print(FSTEST_MNTNAME, 1);	\
+			atf_tc_fail_errno(unmount failed);		\
+		}			\
+	}\
+	\
+	ATF_TC_CLEANUP(_fs_##_##_func_,tc)\
+	{\
+		if (!atf_check_fstype(tc, _type_))			\
+			return;		\
+		if (_fs_##_fstest_delfs(tc, _fs_##_func_##tmp) != 0)	\
+			atf_tc_fail_errno(delfs failed);		\
+	}
+
 #define ATF_TP_FSADD(fs,func)		\
   ATF_TP_ADD_TC(tp,fs##_##func)
 
@@ -151,6 +187,33 @@
   ATF_TP_FSADD(sysvbfs,func);		\
   ATF_TP_FSADD(tmpfs,func);
 
+/*
+ * Same as above, but generate a file system image first and perform
+ * tests for a r/o mount.
+ *
+ * Missing the following file systems:
+ *   + lfs (fstest_lfs routines cannot handle remount.  FIXME!)
+ *   + tmpfs (memory backend)
+ *   + rumpfs (memory backend)
+ *   + puffs (memory backend, but could be run in theory)
+ */
+
+#define ATF_TC_FSAPPLY_RO(func,desc,gen)\
+  ATF_TC_FSADD_RO(ext2fs,MOUNT_EXT2FS,func,desc,gen)			\
+  ATF_TC_FSADD_RO(ffs,MOUNT_FFS,func,desc,gen)\
+  ATF_TC_FSADD_RO(msdosfs,MOUNT_MSDOS,func,desc,gen)			\
+  ATF_TC_FSADD_RO(nfs,MOUNT_NFS,func,desc,gen)\
+  ATF_TC_FSADD_RO(nfsro,MOUNT_NFS,func,desc,gen)			\
+  ATF_TC_FSADD_RO(sysvbfs,MOUNT_SYSVBFS,func,desc,gen)
+
+#define ATF_TP_FSAPPLY_RO(func)		\
+  ATF_TP_FSADD(ext2fs,func);		\
+  ATF_TP_FSADD(ffs,func);		\
+  ATF_TP_FSADD(msdosfs,func);		\
+  ATF_TP_FSADD(nfs,func);		\
+  ATF_TP_FSADD(nfsro,func);		\
+  ATF_TP_FSADD(sysvbfs,func);
+
 #define ATF_FSAPPLY(func,desc)		\
 	ATF_TC_FSAPPLY(func,desc);	\
 	ATF_TP_ADD_TCS(tp)		\



CVS commit: src/tests/fs/common

2010-12-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Dec 31 18:12:51 UTC 2010

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Sprinkle some KNF.  No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2010-12-29 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Dec 29 22:56:59 UTC 2010

Modified Files:
src/tests/fs/common: fstest_puffs.c

Log Message:
don't assume atomic read/write on socketpair.  puffs_kargs at least is
too large to assume atomic read/write.  this makes some tests including
fs/puffs/t_basic pass on my environment.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/common/fstest_puffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_puffs.c
diff -u src/tests/fs/common/fstest_puffs.c:1.6 src/tests/fs/common/fstest_puffs.c:1.7
--- src/tests/fs/common/fstest_puffs.c:1.6	Mon Nov  1 16:27:07 2010
+++ src/tests/fs/common/fstest_puffs.c	Wed Dec 29 22:56:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_puffs.c,v 1.6 2010/11/01 16:27:07 pooka Exp $	*/
+/*	$NetBSD: fstest_puffs.c,v 1.7 2010/12/29 22:56:59 yamt Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -55,6 +55,44 @@
 
 static bool mayquit = false;
 
+static ssize_t
+xread(int fd, void *vp, size_t n)
+{
+	size_t left;
+
+	left = n;
+	do {
+		ssize_t ssz;
+
+		ssz = read(fd, vp, left);
+		if (ssz == -1) {
+			return ssz;
+		}
+		left -= ssz;
+		vp = (char *)vp + ssz;
+	} while (left  0);
+	return n;
+}
+
+static ssize_t
+xwrite(int fd, const void *vp, size_t n)
+{
+	size_t left;
+
+	left = n;
+	do {
+		ssize_t ssz;
+
+		ssz = write(fd, vp, left);
+		if (ssz == -1) {
+			return ssz;
+		}
+		left -= ssz;
+		vp = (const char *)vp + ssz;
+	} while (left  0);
+	return n;
+}
+
 /*
  * Threads which shovel data between comfd and /dev/puffs.
  * (cannot use polling since fd's are in different namespaces)
@@ -102,7 +140,7 @@
 		}
 
 		n = phdr-pth_framelen;
-		if (write(comfd, buf, n) != n) {
+		if (xwrite(comfd, buf, n) != n) {
 			fprintf(stderr, readshovel write %zd / %d\n, n, errno);
 			break;
 		}
@@ -143,7 +181,7 @@
 		toread = sizeof(struct putter_hdr);
 		assert(toread  BUFSIZE);
 		do {
-			n = read(comfd, buf+off, toread);
+			n = xread(comfd, buf+off, toread);
 			if (n = 0) {
 fprintf(stderr, writeshovel read %zd / %d\n,
 n, errno);
@@ -269,30 +307,30 @@
 	}
 
 	/* read args */
-	if ((n = read(sv[1], len, sizeof(len))) != sizeof(len))
+	if ((n = xread(sv[1], len, sizeof(len))) != sizeof(len))
 		err(1, mp 1 %zd, n);
 	if (len  MAXPATHLEN)
 		err(1, mntpath  MAXPATHLEN);
-	if ((size_t)read(sv[1], args-pta_dir, len) != len)
+	if ((size_t)xread(sv[1], args-pta_dir, len) != len)
 		err(1, mp 2);
-	if (read(sv[1], len, sizeof(len)) != sizeof(len))
+	if (xread(sv[1], len, sizeof(len)) != sizeof(len))
 		err(1, fn 1);
 	if (len  MAXPATHLEN)
 		err(1, devpath  MAXPATHLEN);
-	if ((size_t)read(sv[1], args-pta_dev, len) != len)
+	if ((size_t)xread(sv[1], args-pta_dev, len) != len)
 		err(1, fn 2);
-	if (read(sv[1], mntflags, sizeof(mntflags)) != sizeof(mntflags))
+	if (xread(sv[1], mntflags, sizeof(mntflags)) != sizeof(mntflags))
 		err(1, mntflags);
-	if (read(sv[1], args-pta_pargslen, sizeof(args-pta_pargslen))
+	if (xread(sv[1], args-pta_pargslen, sizeof(args-pta_pargslen))
 	!= sizeof(args-pta_pargslen))
 		err(1, puffstest_args len);
 	args-pta_pargs = malloc(args-pta_pargslen);
 	if (args-pta_pargs == NULL)
 		err(1, malloc);
-	if (read(sv[1], args-pta_pargs, args-pta_pargslen)
+	if (xread(sv[1], args-pta_pargs, args-pta_pargslen)
 	!= (ssize_t)args-pta_pargslen)
 		err(1, puffstest_args);
-	if (read(sv[1], pflags, sizeof(*pflags)) != sizeof(*pflags))
+	if (xread(sv[1], pflags, sizeof(*pflags)) != sizeof(*pflags))
 		err(1, pflags);
 
 	args-pta_childpid = childpid;



CVS commit: src/tests/fs/common

2010-12-29 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Dec 29 22:56:59 UTC 2010

Modified Files:
src/tests/fs/common: fstest_puffs.c

Log Message:
don't assume atomic read/write on socketpair.  puffs_kargs at least is
too large to assume atomic read/write.  this makes some tests including
fs/puffs/t_basic pass on my environment.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/common/fstest_puffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2010-11-11 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Nov 11 17:39:29 UTC 2010

Modified Files:
src/tests/fs/common: Makefile h_fsmacros.h
Added Files:
src/tests/fs/common: fstest_rumpfs.c

Log Message:
Add rumpfs to list of file systems to be autotested.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/common/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/fs/common/fstest_rumpfs.c
cvs rdiff -u -r1.21 -r1.22 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/Makefile
diff -u src/tests/fs/common/Makefile:1.5 src/tests/fs/common/Makefile:1.6
--- src/tests/fs/common/Makefile:1.5	Tue Aug  3 17:24:45 2010
+++ src/tests/fs/common/Makefile	Thu Nov 11 17:39:29 2010
@@ -1,11 +1,12 @@
-#	$NetBSD: Makefile,v 1.5 2010/08/03 17:24:45 drochner Exp $
+#	$NetBSD: Makefile,v 1.6 2010/11/11 17:39:29 pooka Exp $
 #
 
 .include bsd.own.mk
 
 LIB=	vfstest
 SRCS=	fstest_ext2fs.c fstest_ffs.c fstest_lfs.c fstest_msdosfs.c	\
-	fstest_nfs.c fstest_puffs.c fstest_sysvbfs.c fstest_tmpfs.c
+	fstest_nfs.c fstest_puffs.c fstest_rumpfs.c fstest_sysvbfs.c	\
+	fstest_tmpfs.c
 
 WARNS=	3
 

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.21 src/tests/fs/common/h_fsmacros.h:1.22
--- src/tests/fs/common/h_fsmacros.h:1.21	Sun Nov  7 17:51:17 2010
+++ src/tests/fs/common/h_fsmacros.h	Thu Nov 11 17:39:29 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.21 2010/11/07 17:51:17 jmmv Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.22 2010/11/11 17:39:29 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -55,6 +55,7 @@
 FSPROTOS(msdosfs);
 FSPROTOS(nfs);
 FSPROTOS(puffs);
+FSPROTOS(rumpfs);
 FSPROTOS(sysvbfs);
 FSPROTOS(tmpfs);
 
@@ -133,6 +134,7 @@
   ATF_TC_FSADD(msdosfs,MOUNT_MSDOS,func,desc) \
   ATF_TC_FSADD(nfs,MOUNT_NFS,func,desc) \
   ATF_TC_FSADD(puffs,MOUNT_PUFFS,func,desc) \
+  ATF_TC_FSADD(rumpfs,MOUNT_RUMPFS,func,desc) \
   ATF_TC_FSADD(sysvbfs,MOUNT_SYSVBFS,func,desc) \
   ATF_TC_FSADD(tmpfs,MOUNT_TMPFS,func,desc)
 
@@ -143,6 +145,7 @@
   ATF_TP_FSADD(msdosfs,func); \
   ATF_TP_FSADD(nfs,func); \
   ATF_TP_FSADD(puffs,func); \
+  ATF_TP_FSADD(rumpfs,func); \
   ATF_TP_FSADD(sysvbfs,func); \
   ATF_TP_FSADD(tmpfs,func);
 
@@ -179,6 +182,8 @@
 (strcmp(atf_tc_get_md_var(tc, X-fs.type), MOUNT_NFS) == 0)
 #define FSTYPE_PUFFS(tc)\
 (strcmp(atf_tc_get_md_var(tc, X-fs.type), MOUNT_PUFFS) == 0)
+#define FSTYPE_RUMPFS(tc)\
+(strcmp(atf_tc_get_md_var(tc, X-fs.type), MOUNT_RUMPFS) == 0)
 #define FSTYPE_SYSVBFS(tc)\
 (strcmp(atf_tc_get_md_var(tc, X-fs.type), MOUNT_SYSVBFS) == 0)
 #define FSTYPE_TMPFS(tc)\

Added files:

Index: src/tests/fs/common/fstest_rumpfs.c
diff -u /dev/null src/tests/fs/common/fstest_rumpfs.c:1.1
--- /dev/null	Thu Nov 11 17:39:29 2010
+++ src/tests/fs/common/fstest_rumpfs.c	Thu Nov 11 17:39:29 2010
@@ -0,0 +1,83 @@
+/*	$NetBSD: fstest_rumpfs.c,v 1.1 2010/11/11 17:39:29 pooka Exp $	*/
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nicolas Joly.
+ *
+ * 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/mount.h
+#include sys/stat.h
+
+#include atf-c.h
+#include stdio.h
+#include stdlib.h
+#include string.h
+#include unistd.h
+
+#include rump/rump.h
+#include rump/rump_syscalls.h
+
+#include h_fsmacros.h
+
+int
+rumpfs_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image,
+off_t size, void *fspriv)
+{
+
+	return rump_init();
+}
+
+int
+rumpfs_fstest_delfs(const atf_tc_t *tc, 

CVS commit: src/tests/fs/common

2010-11-11 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Nov 11 17:39:29 UTC 2010

Modified Files:
src/tests/fs/common: Makefile h_fsmacros.h
Added Files:
src/tests/fs/common: fstest_rumpfs.c

Log Message:
Add rumpfs to list of file systems to be autotested.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/common/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/fs/common/fstest_rumpfs.c
cvs rdiff -u -r1.21 -r1.22 src/tests/fs/common/h_fsmacros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2010-11-01 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Nov  1 16:27:08 UTC 2010

Modified Files:
src/tests/fs/common: fstest_puffs.c

Log Message:
Make the shovel threads resilient to file server exit.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/common/fstest_puffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_puffs.c
diff -u src/tests/fs/common/fstest_puffs.c:1.5 src/tests/fs/common/fstest_puffs.c:1.6
--- src/tests/fs/common/fstest_puffs.c:1.5	Sun Oct 31 22:33:16 2010
+++ src/tests/fs/common/fstest_puffs.c	Mon Nov  1 16:27:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_puffs.c,v 1.5 2010/10/31 22:33:16 pgoyette Exp $	*/
+/*	$NetBSD: fstest_puffs.c,v 1.6 2010/11/01 16:27:07 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -53,6 +53,8 @@
 #define BUFSIZE (128*1024)
 #define DTFS_DUMP -o,dump
 
+static bool mayquit = false;
+
 /*
  * Threads which shovel data between comfd and /dev/puffs.
  * (cannot use polling since fd's are in different namespaces)
@@ -64,6 +66,7 @@
 	struct puffs_req *preq;
 	struct puffstestargs *args = arg;
 	char buf[BUFSIZE];
+	ssize_t n;
 	int comfd, puffsfd;
 
 	comfd = args-pta_servfd;
@@ -75,8 +78,6 @@
 	rump_pub_lwproc_newlwp(1);
 
 	for (;;) {
-		ssize_t n;
-
 		n = rump_sys_read(puffsfd, buf, sizeof(*phdr));
 		if (n = 0) {
 			fprintf(stderr, readshovel r1 %zd / %d\n, n, errno);
@@ -107,7 +108,9 @@
 		}
 	}
 
-	abort();
+	if (n != 0  mayquit == false)
+		abort();
+	return NULL;
 }
 
 static void *
@@ -115,8 +118,10 @@
 {
 	struct puffstestargs *args = arg;
 	struct putter_hdr *phdr;
+	struct puffs_req *preq;
 	char buf[BUFSIZE];
 	size_t toread;
+	ssize_t n;
 	int comfd, puffsfd;
 
 	rump_pub_lwproc_newlwp(1);
@@ -125,10 +130,10 @@
 	puffsfd = args-pta_rumpfd;
 
 	phdr = (struct putter_hdr *)buf;
+	preq = (void *)buf;
 
 	for (;;) {
 		uint64_t off;
-		ssize_t n;
 
 		/*
 		 * Need to write everything to the kernel in one chunk,
@@ -142,7 +147,7 @@
 			if (n = 0) {
 fprintf(stderr, writeshovel read %zd / %d\n,
 n, errno);
-break;
+goto out;
 			}
 			off += n;
 			if (off = sizeof(struct putter_hdr))
@@ -151,6 +156,13 @@
 toread = off - sizeof(struct putter_hdr);
 		} while (toread);
 
+		if (__predict_false(
+		PUFFSOP_OPCLASS(preq-preq_opclass) == PUFFSOP_VFS
+		 preq-preq_optype == PUFFS_VFS_UNMOUNT)) {
+			if (preq-preq_rv == 0)
+mayquit = true;
+		}
+
 		n = rump_sys_write(puffsfd, buf, phdr-pth_framelen);
 		if ((size_t)n != phdr-pth_framelen) {
 			fprintf(stderr, writeshovel wr %zd / %d\n, n, errno);
@@ -158,7 +170,10 @@
 		}
 	}
 
-	abort();
+ out:
+	if (n != 0)
+		abort();
+	return NULL;
 }
 
 static void



CVS commit: src/tests/fs/common

2010-11-01 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Nov  1 16:27:08 UTC 2010

Modified Files:
src/tests/fs/common: fstest_puffs.c

Log Message:
Make the shovel threads resilient to file server exit.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/common/fstest_puffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2010-10-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Oct 31 22:05:35 UTC 2010

Modified Files:
src/tests/fs/common: fstest_puffs.c

Log Message:
Since rump implicit threads now bind to proc1 instead of proc0, we
need our shovel threads bound to proc1 instead of proc0 in order
to have access to the same set of descriptors as the implicit thread
which opens the fd in the rump kernel.

Also, sprinkle some printfs and make failure more dramatic.

fixes the puffs tests.  pointed out by pgoyette.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/common/fstest_puffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_puffs.c
diff -u src/tests/fs/common/fstest_puffs.c:1.3 src/tests/fs/common/fstest_puffs.c:1.4
--- src/tests/fs/common/fstest_puffs.c:1.3	Wed Sep  1 19:41:27 2010
+++ src/tests/fs/common/fstest_puffs.c	Sun Oct 31 22:05:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_puffs.c,v 1.3 2010/09/01 19:41:27 pooka Exp $	*/
+/*	$NetBSD: fstest_puffs.c,v 1.4 2010/10/31 22:05:35 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -72,20 +72,24 @@
 	phdr = (void *)buf;
 	preq = (void *)buf;
 
-	rump_pub_lwproc_newlwp(0);
+	rump_pub_lwproc_newlwp(1);
 
 	for (;;) {
 		ssize_t n;
 
 		n = rump_sys_read(puffsfd, buf, sizeof(*phdr));
-		if (n = 0)
+		if (n = 0) {
+			fprintf(stderr, readshovel r1 %d / %d\n, n, errno);
 			break;
+		}
 
 		assert(phdr-pth_framelen  BUFSIZE);
 		n = rump_sys_read(puffsfd, buf+sizeof(*phdr), 
 		phdr-pth_framelen - sizeof(*phdr));
-		if (n = 0)
+		if (n = 0) {
+			fprintf(stderr, readshovel r2 %d / %d\n, n, errno);
 			break;
+		}
 
 		/* Analyze request */
 		if (PUFFSOP_OPCLASS(preq-preq_opclass) == PUFFSOP_VFS) {
@@ -97,11 +101,13 @@
 		}
 
 		n = phdr-pth_framelen;
-		if (write(comfd, buf, n) != n)
+		if (write(comfd, buf, n) != n) {
+			fprintf(stderr, readshovel write %d / %d\n, n, errno);
 			break;
+		}
 	}
 
-	return NULL;
+	abort();
 }
 
 static void *
@@ -113,7 +119,7 @@
 	size_t toread;
 	int comfd, puffsfd;
 
-	rump_pub_lwproc_newlwp(0);
+	rump_pub_lwproc_newlwp(1);
 
 	comfd = args-pta_servfd;
 	puffsfd = args-pta_rumpfd;
@@ -134,6 +140,8 @@
 		do {
 			n = read(comfd, buf+off, toread);
 			if (n = 0) {
+fprintf(stderr, writeshovel read %d / %d\n,
+n, errno);
 break;
 			}
 			off += n;
@@ -144,11 +152,13 @@
 		} while (toread);
 
 		n = rump_sys_write(puffsfd, buf, phdr-pth_framelen);
-		if ((size_t)n != phdr-pth_framelen)
+		if ((size_t)n != phdr-pth_framelen) {
+			fprintf(stderr, writeshovel wr %d / %d\n, n, errno);
 			break;
+		}
 	}
 
-	return NULL;
+	abort();
 }
 
 static void



CVS commit: src/tests/fs/common

2010-10-31 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Oct 31 22:33:16 UTC 2010

Modified Files:
src/tests/fs/common: fstest_puffs.c

Log Message:
Fix format strings so it builds on amd64


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/common/fstest_puffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/fstest_puffs.c
diff -u src/tests/fs/common/fstest_puffs.c:1.4 src/tests/fs/common/fstest_puffs.c:1.5
--- src/tests/fs/common/fstest_puffs.c:1.4	Sun Oct 31 22:05:35 2010
+++ src/tests/fs/common/fstest_puffs.c	Sun Oct 31 22:33:16 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_puffs.c,v 1.4 2010/10/31 22:05:35 pooka Exp $	*/
+/*	$NetBSD: fstest_puffs.c,v 1.5 2010/10/31 22:33:16 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
 
 		n = rump_sys_read(puffsfd, buf, sizeof(*phdr));
 		if (n = 0) {
-			fprintf(stderr, readshovel r1 %d / %d\n, n, errno);
+			fprintf(stderr, readshovel r1 %zd / %d\n, n, errno);
 			break;
 		}
 
@@ -87,7 +87,7 @@
 		n = rump_sys_read(puffsfd, buf+sizeof(*phdr), 
 		phdr-pth_framelen - sizeof(*phdr));
 		if (n = 0) {
-			fprintf(stderr, readshovel r2 %d / %d\n, n, errno);
+			fprintf(stderr, readshovel r2 %zd / %d\n, n, errno);
 			break;
 		}
 
@@ -102,7 +102,7 @@
 
 		n = phdr-pth_framelen;
 		if (write(comfd, buf, n) != n) {
-			fprintf(stderr, readshovel write %d / %d\n, n, errno);
+			fprintf(stderr, readshovel write %zd / %d\n, n, errno);
 			break;
 		}
 	}
@@ -140,7 +140,7 @@
 		do {
 			n = read(comfd, buf+off, toread);
 			if (n = 0) {
-fprintf(stderr, writeshovel read %d / %d\n,
+fprintf(stderr, writeshovel read %zd / %d\n,
 n, errno);
 break;
 			}
@@ -153,7 +153,7 @@
 
 		n = rump_sys_write(puffsfd, buf, phdr-pth_framelen);
 		if ((size_t)n != phdr-pth_framelen) {
-			fprintf(stderr, writeshovel wr %d / %d\n, n, errno);
+			fprintf(stderr, writeshovel wr %zd / %d\n, n, errno);
 			break;
 		}
 	}



CVS commit: src/tests/fs/common

2010-10-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Oct 31 22:05:35 UTC 2010

Modified Files:
src/tests/fs/common: fstest_puffs.c

Log Message:
Since rump implicit threads now bind to proc1 instead of proc0, we
need our shovel threads bound to proc1 instead of proc0 in order
to have access to the same set of descriptors as the implicit thread
which opens the fd in the rump kernel.

Also, sprinkle some printfs and make failure more dramatic.

fixes the puffs tests.  pointed out by pgoyette.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/common/fstest_puffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common

2010-10-31 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Oct 31 22:33:16 UTC 2010

Modified Files:
src/tests/fs/common: fstest_puffs.c

Log Message:
Fix format strings so it builds on amd64


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/common/fstest_puffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/fs/common/nfsrpc

2010-09-23 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Thu Sep 23 09:38:14 UTC 2010

Modified Files:
src/tests/fs/common/nfsrpc: clnt_bcast.c namespace.h rpc_generic.c
rpcb_clnt.c svc.c svc_dg.c svc_vc.c

Log Message:
Do symbol renaming for these bits as well, so that we don't get
link-time errors caused by conflicts with normal user-space libraries
when we link statically.

The tests still pass for i386 after this set of changes, and this now
builds for sun2 (after a few more changes).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/common/nfsrpc/clnt_bcast.c \
src/tests/fs/common/nfsrpc/namespace.h \
src/tests/fs/common/nfsrpc/rpc_generic.c \
src/tests/fs/common/nfsrpc/rpcb_clnt.c \
src/tests/fs/common/nfsrpc/svc_dg.c
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/common/nfsrpc/svc.c
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/common/nfsrpc/svc_vc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/common/nfsrpc/clnt_bcast.c
diff -u src/tests/fs/common/nfsrpc/clnt_bcast.c:1.1 src/tests/fs/common/nfsrpc/clnt_bcast.c:1.2
--- src/tests/fs/common/nfsrpc/clnt_bcast.c:1.1	Mon Jul 26 15:56:45 2010
+++ src/tests/fs/common/nfsrpc/clnt_bcast.c	Thu Sep 23 09:38:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: clnt_bcast.c,v 1.1 2010/07/26 15:56:45 pooka Exp $	*/
+/*	$NetBSD: clnt_bcast.c,v 1.2 2010/09/23 09:38:14 he Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = @(#)clnt_bcast.c 1.15 89/04/21 Copyr 1988 Sun Micro;
 #else
-__RCSID($NetBSD: clnt_bcast.c,v 1.1 2010/07/26 15:56:45 pooka Exp $);
+__RCSID($NetBSD: clnt_bcast.c,v 1.2 2010/09/23 09:38:14 he Exp $);
 #endif
 #endif
 
@@ -113,6 +113,11 @@
  * also here it will get two responses ... inefficient and clumsy.
  */
 
+#ifdef __weak_alias
+__weak_alias(rpc_broadcast_exp,_rpc_broadcast_exp)
+__weak_alias(rpc_broadcast,_rpc_broadcast)
+#endif
+
 struct broadif {
 	int index;
 	struct sockaddr_storage broadaddr;
Index: src/tests/fs/common/nfsrpc/namespace.h
diff -u src/tests/fs/common/nfsrpc/namespace.h:1.1 src/tests/fs/common/nfsrpc/namespace.h:1.2
--- src/tests/fs/common/nfsrpc/namespace.h:1.1	Mon Jul 26 15:56:45 2010
+++ src/tests/fs/common/nfsrpc/namespace.h	Thu Sep 23 09:38:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: namespace.h,v 1.1 2010/07/26 15:56:45 pooka Exp $	*/
+/*	$NetBSD: namespace.h,v 1.2 2010/09/23 09:38:14 he Exp $	*/
 
 /*-
  * Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
@@ -52,4 +52,40 @@
 #define svcraw_lock		__rpc_svcraw_lock
 #define xprtlist_lock		__rpc_xprtlist_lock
 
+/* NFS server stuff */
+#define svc_dg_create		_svc_dg_create
+
+#define rpc_broadcast		_rpc_broadcast
+#define rpc_broadcast_exp	_rpc_broadcast_exp
+
+#define svc_fd_create		_svc_fd_create
+#define svc_vc_create		_svc_vc_create
+#define svc_getreq  _svc_getreq
+#define svc_getreqset   _svc_getreqset
+#define svc_getreq_common   _svc_getreq_common
+#define svc_register_svc_register
+#define svc_reg _svc_reg
+#define svc_unreg   _svc_unreg
+#define svc_sendreply   _svc_sendreply
+#define svc_unregister  _svc_unregister
+#define svcerr_auth _svcerr_auth
+#define svcerr_decode   _svcerr_decode
+#define svcerr_noproc   _svcerr_noproc
+#define svcerr_noprog   _svcerr_noprog
+#define svcerr_progvers _svcerr_progvers
+#define svcerr_systemerr_svcerr_systemerr
+#define svcerr_weakauth _svcerr_weakauth
+#define xprt_register   _xprt_register
+#define xprt_unregister _xprt_unregister
+#define rpc_control _rpc_control
+
+#define taddr2uaddr		_taddr2uaddr
+#define uaddr2taddr		_uaddr2taddr
+
+#define rpcb_set		_rpcb_set
+#define rpcb_unset		_rpcb_unset
+#define rpcb_getmaps		_rpcb_getmaps
+#define rpcb_taddr2uaddr	_rpcb_taddr2uaddr
+#define rpcb_uaddr2taddr	_rpcb_uaddr2taddr
+
 #endif /* _NAMESPACE_H_ */
Index: src/tests/fs/common/nfsrpc/rpc_generic.c
diff -u src/tests/fs/common/nfsrpc/rpc_generic.c:1.1 src/tests/fs/common/nfsrpc/rpc_generic.c:1.2
--- src/tests/fs/common/nfsrpc/rpc_generic.c:1.1	Mon Jul 26 15:56:45 2010
+++ src/tests/fs/common/nfsrpc/rpc_generic.c	Thu Sep 23 09:38:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rpc_generic.c,v 1.1 2010/07/26 15:56:45 pooka Exp $	*/
+/*	$NetBSD: rpc_generic.c,v 1.2 2010/09/23 09:38:14 he Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -41,7 +41,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: rpc_generic.c,v 1.1 2010/07/26 15:56:45 pooka Exp $);
+__RCSID($NetBSD: rpc_generic.c,v 1.2 2010/09/23 09:38:14 he Exp $);
 #endif
 
 #include namespace.h
@@ -69,6 +69,11 @@
 #include rump/rump.h
 #include rump/rump_syscalls.h
 
+#ifdef __weak_alias
+__weak_alias(taddr2uaddr,_taddr2uaddr)

  1   2   >