Source-Changes-HG archive

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

[src/trunk]: src/tests/net add test for PR kern/44369



details:   https://anonhg.NetBSD.org/src/rev/23622f7c8ed1
branches:  trunk
changeset: 760704:23622f7c8ed1
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Jan 11 10:51:45 2011 +0000

description:
add test for PR kern/44369

diffstat:

 tests/net/Makefile     |   4 ++--
 tests/net/net/Makefile |  13 +++++++++++++
 tests/net/net/t_raw.c  |  41 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 56 insertions(+), 2 deletions(-)

diffs (77 lines):

diff -r 799643342b42 -r 23622f7c8ed1 tests/net/Makefile
--- a/tests/net/Makefile        Tue Jan 11 10:49:20 2011 +0000
+++ b/tests/net/Makefile        Tue Jan 11 10:51:45 2011 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.7 2010/11/07 19:53:42 pooka Exp $
+# $NetBSD: Makefile,v 1.8 2011/01/11 10:51:45 pooka Exp $
 
 .include <bsd.own.mk>
 
 TESTSDIR=      ${TESTSBASE}/net
 
-TESTS_SUBDIRS=         bpf carp icmp if if_loop sys
+TESTS_SUBDIRS=         bpf carp icmp if if_loop net sys
 
 .include <bsd.test.mk>
diff -r 799643342b42 -r 23622f7c8ed1 tests/net/net/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/net/net/Makefile    Tue Jan 11 10:51:45 2011 +0000
@@ -0,0 +1,13 @@
+# $NetBSD: Makefile,v 1.1 2011/01/11 10:51:45 pooka Exp $
+#
+
+.include <bsd.own.mk>
+
+TESTSDIR=      ${TESTSBASE}/net/net
+
+TESTS_C=       t_raw
+
+LDADD+=                -lrumpnet_local -lrumpnet_netinet -lrumpnet_net -lrumpnet
+LDADD+=                -lrumpvfs -lrump -lrumpuser -lpthread
+
+.include <bsd.test.mk>
diff -r 799643342b42 -r 23622f7c8ed1 tests/net/net/t_raw.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/net/net/t_raw.c     Tue Jan 11 10:51:45 2011 +0000
@@ -0,0 +1,41 @@
+/*     $NetBSD: t_raw.c,v 1.1 2011/01/11 10:51:45 pooka Exp $  */
+
+#include <sys/socket.h>
+#include <sys/stat.h>
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <atf-c.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(PRU_SENSE);
+ATF_TC_HEAD(PRU_SENSE, tc)
+{
+
+       atf_tc_set_md_var(tc, "descr", "Biglock leak with PRU_SENSE on "
+           "raw sockets (PR kern/44369)");
+}
+
+ATF_TC_BODY(PRU_SENSE, tc)
+{
+       struct stat sb;
+       int s;
+
+       rump_init();
+       RL(s = rump_sys_socket(PF_ROUTE, SOCK_RAW, 0));
+       /* call PRU_SENSE.  unfixed bug causes panic in rump_unschedule() */
+       RL(rump_sys_fstat(s, &sb));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+       ATF_TP_ADD_TC(tp, PRU_SENSE);
+       return atf_no_error();
+}



Home | Main Index | Thread Index | Old Index