controllers/cpuset: reorganization

A separate name is assigned to each cpuset shell testcase (which
was invoked earlier by run_cpuset_test.sh).

This will simplify results analysis.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
controllers/cpuset: removed './' next to binaries

In the testcases removed './' next to binaries.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
controllers/cpuset: fix for old grep

It seems that '\s' does not work with old version
of grep (2.6.3).

Therefore several testcases fail on some distributions
using this version. For example - RHEL5-based.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
controllers/cpuset: required number of nodes

Initially these testcases required a host with 4 CPUs
and 3 memory nodes minumum. This prevented to run the
testcases on widely used 2-memory-nodes configuration.

And in fact the testcases only need 2 memory nodes, and
a few needs 4 CPUs.

Modified the checks accordingly. Now "ideal" minumum
configuration of a host is 4 CPUs and 2 memory nodes.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
cpuset_base_ops_test: using tst_kvercmp2

RHEL6 kernel backported a fix to not produce
an error in case of writing '0-' to cpuset/N/{cpus,mems} file.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
controllers/cpuset: Remove unused file.

Remove unused copy of cpuset_funcs.sh from the cpuset_lib directory.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
controllers/cpuset: Fix check for root.

The $USER == root check may fail (for example if you did su and the user stayed
set to whatever was there before). Moreover rest of the LTP uses euid == 0 to
check if you have root privileges, so let's stick to it.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
controllers/cpuset: Fix cleanup.

On some systems (found on SLES10) cpuset mounts aren't listed in the output
from mount (they are not in /etc/mtab at all), so we switch to the /proc/mounts
instead.

Also fix a race in the loop that kills processes that are left in the currently
mounted cpuset. The problem is that if you kill a LTP test, the cleanup is
still executed and the test takes some time to finish which results in EBUSY in
the umount that is executed right after the loop. The fix is to kill the
processes with -9 (SIGKILL) which makes them exit immediately.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>