Date: Thu, 26 Jun 2014 13:39:54 -0600 From: Alan Somers <asomers@freebsd.org> To: Garrett Cooper <yaneurabeya@gmail.com> Cc: "freebsd-testing@freebsd.org" <freebsd-testing@freebsd.org> Subject: Re: How do I extend Kyua requirements checking for FreeBSD? Message-ID: <CAOtMX2i2dT1HR_mO-Qm6VkeJbYRDfWbQ3SOW%2B-K3uXTYLtau2Q@mail.gmail.com> In-Reply-To: <CAGHfRMAURGkTRv29Kgd4YF%2B4VQ12_9GkOf=uCQ0BAcBLJcWXZQ@mail.gmail.com> References: <CAGHfRMAURGkTRv29Kgd4YF%2B4VQ12_9GkOf=uCQ0BAcBLJcWXZQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jun 26, 2014 at 1:05 PM, Garrett Cooper <yaneurabeya@gmail.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2i2dT1HR_mO-Qm6VkeJbYRDfWbQ3SOW%2B-K3uXTYLtau2Q>