Source-Changes-HG archive

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

[src/trunk]: src/tests/fs/ptyfs Fix test: we need to mount /dev/pts to /null/...



details:   https://anonhg.NetBSD.org/src/rev/7affc52fde7e
branches:  trunk
changeset: 755687:7affc52fde7e
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Jun 16 15:57:11 2010 +0000

description:
Fix test: we need to mount /dev/pts to /null/dev/pts, not /dev to
/null/dev: we're interested in /dev/pts and nullfs doesn't traverse
underlying mountpoints.

(I had code for nullfs mountpoint traversal in the tree i used to
test this originally... but I assume the rest of the world doesn't.
Before this change the test would still fail, but fail in the wrong
place and due to the wrong reason.)

diffstat:

 tests/fs/ptyfs/t_nullpts.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r d4445f46f029 -r 7affc52fde7e tests/fs/ptyfs/t_nullpts.c
--- a/tests/fs/ptyfs/t_nullpts.c        Wed Jun 16 15:39:41 2010 +0000
+++ b/tests/fs/ptyfs/t_nullpts.c        Wed Jun 16 15:57:11 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_nullpts.c,v 1.2 2010/06/16 15:39:41 pooka Exp $      */
+/*     $NetBSD: t_nullpts.c,v 1.3 2010/06/16 15:57:11 pooka Exp $      */
 
 #include <sys/types.h>
 #include <sys/mount.h>
@@ -77,13 +77,18 @@
        mountptyfs("/dev/pts", 0);
 
        /*
-        * null mount /dev to /null/dev
+        * null mount /dev/pts to /null/dev/pts
         */
        if (rump_sys_mkdir("/null", 0777) == -1) {
                if (errno != EEXIST)
                        atf_tc_fail_errno("null create /null");
        }
-       mountnull("/dev", "/null/dev", 0);
+       if (rump_sys_mkdir("/null/dev", 0777) == -1) {
+               if (errno != EEXIST)
+                       atf_tc_fail_errno("null create /null/dev");
+       }
+
+       mountnull("/dev/pts", "/null/dev/pts", 0);
 
        /*
         * get slave/master pair.
@@ -95,7 +100,7 @@
        /*
         * Build nullfs path to slave.
         */
-       strcpy(path, "/null/");
+       strcpy(path, "/null");
        strcat(path, ptg.sn);
 
        /*



Home | Main Index | Thread Index | Old Index