[LTP] [PATCH RFC 3/9] tracing[2]: reorganize ftrace stress tests to general tests

Li Wang liwang@redhat.com
Fri Mar 18 11:42:17 CET 2016


Hi Cyril,

On Fri, Mar 18, 2016 at 12:39 AM, Cyril Hrubis <chrubis@suse.cz> wrote:

> Hi!
> ...
>
> Adding a script that runs all testcases is frowned upon in LTP. What you
> should do instead is to make it possible to run individual testcases and
> add the tests one test per line to a runtest file.
>
>
Seems like these regression cases are petty and simple. I fear that would
be too dispersed to read. How about taking use of the cgroup tests
code-style to organise them?

which will be like:
---------------------
$ cat ftrace_regression_test.sh
#! /bin/sh
...

export TCID="ftrace-regression-test"
export TST_TOTAL=N ( N depends on how many test_$cur)
export TST_COUNT=1

. ftrace_lib.sh

test_success=false

test_check()
{
    if $test_success; then
        tst_resm TPASS "finished running the test."
    else
        tst_resm TFAIL "running the test failed, please check log message."
    fi

    test_success=false
}

#comments the test_1 info blablabla....
test_1()
{
   ...
   set test_success 'true' or 'false' base on the test result
   ...
   test_check;
}

test_2()
{
   ...
   test_check;
}

test_3()
{
   ...
   test_check;
}

test_regression()
{
    for cur in $(seq $TST_TOTAL); do
        test_$cur
    done
}

#----------------------------------
echo "Ftrace Regression Test Begin"

save_old_setting

test_regression

clean_up

echo "Ftrace Regression Test End"



> Also newly added test should use test.sh library.
>

sure, this no problem!

-- 
Regards,
Li Wang
Email: liwang@redhat.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20160318/1bbe9eee/attachment-0001.html>


More information about the ltp mailing list