From owner-freebsd-testing@FreeBSD.ORG Thu Mar 13 02:10:17 2014 Return-Path: Delivered-To: freebsd-testing@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C868644 for ; Thu, 13 Mar 2014 02:10:17 +0000 (UTC) Received: from mail-qg0-f45.google.com (mail-qg0-f45.google.com [209.85.192.45]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB34B277 for ; Thu, 13 Mar 2014 02:10:16 +0000 (UTC) Received: by mail-qg0-f45.google.com with SMTP id j5so1150919qga.4 for ; Wed, 12 Mar 2014 19:10:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=q/BtDfJxpqHbPvmhqBaUlMmTyo/JUBbCNUEkNv/IpZo=; b=Rtay8WfU3pRQYhi3vImm56NzR9OopU6EPXSuoaeEJ1NBAWhb2z3G41WaiHR0UFddVR CIxFUm3t3U664Q3L5Lfu1IkD3QKHMHOw9E6TE4vwxAv7ZR+8crl5cOuIJzQyPPGsOV5T HF9yMIoC+Xz+qMZ6xb+r3YO8RcJIRfiw3UfqXdFQePR34opdVPDfxYegTEuaSN//B0ah qmumcn7UP+j7ZwqtMZD61jrgVsulEfzSriM7ha0d1PtUUwyvxE3yoVlSyuLzp4YCcLFh UtUwRyDfW7UYsq5WWtbLtAg+tUNADvCjDDXv3SUC8azmEVeTdhEExMvzSvwpF/Fp5jaZ +UMg== X-Gm-Message-State: ALoCoQmVf65b6Z8xIHAakQ97Dn/sEmz4LzBAOAT15zOJbtGYBI8XEH9olY0XoVLYvm7luSa+WwsE X-Received: by 10.140.29.139 with SMTP id b11mr888510qgb.48.1394676615975; Wed, 12 Mar 2014 19:10:15 -0700 (PDT) MIME-Version: 1.0 Sender: jmmv@meroh.net Received: by 10.96.83.102 with HTTP; Wed, 12 Mar 2014 19:09:55 -0700 (PDT) X-Originating-IP: [2401:fa00:4:1012:5cf9:3224:4bc7:7478] In-Reply-To: References: From: Julio Merino Date: Thu, 13 Mar 2014 11:09:55 +0900 X-Google-Sender-Auth: UWiAaa86iKh-9Ep5USoQwmlfRuc Message-ID: Subject: Re: Structure of ATF testcases (was "Test scenario for sysctl kern.maxfiles") To: Garrett Cooper Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-testing@freebsd.org" , kyua-discuss@googlegroups.com 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: Thu, 13 Mar 2014 02:10:17 -0000 On Fri, Mar 7, 2014 at 5:02 AM, Garrett Cooper wrote: > On Thu, Mar 6, 2014 at 11:54 AM, Julio Merino wrote: >> On Thu, Mar 6, 2014 at 1:28 PM, Garrett Cooper wrote: >>> >>> Seems like another standalone tool should be developed to cleanup >>> variables after exit per test and per test suite. >> >> Which variables? > > sysctls in this case. Isilon would probably love this and other folks > would too no doubt. Writing such support shouldn't be too hard. I can imagine a sysctl(8) wrapper stored in the test's work directory, put in the PATH, so that it captured all variables written to from the test. All this could be set up by a "sysctl-test setup" script or similar. This script would record the old values in a separate file within the work directory. Later, in the cleanup phase, you'd invoke a "sysctl-test cleanup" script that read the list of overridden variables and restored their previous values. We can easily do this as a FreeBSD-specific thingy for now and put it in the source tree. I think it'd be a good way to test the idea this way. We could generalize it into ATF later on, but adding hooks for sysctl is nasty for portability reasons...