Source-Changes-HG archive

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

[src/trunk]: src/tests/fs/vfs symlink to a zero-len target (and watch tmpfs g...



details:   https://anonhg.NetBSD.org/src/rev/223850c4bdfb
branches:  trunk
changeset: 757575:223850c4bdfb
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Sep 06 15:21:34 2010 +0000

description:
symlink to a zero-len target (and watch tmpfs go kabloom)

diffstat:

 tests/fs/vfs/t_vnops.c |  19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diffs (54 lines):

diff -r eaa2b0303ca4 -r 223850c4bdfb tests/fs/vfs/t_vnops.c
--- a/tests/fs/vfs/t_vnops.c    Mon Sep 06 15:07:33 2010 +0000
+++ b/tests/fs/vfs/t_vnops.c    Mon Sep 06 15:21:34 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_vnops.c,v 1.6 2010/08/01 14:50:54 mlelstv Exp $      */
+/*     $NetBSD: t_vnops.c,v 1.7 2010/09/06 15:21:34 pooka Exp $        */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -44,6 +44,10 @@
 #define USES_DIRS \
     if (FSTYPE_SYSVBFS(tc)) atf_tc_skip("dirs not supported by file system")
 
+#define USES_SYMLINKS                                  \
+    if (FSTYPE_SYSVBFS(tc) || FSTYPE_MSDOS(tc))                \
+       atf_tc_skip("dirs not supported by file system")
+
 static char *
 md(char *buf, const char *base, const char *tail)
 {
@@ -438,6 +442,17 @@
        rump_sys_chdir("/");
 }
 
+static void
+symlink_zerolen(const atf_tc_t *tc, const char *mp)
+{
+
+       USES_SYMLINKS;
+
+       RL(rump_sys_chdir(mp));
+       RL(rump_sys_symlink("", "afile"));
+       RL(rump_sys_chdir("/"));
+}
+
 ATF_TC_FSAPPLY(lookup_simple, "simple lookup (./.. on root)");
 ATF_TC_FSAPPLY(lookup_complex, "lookup of non-dot entries");
 ATF_TC_FSAPPLY(dir_simple, "mkdir/rmdir");
@@ -447,6 +462,7 @@
 ATF_TC_FSAPPLY(rename_reg_nodir, "rename regular files, no subdirectories");
 ATF_TC_FSAPPLY(create_nametoolong, "create file with name too long");
 ATF_TC_FSAPPLY(rename_nametoolong, "rename to file with name too long");
+ATF_TC_FSAPPLY(symlink_zerolen, "symlink with 0-len target");
 
 ATF_TP_ADD_TCS(tp)
 {
@@ -460,6 +476,7 @@
        ATF_TP_FSAPPLY(rename_reg_nodir);
        ATF_TP_FSAPPLY(create_nametoolong);
        ATF_TP_FSAPPLY(rename_nametoolong);
+       ATF_TP_FSAPPLY(symlink_zerolen);
 
        return atf_no_error();
 }



Home | Main Index | Thread Index | Old Index