Module Name:    src
Committed By:   pooka
Date:           Tue Nov 30 18:14:38 UTC 2010

Modified Files:
        src/tests/rump/rumpvfs: t_etfs.c

Log Message:
check etfs key rules


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/rump/rumpvfs/t_etfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/rump/rumpvfs/t_etfs.c
diff -u src/tests/rump/rumpvfs/t_etfs.c:1.7 src/tests/rump/rumpvfs/t_etfs.c:1.8
--- src/tests/rump/rumpvfs/t_etfs.c:1.7	Sun Nov  7 17:51:21 2010
+++ src/tests/rump/rumpvfs/t_etfs.c	Tue Nov 30 18:14:38 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_etfs.c,v 1.7 2010/11/07 17:51:21 jmmv Exp $	*/
+/*	$NetBSD: t_etfs.c,v 1.8 2010/11/30 18:14:38 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -253,6 +253,37 @@
 	ATF_REQUIRE_EQ(memcmp(buf, cmpbuf, sizeof(buf)), 0);
 }
 
+ATF_TC(key);
+ATF_TC_HEAD(key, tc)
+{
+
+	atf_tc_set_md_var(tc, "descr", "Checks key format");
+}
+
+ATF_TC_BODY(key, tc)
+{
+
+	RZ(rump_init());
+
+	RL(open("hostfile", O_RDWR | O_CREAT, 0777));
+
+	RZ(rump_pub_etfs_register("/key", "hostfile", RUMP_ETFS_REG));
+	ATF_REQUIRE_EQ(rump_pub_etfs_register("key", "hostfile", RUMP_ETFS_REG),
+	    EINVAL);
+
+	RL(rump_sys_open("/key", O_RDONLY));
+	RL(rump_sys_open("////////key", O_RDONLY));
+
+	RZ(rump_pub_etfs_register("////key//with/slashes", "hostfile",
+	    RUMP_ETFS_REG));
+
+	RL(rump_sys_open("/key//with/slashes", O_RDONLY));
+	RL(rump_sys_open("key//with/slashes", O_RDONLY));
+
+	ATF_REQUIRE_ERRNO(ENOENT,
+	    rump_sys_open("/key/with/slashes", O_RDONLY) == -1);
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 
@@ -260,6 +291,7 @@
 	ATF_TP_ADD_TC(tp, reregister_blk);
 	ATF_TP_ADD_TC(tp, large_blk);
 	ATF_TP_ADD_TC(tp, range_blk);
+	ATF_TP_ADD_TC(tp, key);
 
 	return atf_no_error();
 }

Reply via email to