Module Name:    src
Committed By:   pooka
Date:           Mon Feb 21 10:14:29 UTC 2011

Modified Files:
        src/tests/fs/tmpfs: h_funcs.subr

Log Message:
Skip instead of fail test if tmpfs cannot be mounted and the
error is "Operation not supported".

makes the tmpfs tests produce a sensible result on platforms where
tmpfs is not available (such as the hpc* test runs)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/tmpfs/h_funcs.subr

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/tmpfs/h_funcs.subr
diff -u src/tests/fs/tmpfs/h_funcs.subr:1.3 src/tests/fs/tmpfs/h_funcs.subr:1.4
--- src/tests/fs/tmpfs/h_funcs.subr:1.3	Mon Jan 19 07:15:46 2009
+++ src/tests/fs/tmpfs/h_funcs.subr	Mon Feb 21 10:14:29 2011
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: h_funcs.subr,v 1.3 2009/01/19 07:15:46 jmmv Exp $
+# $NetBSD: h_funcs.subr,v 1.4 2011/02/21 10:14:29 pooka Exp $
 #
 # Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -42,11 +42,21 @@
 	Mount_Point=$(pwd)/mntpt
 	atf_check -s eq:0 -o empty -e empty mkdir ${Mount_Point}
 	if [ $# -gt 0 ]; then
-		atf_check -s eq:0 -o empty -e empty \
-		    mount -t tmpfs $* tmpfs ${Mount_Point}
-	else
-		atf_check -s eq:0 -o empty -e empty \
-		    mount -t tmpfs tmpfs ${Mount_Point}
+		mount -t tmpfs $* tmpfs ${Mount_Point} 2> mounterr
+		if [ $? -ne 0 ]; then
+			if grep 'Operation not supp' mounterr > /dev/null ; then
+				atf_skip "tmpfs not supported"
+			fi 
+			atf_fail "mount tmpfs"
+		fi
+        else
+		mount -t tmpfs tmpfs ${Mount_Point} 2> mounterr
+		if [ $? -ne 0 ]; then
+			if grep 'Operation not supp' mounterr > /dev/null ; then
+				atf_skip "tmpfs not supported"
+			fi 
+			atf_fail "mount tmpfs"
+		fi
 	fi
 	cd ${Mount_Point}
 }

Reply via email to