[LTP] [PATCH 1/4] memcg/functional: rewrite

Cyril Hrubis chrubis@suse.cz
Wed Jun 22 15:34:44 CEST 2016


Hi!
>  # Record the test result of a test case
>  # $1 - The result of the test case, $PASS or $FAIL
> @@ -55,7 +82,6 @@ result()
>  		tst_resm TPASS "$info"
>  	else
>  		tst_resm TFAIL "$info"
> -		: $(( failed += 1 ))
>  	fi

Can we get rid of the result() function?

Since the failures are now counted in the test.sh library it does not
make a sense to define special result reporting function.

> @@ -83,7 +109,7 @@ warmup()
>  {
>  	pid=$1
>  
> -	echo "Warming up for test: $cur_id, pid: $pid"
> +	tst_resm TINFO "Warming up pid: $pid"
>  	kill -s USR1 $pid 2> /dev/null
>  	sleep 1
>  	kill -s USR1 $pid 2> /dev/null
> @@ -91,10 +117,10 @@ warmup()
>  
>  	kill -0 $pid
>  	if [ $? -ne 0 ]; then
> -		result $FAIL "cur_id=$cur_id"
> +		result $FAIL ""
                              ^
Shouldn't we print here something as:

"process died after warmup"

Or even better wait the pid and print the exit value as well.


Otherwise this looks fine.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list