From 4c4df11b4bf5b8afc5f1c405d2ff9c1894db4933 Mon Sep 17 00:00:00 2001 From: pooka Date: Wed, 16 Jun 2010 15:57:11 +0000 Subject: [PATCH] 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.) --- tests/fs/ptyfs/t_nullpts.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/fs/ptyfs/t_nullpts.c b/tests/fs/ptyfs/t_nullpts.c index 558ab0dabbc7..0e7a5107918b 100644 --- a/tests/fs/ptyfs/t_nullpts.c +++ b/tests/fs/ptyfs/t_nullpts.c @@ -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 #include @@ -77,13 +77,18 @@ ATF_TC_BODY(nullrevoke, tc) 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 @@ ATF_TC_BODY(nullrevoke, tc) /* * Build nullfs path to slave. */ - strcpy(path, "/null/"); + strcpy(path, "/null"); strcat(path, ptg.sn); /*