isotoma/yaybu — pull request #93 by Jc2k (2012-10-20 22:55:03+00:00)
Title: Harness refactoring

This fixes the ``LD_PRELOAD`` style harness for lucid and precise.

It is tested on lucid and precise. The network tests successfully run.

Both ``fakeroot`` and ``fakechroot`` are just shell scripts that munge ``LD_`` environment variables. While ``cow-shell`` is written in C it's doing little more than setting some environment variables and calling ``cowdancer-ilistcreate``.

Applying this fixes the error messages about invalid arguments in fakeroot.

This improves the quality of the environment by preserving the inode list (ilist) between invocations during the same test. Previously cow-shell would have run ``find .`` on the entire chroot before every command.

With this change the ilist file is managed by the fixture. By avoiding cow-shell we stop the spawning of a cleanup process for each yaybu invocation that has previously been the source of races (and are thus able to remove the workaround for the race - a nasty ``while cond / sleep`` beastie.

Applying this patch removes 3 processes from the test for each call() invocation. Each yaybu invocation tends to to call yaybu 3 times(to test simulate, to test apply, then to make sure no more changes are made). This means that it saves 9 processes per test. I'm guessing running the test suite starts 900 processes less at least. 300 of these processes would have been ``bash`` interpreters. Another 300 would have ``sh`` interpreters.