From owner-freebsd-testing@FreeBSD.ORG Tue Jan 14 19:12:43 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 3EB323AA for ; Tue, 14 Jan 2014 19:12:43 +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 C676315D1 for ; Tue, 14 Jan 2014 19:12:42 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id g10so3100082wiw.7 for ; Tue, 14 Jan 2014 11:12:35 -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=qDdkN0C4YFjnRdD0Wlm+CaZxIFNfQjzOzEAK6CFGwr8=; b=Rhivb4/Lr6itulJb04zAa8jo/CODBcSntEcFRv7050Qv8yB95FVJFvAzcTgUPBuSNW B9HY1ErSmf32Pvqwn5gs6Da0mFFhfBx4ipbhEbqh9FvbJRsAnMAxLbYZWoPJY+fARYV3 y2paE/p2il5GwAJOfMcLEC3cVkD1GanII6BXb65d13dIPqfY4CCcA9w+xOOq6y+SjaBv /iVwQXBCZFzyIC44UMRYXlYR3u5LOFe362B5uk9e8sqjOauY1ATm+ZWq+1i3uDwgGNQQ +8vDuCvl4IhsHrxNqPLqECu8uDvM0WXnhas/A/wZmfgZypVVfuNdBE0svRpifOet0l49 usIA== X-Gm-Message-State: ALoCoQkabulxuX21Getv6aUi++Ef+vSUveSs5klYANx6thiuKL4sP7/FQfKx7uTKyIdiaNLz6Ovo X-Received: by 10.194.82.105 with SMTP id h9mr74578wjy.52.1389726755510; Tue, 14 Jan 2014 11:12:35 -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 ua8sm1334863wjc.4.2014.01.14.11.12.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 Jan 2014 11:12:32 -0800 (PST) Content-Type: text/plain; charset=us-ascii 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 20:12:30 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <7D8E1A11-A946-499A-B568-D77D91B49FA6@meroh.net> References: 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 19:12:43 -0000 On Jan 13, 2014, at 22:25, Alan Somers wrote: > 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, I think it's good practice to _not_ ATFify an existing test at the same = time as it's moved. 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. > but I'm not sure where to put it. Ideally tests should live next to the code they exercise, just as we are = doing for user-space applications. This means that, at the very = minimum, they should be somewhere within src/sys/. Now that's tricky of course. Some thoughts that cross my mind: First, I'm not sure about what the implications of putting "user-level" = code in src/sys/ are regarding the build infrastructure. I suspect that = by restricting the test code into 'tests' subdirectories and only = recursing into them with the MK_TESTS knob is good enough, but I don't = know for sure at the moment. 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. Lastly, we may need a src/sys/tests/ directory to implement = cross-functional tests that don't fit any specific directory, just like = we have src/tests/ for that purpose. Or maybe we can (ab)use the latter = instead.=