From owner-freebsd-testing@FreeBSD.ORG Wed Mar 5 17:08:51 2014 Return-Path: Delivered-To: freebsd-testing@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4170774 for ; Wed, 5 Mar 2014 17:08:51 +0000 (UTC) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [IPv6:2a00:1450:400c:c00::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7E9B0213 for ; Wed, 5 Mar 2014 17:08:51 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id k14so1613279wgh.35 for ; Wed, 05 Mar 2014 09:08:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=7cOYvuLcfObZxd4eyE0heX94iEAzV0lVBbH7ajA8nVg=; b=AhiA3IUBqjyDXO6dYb98G1BDRE3a4RA/mwOTnQGISlrMv7RrzAKxWteR6wJWNLA2hs I1iIJCYhHvoKbKsRjr+D8LGzs9gQALlEZl4SiSI8VjFR59PzaAYYoo3s9Jdy7OOfO6VI hlcon5JKJTNn34JzM6Ugnx0zrYEh4u0AiSCvGGdZW3OK3WIq4WnG7PR6QBCCShAnfGI0 ylX5lKUqElKjNB3x6vO17Fg/yIcPo8d1cXeEyFbNioWaVnSWSyBTeWEpU9YWbDl9on6E ZQ5/yIpoISEQketTJJoAdY8rqvlWJhY2mqGK9cugFecygzL56J+7Yj8/tSzGI8rCIobJ YqSA== MIME-Version: 1.0 X-Received: by 10.194.75.225 with SMTP id f1mr2464962wjw.87.1394039329917; Wed, 05 Mar 2014 09:08:49 -0800 (PST) Sender: asomers@gmail.com Received: by 10.194.168.197 with HTTP; Wed, 5 Mar 2014 09:08:49 -0800 (PST) In-Reply-To: <20140305085806.GA70478@x2.osted.lan> References: <20140305085806.GA70478@x2.osted.lan> Date: Wed, 5 Mar 2014 10:08:49 -0700 X-Google-Sender-Auth: J4LZUrv0g50Qz89efc2zMcb4OPQ Message-ID: Subject: Re: Test scenario for sysctl kern.maxfiles From: Alan Somers To: Peter Holm Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-testing@freebsd.org" X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 17:08:52 -0000 On Wed, Mar 5, 2014 at 1:58 AM, Peter Holm wrote: > Here's an attempt to verify that increasing kern.maxfiles works as > expected. > > http://people.freebsd.org/~pho/kern_descrip_test-v3.diff > -- > Peter 1) done should be of type "static volatile sig_atomic_t", not int, because it's set by signal handlers. 2) using atexit() to register a cleanup routing is a hack. No doubt you already noticed that it's difficult to use Kyua's builtin cleanup capabilities because of the need to pass the value of oldmaxfiles. I too have experienced that frustration. Is there any way to pass values from the body of a testcase to its cleanup? Using atf_tc_set_md_var() would be one way, but the man page suggests that that function cannot be called from the body. Julio, is there a better way to do this? 3) Why do you openfiles(oldmaxfiles + 50, 0) instead of just openfiles(oldmaxfiles) ? It seems that the latter would also verify the assertion. 4) openfiles(oldmaxfiles + 50, 0) will fail if there are already 950 open files. A quick check on freefall showed that kern.openfiles was 935. Perhaps you should try opening openfiles(oldmaxfiles - kern.openfiles + 50, 0). That wouldn't be perfect, due to races, but it would be better. -Alan