[Toybox] patch: taskset-work-as-nice (was Re: new toy: taskset)

Rob Landley rob at landley.net
Sat Jul 21 13:42:24 PDT 2012


On 07/21/2012 01:11 PM, Elie De Brauwer wrote:
> On 07/21/2012 12:44 AM, Rob Landley wrote:>>
>>> The following example which spawns four loops:
>>
>> It'd be nice if there was a way to add a test to scripts/test, but that
>> assumes at least a 2-processor machine.
>>
>> Hmmm... I suppose that's easy enough to test for:
>>
>>    if [ "$(echo /sys/devices/system/cpu/cpu[0-9] | wc -w" -lt 2 ]
>>    then
>>      exit 0
>>    fi
>>
>> Or similar...
> 
> Pure testing wise, there are other tools which might deserve some more
> attention, testing now mainly focuses on the i/o-based blackbox testing
> (focusing on the toys which do simple i/o handling). Mainly splitting
> tests in two parts, one being more blackbox tests (the test which we
> have in place now, but also focusing more on the system-toys iso the
> text-toys) but next to this also unittests which can more focus on
> testing libraries/internal functions(eventually working with
> input/output redirection to test the main functions). However my
> preference to touch all of this, would be to touch this after toybox is
> self-contained, a chroot (or even a container) and toysh is ideally all
> you need to have working tests on a system instead of the hybrid
> approach which is now in place.

What I vaguely had in mind was making an aboriginal linux control-image
that could run the test suite in a system image under qemu.

Meanwhile you can check if you're running as root [ "$(id -u)" -ne 0 ]
and skip categories of tests that only work as root.

In a previous life I wrote test infrastructure that automatically set up
a chroot through recursive use of "ldd":

http://git.busybox.net/busybox/commit/?id=4bb1b04f

And a wrapper script that ran user mode linux copying the host's root
filesystem, with a given shell script as the init script:

http://git.busybox.net/busybox/commit/?id=dcb2122e853ab4b82e0baf44f7110

Rob
-- 
GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
Either it's "mere aggregation", or a license violation.  Pick one.

 1342903344.0


More information about the Toybox mailing list