From owner-freebsd-testing@FreeBSD.ORG Thu Jul 24 19:41:55 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 776D5904 for ; Thu, 24 Jul 2014 19:41:55 +0000 (UTC) Received: from mail-qa0-f45.google.com (mail-qa0-f45.google.com [209.85.216.45]) (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 1759720CD for ; Thu, 24 Jul 2014 19:41:54 +0000 (UTC) Received: by mail-qa0-f45.google.com with SMTP id cm18so3462203qab.32 for ; Thu, 24 Jul 2014 12:41:47 -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=FBKgilNLZoB7mRstax60QoWWeyN+v2+OWDoyEwvHuMg=; b=OA/fBeKiAdMeJq7TqF71Xwbhk8siuXRqBgKn3KXDIw7As54DT2/0qV+EX8zZpt7zzl nyiYvTJtODh36PknNp5QvWyVs1+WS4iFHMRejJCvuqhQoRMGSFebQDcSa9Mrc8YubvGj dvANMy6XoRuKapZxWj2fQ5Poeq+sVQ2hcBw44o8hN9PS9S7si815I4OvdM6T6dV8YmH8 MetzFYLqj7t7CGBlf166FnMeununRo1iocgv0+ldy/6QSp+eOJjlYO1+eIiCZwl8QdBB nYPill1dXQpRVdb/URYztktUypsyGsq8VH33/DYSWYa0LgAC2vlIyE9wZ/es+HFGuxWw FFoA== X-Gm-Message-State: ALoCoQmMpD5jnA2k/0ba8Y7DL2Rz8E942wGJ5yLlbmOX0P7TZgrWqHCy2uCLvAxiQTf8cKc+fPPd X-Received: by 10.224.160.134 with SMTP id n6mr4680724qax.84.1406230907828; Thu, 24 Jul 2014 12:41:47 -0700 (PDT) MIME-Version: 1.0 Sender: jmmv@meroh.net Received: by 10.96.83.99 with HTTP; Thu, 24 Jul 2014 12:41:27 -0700 (PDT) X-Originating-IP: [2620:0:1003:1007:ac3e:4bce:435e:6e80] In-Reply-To: References: From: Julio Merino Date: Thu, 24 Jul 2014 15:41:27 -0400 X-Google-Sender-Auth: jzF6ZMA85N_AkJTJqYWgbuRldX8 Message-ID: Subject: Re: How do I extend Kyua requirements checking for FreeBSD? To: Garrett Cooper 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 19:41:55 -0000 On Thu, Jun 26, 2014 at 3:54 PM, Garrett Cooper wrote: >> >> I did it just be creating a library of shell functions that I call >> from test bodies. For example, something like this >> function require_module() { >> kldstat $1 || atf_skip "Module $1 is not loaded" >> } > > This is sort of what I'm doing, but this only works for the ATF test > interface :/. I used kldstat -m $1 by the way for detecting statically > compiled kernel modules, like aio: Yeah, creating a library of helper functions is the easiest way now with the disadvantage that this won't work for non-ATF test programs as you say. >> But that's not useful for C and C++ tests. And it would be way cooler >> if it were more tightly integrated into Kyua. Would it be possible to >> load site-specific Lua code that would handle this sort of >> functionality, so the test could simply say "atf_set require.modules >> aio"? > > Exactly! Hmm, Lua extensions. That's actually a very nice idea!