libcgroup/libcgroup-0.41/tests/tools
2014-02-05 16:04:04 +01:00
..
cgclassify init 2014-02-05 16:04:04 +01:00
cgconfigparser init 2014-02-05 16:04:04 +01:00
multimount init 2014-02-05 16:04:04 +01:00
Makefile.am init 2014-02-05 16:04:04 +01:00
Makefile.in init 2014-02-05 16:04:04 +01:00
README init 2014-02-05 16:04:04 +01:00
testenv.sh.in init 2014-02-05 16:04:04 +01:00

libcgroup tools test suite
==========================

These files should test libcgroup tools, not the libcgroup library itself! All
the tools use the library so it gets pretty well tested, but that's just a side
effect, not an intention.

Usage
-----

There are few requirements to run this test:
 - !!! YOU MUST RUN THE TESTS AS ROOT !!! - the tests need to mount/unmount
   stuff. The tests should not destroy anything important, but use a virtual
   machine if possible, just to be sure.
 - You must have no cgroup mounted (i.e. run cgclear before starting the test
   suite).
 - The tests require various tools to be present in $PATH or at the specified
   location, among others:
   diff, awk, su, /bin/bash, /bin/sleep
 - The tests require that user and group named 'nobody' exists, some processes
   with be started with its UID/GID.
 - The tests mounts/unmounts cpu, cpuacct, freezer and net_cls controllers.
   Make sure your kernel supports them.

If you have met all above prerequisites just run 'make check' in this directory
as root.

Design
------
There is very simple testenv.sh script, which contains common functions for all
tests. It includes also simple example how to write a test.

The tests themselves are just simple shell scripts, which either end with exit
status 0 (=success) or nonzero (=error). The tests should clean after themselves
(incl. unmounting all groups and removing all temp. files).