From owner-svn-src-all@FreeBSD.ORG Wed Sep 26 01:11:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5DF14106564A; Wed, 26 Sep 2012 01:11:30 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id DCBF08FC0C; Wed, 26 Sep 2012 01:11:28 +0000 (UTC) Received: by obcwo10 with SMTP id wo10so73211obc.13 for ; Tue, 25 Sep 2012 18:11:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=U+Vd+rgX5XSEyi6PeMHDTWzAyf0d2hLUoqNcoP6/JLU=; b=gwk5Znb7ZLL7Cwe1vkJL3R/Z2sUJXkFOQZ2cp+kECa7fWDJhx1bA8Ba5AAL6YpYAGg xfoTLCEpd1fJh8iIasF4zS7WrMkgmiQbyDsgEHHXz5YPGuTsxM6WZh3o/nGMrQYdfia2 C2/tb8UZQAUTRaCQ+XuoHY2S8CAUBvGSDDHhXWenmpGsXcJVJVk9tPa9pP6079HieTH5 qILFhOgpIZpgERtxcXRjsljwGmuNBg4nOrikJQFhN3HNQy8o6eAZSKlZiERqeaiZm8BK 7NnsoPGuq1FKlXsHy5Q2ERkXj04+qrUGJWBlrpe8mv/ZOTS81/DO54MGUNQcXf/DvGPA i3BQ== MIME-Version: 1.0 Received: by 10.182.218.37 with SMTP id pd5mr13937943obc.24.1348621887677; Tue, 25 Sep 2012 18:11:27 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Tue, 25 Sep 2012 18:11:27 -0700 (PDT) In-Reply-To: <201209260025.q8Q0PAp0021186@svn.freebsd.org> References: <201209260025.q8Q0PAp0021186@svn.freebsd.org> Date: Tue, 25 Sep 2012 18:11:27 -0700 Message-ID: From: Garrett Cooper To: Ed Maste Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240944 - in head/tools/regression/net: . if_tap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2012 01:11:30 -0000 On Tue, Sep 25, 2012 at 5:25 PM, Ed Maste wrote: > Author: emaste > Date: Wed Sep 26 00:25:09 2012 > New Revision: 240944 > URL: http://svn.freebsd.org/changeset/base/240944 > > Log: > Add regression test for kern/172075. > > Sponsored by: ADARA Networks > PR: kern/172075 > > Added: > head/tools/regression/net/ > head/tools/regression/net/if_tap/ > head/tools/regression/net/if_tap/test-tap.sh (contents, props changed) > > Added: head/tools/regression/net/if_tap/test-tap.sh > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/regression/net/if_tap/test-tap.sh Wed Sep 26 00:25:09 2012 (r240944) > @@ -0,0 +1,59 @@ > +#!/bin/sh > + > +# Copyright (C) 2012 ADARA Networks. All rights reserved. > +# > +# Redistribution and use in source and binary forms, with or without > +# modification, are permitted provided that the following conditions > +# are met: > +# 1. Redistributions of source code must retain the above copyright > +# notice, this list of conditions and the following disclaimer. > +# 2. Redistributions in binary form must reproduce the above copyright > +# notice, this list of conditions and the following disclaimer in the > +# documentation and/or other materials provided with the distribution. > +# > +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > +# SUCH DAMAGE. > +# > +# $FreeBSD$ > + > +tap_exists() > +{ > + ls -1 /dev | grep -q "$1" > +} > + > +if [ $(id -u) -ne 0 ]; then > + echo "Must be root" >&2 > + exit 1 > +fi > + > +set -e > + > +# Base case create & destroy > +tap=$(ifconfig tap create) > +tap_exists $tap > +ifconfig $tap destroy > +! tap_exists $tap > + > +# kern/172075: INVARIANTS kernel panicked when destroying an in-use tap(4) > +# Fixed in HEAD r240938. > +tap=$(ifconfig tap create) > +tap_exists $tap > +cat /dev/$tap > /dev/null & > +catpid=$! > +sleep 0.1 > +ifconfig $tap destroy & > +sleep 0.1 > +kill $catpid > +! tap_exists $tap > + > +echo PASS > +exit 0 This test is technically only valid if sysctl kern.features.invariant_support == 1, right? Thanks! -Garrett