From owner-freebsd-testing@FreeBSD.ORG Thu Jun 26 19:39:57 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 93FC35E4; Thu, 26 Jun 2014 19:39:57 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (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 092DD203D; Thu, 26 Jun 2014 19:39:56 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id bs8so1693758wib.13 for ; Thu, 26 Jun 2014 12:39:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=roaN15d/ZJzosmYLaqqrrxDX9HehhdCZt0E8th8ecIs=; b=pbmdKOyXPgEnJON2e2eSPwdLd3MQag2dgW+wJDi0n3hvXdRq8STbFJEtaXxHX1rAf9 QswrfPB7TLHVjefQa7T9YKUJzC3t0SXX152Zh5dML0ikVbXGGD/oNKU1WSRHshgdKHLz W0Yp/8oxI2zk+Ydw/dLFdEgNf4H9dq4cJmVfmq/RAL52qgmaBWUYZHo216Pt5IeZiGqc sI/KHw4QDHJmSCqgVWghnWX9bBzBnk170I/X5ZV7MnEk6kKMzg+fotAnZE1rwVd5qg3C HkFPKNtuPynFcgG8t+nvSd5kqG2BBgQCVmLVAT1JfcItAKcur85XFH9/7Z2e+M7RPAoS RYiQ== MIME-Version: 1.0 X-Received: by 10.180.108.103 with SMTP id hj7mr6806848wib.82.1403811594701; Thu, 26 Jun 2014 12:39:54 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.194.168.202 with HTTP; Thu, 26 Jun 2014 12:39:54 -0700 (PDT) In-Reply-To: References: Date: Thu, 26 Jun 2014 13:39:54 -0600 X-Google-Sender-Auth: I2Hof9kEcyNq9-_ebJDjB7IPRG4 Message-ID: Subject: Re: How do I extend Kyua requirements checking for FreeBSD? From: Alan Somers 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, 26 Jun 2014 19:39:57 -0000 On Thu, Jun 26, 2014 at 1:05 PM, Garrett Cooper wrote: > Hello Julio! > I'm looking at extending Kyua to create special FreeBSD-specific > functionality, and I'm wondering how I should do it. In particular > there are a couple items that could be checked as prerequisite > requirements before running tests to avoid running tests: > 1. Is a service running? > 2. Is a driver loaded? > 3. Is a driver loaded as a kernel module or is it statically > compiled in to the kernel? > 4. Am I running on a particular filesystem? > Etc. > If I was to add these "requirements functions" to kyua, how would > I query the values in an interface agnostic way? I would usually set > environment variables, but this makes things potentially messier > (especially in C/C++ unless I create a standalone library to handle > this)/harder to grep for than having a command which fetches this > information, like atf-config does for the ATF tester interface. > Thank you! > -Garrett 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" } 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"? -Alan