From owner-freebsd-testing@FreeBSD.ORG Tue Jan 14 20:26:33 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 DEE17E8C for ; Tue, 14 Jan 2014 20:26:32 +0000 (UTC) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 71B011583 for ; Tue, 14 Jan 2014 20:26:32 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id g10so3193727wiw.1 for ; Tue, 14 Jan 2014 12:26:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=iQrCKy4PXhOHw9TbgZn0Za0Qz2IDdMi2p+A0JCkeozk=; b=E1yp+itd7bAYZceV5BWTR3HZdaEP5H27zxi2ArOmpl9KePzSVjxQ35E05lxpgXKx7W 4qoNvLWt5K6BkyuG4HulsCRt5OkKrEjgdHttSKK2nhlDhmCdM3i1w7y1yF7FKuoNr56A J40zsOLyjUTgtqRjtmfLnYjJjIbYt000gHxwHwcknb6fixa59CO1eauE+zgaFYansI2N E2K3iRur71A1KEPoALZkFpBBSjLbkeIWe2d1gTTSL6khCGnDvpSpESm3r4pPZ2bwzaGF eK9QZJC7uNsqgcAqacLfOlIOJAI0BnVDhqxVN2EYuHW1EKOBF952gHVCsir6vTqwH5jy 9IJg== X-Gm-Message-State: ALoCoQnf+3/V6PzSlDj+Dtthp+JMEkDPWVfsmUZRPWhJPNYO/LSyzRzgGm+vWc368B0MWv8DC1uS X-Received: by 10.180.104.164 with SMTP id gf4mr21960967wib.35.1389731190631; Tue, 14 Jan 2014 12:26:30 -0800 (PST) Received: from [192.168.1.118] (62.57.0.127.dyn.user.ono.com. [62.57.0.127]) by mx.google.com with ESMTPSA id q15sm1478569wjw.18.2014.01.14.12.26.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 Jan 2014 12:26:26 -0800 (PST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: Correct src location for kernel ATF tests From: Julio Merino In-Reply-To: Date: Tue, 14 Jan 2014 21:26:25 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <7D8E1A11-A946-499A-B568-D77D91B49FA6@meroh.net> To: Alan Somers X-Mailer: Apple Mail (2.1827) 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: Tue, 14 Jan 2014 20:26:33 -0000 On Jan 14, 2014, at 20:22, Alan Somers wrote: > On Tue, Jan 14, 2014 at 12:12 PM, Julio Merino = wrote: >> On Jan 13, 2014, at 22:25, Alan Somers wrote: >>=20 >>> Where is the correct location within the source tree for ATF tests >>> that exercise kernel features? For example, I'm currently trying to >>> ATFify tools/regression/sockets/unix_seqpacket_exercise, >>=20 >> I think it's good practice to _not_ ATFify an existing test at the = same time as it's moved. >>=20 >> I feel it's better to first move the test program "as is" into its = new location, ensure it works, and only then change it to use the ATF = libraries. If done properly (e.g. by maintaining the same binary name = pre/post conversion), this should cause minimum churn and will allow for = easier tracking of code changes in the VCS history. >=20 > In this case, the test doesn't work to begin with. I'm rewriting > almost from scratch. OK, then it makes sense to just do the "move" in one go. >> Second, possibly trickier, is that any kernel tests that currently = exist are integration tests by design: we have no unit-testing framework = for the kernel (such as what rump provides for NetBSD), and as such any = test will be quite "broad" in scope. This may make it difficult to = pinpoint the specific subdirectory in which the test belongs. For your = case above, I cannot tell if any of the src/sys/net*/ subdirectories are = relevant and/or specific enough. If they are, then I'd say put the test = in one of them using src/sys/netgraph/tests/unix_seqpacket_exercise to = pick an example at random. >=20 > Sounds good, but the most relevant directory is actually > src/sys/kern/, not src/sys/netgraph. SGTM. Is the test specific to a single file within kern or is it not? If it is, then name the test program after the source file. For = example, assuming this tested stuff from sys_socket.c, you'd then have a = sys_socket_test test program and put a single test case inside it called = unix_seqpacket_exercise. If it is not, then make sure to use a generic-enough name for the test = program that leaves room for future test cases in the same "area". https://wiki.freebsd.org/TestSuite/Structure contains some more = rationales for this.