Source-Changes-HG archive

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

[src/trunk]: src/tests/fs/tmpfs Skip instead of fail test if tmpfs cannot be ...



details:   https://anonhg.NetBSD.org/src/rev/fd36df021e6f
branches:  trunk
changeset: 762457:fd36df021e6f
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Feb 21 10:14:29 2011 +0000

description:
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)

diffstat:

 tests/fs/tmpfs/h_funcs.subr |  22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diffs (38 lines):

diff -r 60d28d3dc806 -r fd36df021e6f tests/fs/tmpfs/h_funcs.subr
--- a/tests/fs/tmpfs/h_funcs.subr       Mon Feb 21 09:53:06 2011 +0000
+++ b/tests/fs/tmpfs/h_funcs.subr       Mon Feb 21 10:14:29 2011 +0000
@@ -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}
 }



Home | Main Index | Thread Index | Old Index