lib/tst_kvercmp: fixed a compiling error

commit 18f7be7eb introduced the following compiling error:

make[1]: Leaving directory `/mnt/tests/kernel/distribution/ltp/git_test/ltp/testcases/kernel/containers/libclone'
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall  -I../../../include -I../../../include   -L../../../lib  check_for_unshare.c  -ldl -lltp -o check_for_unshare
check_for_unshare.c: In function ‘main’:
check_for_unshare.c:35:8: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
  void *ret;
        ^
../../../lib/libltp.a(tst_res.o): In function `cat_file':
/mnt/tests/kernel/distribution/ltp/git_test/ltp/lib/tst_res.c:777: undefined reference to `TCID'
/mnt/tests/kernel/distribution/ltp/git_test/ltp/lib/tst_res.c:787: undefined reference to `TCID'
/mnt/tests/kernel/distribution/ltp/git_test/ltp/lib/tst_res.c:795: undefined reference to `TCID'
../../../lib/libltp.a(tst_res.o): In function `tst_res':
/mnt/tests/kernel/distribution/ltp/git_test/ltp/lib/tst_res.c:301: undefined reference to `TCID'
/mnt/tests/kernel/distribution/ltp/git_test/ltp/lib/tst_res.c:317: undefined reference to `TCID'
../../../lib/libltp.a(tst_res.o):/mnt/tests/kernel/distribution/ltp/git_test/ltp/lib/tst_res.c:370: more undefined references to `TCID' follow
collect2: error: ld returned 1 exit status
make: *** [check_for_unshare] Error 1

that's because commit 18f7be7eb used LTP lib function tst_resm(), using printf() instead can avoid it.

Signed-off-by: Zhouping Liu <zliu@redhat.com>
Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
lib: fix a NULL pointer caused error

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
mount/mount06.c: fix a compile error

The definitions of MS_PRIVATE and MS_MOVE were only added to glibc headers
in version 2.12.

If there are no definitions of these two flags, make it.

Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
containers: Add TCID to sources compiled with -lltp

These are using bunch of libltp interfaces allready from which some
possibly calls tst_brkm() or tst_res(). I wonder why this wasn't problem
before.

Signed-off-by: Cyril Hrubis <metan@ucw.cz>
Revert "lib/tst_kvercmp: fixed a compiling error"

This reverts commit 793ba8a8f6fbf024ff64b88f2669e75a3f5e1e94.

It's no longer needed after the tests were fixed.

Signed-off-by: Cyril Hrubis <metan@ucw.cz>
usctest.h: Cleanup.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
usctest.h: Remove dumbious _USC_LIB_ ifdefs.

This is overcomplicated without a reason and causes build failures due
to missing symbols on uClinux.

Also remove all _USC_LIB_ defines and referencies.

Reported-by: Benoit Marcot <Benoit.Marcot@arm.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
realtime/(func|perf)/: rename run.sh to run_auto.sh

Rename run.sh to run_auto.sh in accordance to all other func tests and
remove unnecessary whitespaces newlines at the end of file to prevent git
am warning.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
added run_auto.sh to install targets for realtime tests

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
realtime tests: added additional install targets

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
realtime tests: created Makefiles for profiles/scripts

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
realtime: only build tests if needed

stand alone run scripts can not build from the installed directory.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Remove reference to "java", missed in commit 78596957

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
tst_run_cmd: added support for stdout and stderr redirection

Added function tst_run_cmd_fds which allows redirection of
stdout/stderr to file descriptors.

Now function tst_run_cmd is a wrapper to tst_run_cmd_fds.

Signed-off-by: Stanislav kholmanskikh <stanislav.kholmanskikh@oracle.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
lib/tst_module.c: modification for updated tst_run_cmd specification

Signed-off-by: Stanislav kholmanskikh <stanislav.kholmanskikh@oracle.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
quota_remount_test01: SELinux workaround and other fixes

* now it uses tst_kvercmp (to support kernels >= 3)
* some distros doesn't allow creation of quota files in
directories with SELinux file_t type. Now we explicitly
change file type of the test directory to tmp_t

Signed-off-by: Stanislav kholmanskikh <stanislav.kholmanskikh@oracle.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Tested-by: Jan Stancek <jstancek@redhat.com>
ebizzy.h: mallopt does not exist on uClinux

mallopt does not exist on uClibc, it requires MMU.

Signed-off-by: Marta Rybczynska <marta.rybczynska@kalray.eu>
tst_run_cmd: const correctness

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
tst_run_cmd: Make the tst_run_cmd survive SIGCHLD

The tst_sig() installs poisoned signal handlers for all signals the test
is not expected to get, this causes abort in tst_run_cmd right after the
child exits and parent starts running.

This commit makes the tst_run_cmd temporarily disable the handler for
SIGCHLD (the handler is set to SIG_DFL at the start of the tst_run_cmd
function and restored at the end of it) so that we don't have to disable
the poisoned handler in each test using tst_run_cmd.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
lib: Add tst_mkfs() function.

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