Showing 4 posts
I’m learning Python these days while writing an script to automate the testing of ATF under multiple virtual machines. I had this code in a shell script, but it is so ugly and clumsy that I don’t even dare to add it to the repository. Hopefully, the new version in Python will be more robust and versatile enough to be published.
One of the things I’ve been impressed by is the subprocess module and,
in special, its Popen class. By using this class, it is trivial to
spawn subprocesses and perform some IPC with them. Unfortunately,
Popen does not provide any way to silence the output of the children.
As I see it, it’d be nice if you’d pass an IGNORE flag as the
stdout/stderr behavior, much like you can currently set those to PIPE
or set stderr to STDOUT.
January 5, 2009
·
Tags:
process, python
Continue reading (about
2 minutes)
Now that you know the procedure to kill a process tree, I can explain how the automated tests for this feature work. In fact, writing the tests is what was harder due to all the race conditions that popped up and due to my rusty knowledge of tree algorithms.
Basically, the testing procedure works like this:
The tricky parts were 3 and 5.
January 17, 2008
·
Tags:
atf, process
Continue reading (about
3 minutes)
Yesterday I mentioned the need for a way to kill a tree of processes in order to effectively implement timeouts for test cases. Let’s see how the current algorithm in ATF works:
There are two major caveats in the above algorithm. First, point 2. There is no standard way to get the list of processes of a Unix system, so I have had to code three different implementations so far for this trivial requirement: one for NetBSD’s KVM, one for Mac OS X’s sysctl kern.proc node and one for Linux’s procfs.
January 16, 2008
·
Tags:
atf, portability, process
Continue reading (about
3 minutes)
One of the pending to-do entries for ATF 0.4 is (was, mostly) the ability to define a timeout for a test case after which it is forcibly terminated. The idea behind this feature is to prevent broken tests from stalling the whole test suite run, something that is already needed by the factor(6) tests in NetBSD. Given that I want to release this version past weekend, I decided to work on this instead of delaying it because… you know, this sounds pretty simple, right? Hah!
January 15, 2008
·
Tags:
atf, netbsd, process
Continue reading (about
3 minutes)