testcases/lib/test.sh: added tst_timeout()

Function tst_timeout() added into LTP test interface:

	tst_timeout "command arg1 arg2 ..." timeout

Function enables waiting for specified command for timeout
seconds. Example usage:

	cmd_output=$(tst_timeout "ping -c 3 localhost" 5)
	if [ $? -ne 0 ]; then
		tst_brkm TBROK "timeout reached!"
	fi

where $cmd_output contains stdout and stderr of ping command.

Signed-off-by: Matus Marhefka <mmarhefk@redhat.com>
Acked-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
1 file changed