open_posix_testsuite: add set_affinity_single()

Couple testcases rely on set_affinity(), to limit usage of CPUs
to a single one. However they hardcode CPU number to "0", which
is causing problems on systems where CPU0 is not available (for
example it's offline, etc.)

This patch adds set_affinity_single() (which sets affinity to
first single online CPU) and replaces all calls to set_affinity(0).

Signed-off-by: Jan Stancek <jstancek@redhat.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
7 files changed