From owner-freebsd-testing@FreeBSD.ORG Thu Jul 24 01:45:13 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 B3227721; Thu, 24 Jul 2014 01:45:13 +0000 (UTC) Received: from mail-ie0-x234.google.com (mail-ie0-x234.google.com [IPv6:2607:f8b0:4001:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78D5D2217; Thu, 24 Jul 2014 01:45:13 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id at20so1750150iec.11 for ; Wed, 23 Jul 2014 18:45:12 -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=CwlfpXi+nWumhQzpfMBszkJXdlIhUwnrXhFfeiyh1MA=; b=MXSQffWDFWfxRTYDzpgqDLB2tZ40qOu9rXdFrnZhxZCg5VVwkqxNLqUflrVEiO276A bGw47gV4Yp4PHkLQFNUJdbTBUQ6Rkl10Me8up92qxlDSL5FN3rX3UtT3hU2nrj5a45DG Zkci+zK/5HQ/7zI5KFq3LAkmASEwaEq4B3II87WIXCBHalLWuxR8H841ZXsNl4+z5+Y4 8BUQsqWhlJOQqTNlYl7fvO9iMn+JKu2ELpVNBX7IiRItLay74Wtqhc98AFund56zZAlV HVfiV6E+vOddF6xm3Hw1uYAt/vKPN1a2Pygg4+VEOiaPWhuqRUabIai5OH7SdAiWo+qp tANw== MIME-Version: 1.0 X-Received: by 10.50.152.98 with SMTP id ux2mr34059029igb.27.1406166312688; Wed, 23 Jul 2014 18:45:12 -0700 (PDT) Received: by 10.50.213.102 with HTTP; Wed, 23 Jul 2014 18:45:12 -0700 (PDT) In-Reply-To: References: Date: Wed, 23 Jul 2014 18:45:12 -0700 Message-ID: Subject: Re: Location of test kernel drivers in tree? From: Garrett Cooper To: Julio Merino Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-testing@freebsd.org" X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jul 2014 01:45:13 -0000 On Wed, Jul 23, 2014 at 6:29 PM, Julio Merino wrote: > On Wed, Jul 23, 2014 at 9:20 PM, Garrett Cooper wrote: >> >> I was thinking of sys/tests (with associated build machinery under >> sys/modules/tests) because the kernel and world [*] build vary wildly >> by design. > > But didn't we decide a while ago that we'd put kernel tests in > tests/sys/ precisely to avoid the build system "oddities" of the > kernel? That's where the few kernel-level tests that we have today > live... Correct (and I have more in isilon-atf and there are more at Isilon that need to be upstreamed :)..). > Or am I misunderstanding? Because if you originally said that you'd > put _only_ the test-related kernel modules in sys/..., then I guess > that makes sense! Yup! That's what I was thinking of doing. I was kind of envisioning the following: sys/modules/tests/memguard/Makefile - This will be the makefile that handles compiling the test kernel module(s) (it might need to be nested a bit if there are multiple modules because I don't remember if bsd.kmod.mk can build multiple modules from one Makefile) sys/tests/memguard/ - this will be where the source for the memguard test module(s) lives tests/sys/memguard/ - this will be where the memguard test scripts live This layout does the following: 1. Makes it clear where the test code lives (helps make things more intuitive). 2. Follows the existing model with kernel code (to some degree). 3. Makes it easy to disable/skip the tests with MK_TESTS (ease of maintenance/use). The only catch is that we really need to "grow" some additional infrastructure around ATF/kyua on FreeBSD to detect when modules are present/loaded/etc to set that as requirements for tests to avoid sprinkling bits everywhere in test code to skip tests if the helper programs or modules aren't present. I already started that to some degree (I mentioned that in another freebsd-testing thread), but it needs more work (mostly because what I did works for simple cases but there are some things I potentially missed dealing with how drivers are named, etc): https://github.com/yaneurabeya/freebsd_atf_kyua_test_extensions . Alan's helped out with an initial pass at reviewing the code. Thoughts? Thanks! -Garrett