summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/include/t_paths.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/netbsd-tests/include/t_paths.c')
-rw-r--r--contrib/netbsd-tests/include/t_paths.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/contrib/netbsd-tests/include/t_paths.c b/contrib/netbsd-tests/include/t_paths.c
index 653a70b..52a150e 100644
--- a/contrib/netbsd-tests/include/t_paths.c
+++ b/contrib/netbsd-tests/include/t_paths.c
@@ -1,4 +1,4 @@
-/* $NetBSD: t_paths.c,v 1.14 2014/11/04 00:20:19 justin Exp $ */
+/* $NetBSD: t_paths.c,v 1.16 2015/05/07 06:23:23 pgoyette Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_paths.c,v 1.14 2014/11/04 00:20:19 justin Exp $");
+__RCSID("$NetBSD: t_paths.c,v 1.16 2015/05/07 06:23:23 pgoyette Exp $");
#include <sys/param.h>
#include <sys/stat.h>
@@ -47,6 +47,7 @@ __RCSID("$NetBSD: t_paths.c,v 1.14 2014/11/04 00:20:19 justin Exp $");
#define PATH_DIR __BIT(1) /* A directory */
#define PATH_FILE __BIT(2) /* A file */
#define PATH_ROOT __BIT(3) /* Access for root only */
+#define PATH_OPT __BIT(3) /* Optional, ENODEV if not supported */
static const struct {
const char *path;
@@ -82,7 +83,7 @@ static const struct {
{ _PATH_MIXER, PATH_DEV },
{ _PATH_MIXER0, PATH_DEV },
{ _PATH_NOLOGIN, PATH_FILE },
- { _PATH_POWER, PATH_DEV | PATH_ROOT },
+ { _PATH_POWER, PATH_DEV | PATH_ROOT | PATH_OPT },
{ _PATH_PRINTCAP, PATH_FILE },
{ _PATH_PUD, PATH_DEV | PATH_ROOT },
{ _PATH_PUFFS, PATH_DEV | PATH_ROOT },
@@ -92,12 +93,13 @@ static const struct {
{ _PATH_SKEYKEYS, PATH_FILE | PATH_ROOT },
{ _PATH_SOUND, PATH_DEV },
{ _PATH_SOUND0, PATH_DEV },
- { _PATH_SYSMON, PATH_DEV },
+ { _PATH_SYSMON, PATH_DEV | PATH_OPT },
{ _PATH_TTY, PATH_DEV },
{ _PATH_UNIX, PATH_FILE | PATH_ROOT },
{ _PATH_URANDOM, PATH_DEV },
{ _PATH_VIDEO, PATH_DEV },
{ _PATH_VIDEO0, PATH_DEV },
+ { _PATH_WATCHDOG, PATH_DEV | PATH_OPT },
{ _PATH_DEV, PATH_DIR },
{ _PATH_DEV_PTS, PATH_DIR },
@@ -143,13 +145,22 @@ ATF_TC_BODY(paths, tc)
switch (errno) {
+ case ENODEV:
+ if ((paths[i].flags & PATH_OPT) == 0) {
+
+ atf_tc_fail("Required path %s does "
+ "not exist", paths[i].path);
+ }
+ break;
+
case EPERM: /* FALLTHROUGH */
case EACCES: /* FALLTHROUGH */
if ((paths[i].flags & PATH_ROOT) == 0) {
- atf_tc_fail("UID %u failed to open %s",
- (uint32_t)uid, paths[i].path);
+ atf_tc_fail("UID %u failed to open %s, "
+ "error %d", (uint32_t)uid,
+ paths[i].path, errno);
}
case EBUSY: /* FALLTHROUGH */
OpenPOWER on IntegriCloud