Date: Thu, 13 Mar 2014 11:09:55 +0900 From: Julio Merino <jmmv@freebsd.org> To: Garrett Cooper <yaneurabeya@gmail.com> Cc: "freebsd-testing@freebsd.org" <freebsd-testing@freebsd.org>, kyua-discuss@googlegroups.com Subject: Re: Structure of ATF testcases (was "Test scenario for sysctl kern.maxfiles") Message-ID: <CAFY7cWDYwxDBNgO756R5_vzKyNcRLa%2BrzmY5f8A9cb9kCMf3VQ@mail.gmail.com> In-Reply-To: <CAGHfRMA=Hc37fj1U_6Mr=-Hp0kEa2V-ZgKtfmuQGy72X3a%2BYKQ@mail.gmail.com> References: <CAGHfRMCeVuuQjL2kiV5mbxVh7npYgbsn9yy7ZyJS%2B7ZT3BVcrg@mail.gmail.com> <CAFY7cWAccUdcc1OgyfQDXmJNxkNZLMOPgNzg4sDL68DJzwZpkw@mail.gmail.com> <CAGHfRMA=Hc37fj1U_6Mr=-Hp0kEa2V-ZgKtfmuQGy72X3a%2BYKQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Mar 7, 2014 at 5:02 AM, Garrett Cooper <yaneurabeya@gmail.com> wrote: > On Thu, Mar 6, 2014 at 11:54 AM, Julio Merino <jmmv@freebsd.org> wrote: >> On Thu, Mar 6, 2014 at 1:28 PM, Garrett Cooper <yaneurabeya@gmail.com> wrote: >>> >>> Seems like another standalone tool should be developed to cleanup >>> variables after exit per test and per test suite. >> >> Which variables? > > sysctls in this case. Isilon would probably love this and other folks > would too no doubt. Writing such support shouldn't be too hard. I can imagine a sysctl(8) wrapper stored in the test's work directory, put in the PATH, so that it captured all variables written to from the test. All this could be set up by a "sysctl-test setup" script or similar. This script would record the old values in a separate file within the work directory. Later, in the cleanup phase, you'd invoke a "sysctl-test cleanup" script that read the list of overridden variables and restored their previous values. We can easily do this as a FreeBSD-specific thingy for now and put it in the source tree. I think it'd be a good way to test the idea this way. We could generalize it into ATF later on, but adding hooks for sysctl is nasty for portability reasons...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFY7cWDYwxDBNgO756R5_vzKyNcRLa%2BrzmY5f8A9cb9kCMf3VQ>