Module Name: src Committed By: alnsn Date: Mon Sep 3 21:27:14 UTC 2012
Modified Files: src/tests/net/bpfilter: t_bpfilter.c Log Message: Fix test timeout. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/net/bpfilter/t_bpfilter.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/net/bpfilter/t_bpfilter.c diff -u src/tests/net/bpfilter/t_bpfilter.c:1.5 src/tests/net/bpfilter/t_bpfilter.c:1.6 --- src/tests/net/bpfilter/t_bpfilter.c:1.5 Fri Aug 31 04:02:21 2012 +++ src/tests/net/bpfilter/t_bpfilter.c Mon Sep 3 21:27:14 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: t_bpfilter.c,v 1.5 2012/08/31 04:02:21 pgoyette Exp $ */ +/* $NetBSD: t_bpfilter.c,v 1.6 2012/09/03 21:27:14 alnsn Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -25,7 +25,7 @@ * SUCH DAMAGE. */ #include <sys/cdefs.h> -__RCSID("$NetBSD: t_bpfilter.c,v 1.5 2012/08/31 04:02:21 pgoyette Exp $"); +__RCSID("$NetBSD: t_bpfilter.c,v 1.6 2012/09/03 21:27:14 alnsn Exp $"); #include <sys/param.h> #include <sys/ioctl.h> @@ -199,7 +199,6 @@ magic_ping_test(const char *name, unsign char *buf; pid_t child; int bpfd; - int status; char token; int channel[2]; @@ -219,10 +218,10 @@ magic_ping_test(const char *name, unsign atf_tc_fail_errno("fork failed"); case 0: netcfg_rump_if(ifr.ifr_name, "10.1.1.10", "255.0.0.0"); - ATF_CHECK(write(channel[1], "U", 1) == 1); - ATF_CHECK(read(channel[0], &token, 1) == 1 && token == 'D'); close(channel[0]); + ATF_CHECK(write(channel[1], "U", 1) == 1); close(channel[1]); + pause(); return; default: break; @@ -240,6 +239,7 @@ magic_ping_test(const char *name, unsign RL(rump_sys_ioctl(bpfd, BIOCSETF, &prog)); RL(rump_sys_ioctl(bpfd, BIOCSETIF, &ifr)); + close(channel[1]); ATF_CHECK(read(channel[0], &token, 1) == 1 && token == 'U'); pinged = pingtest("10.1.1.10", wirelen, magic_echo_reply_tail); @@ -261,13 +261,9 @@ magic_ping_test(const char *name, unsign rump_sys_close(bpfd); free(buf); - ATF_CHECK(write(channel[1], "D", 1) == 1); - close(channel[0]); - close(channel[1]); - RL(waitpid(child, &status, 0)); - ATF_CHECK(!WIFSIGNALED(status)); + kill(child, SIGKILL); } ATF_TC(bpfiltercontig);