[OE-core] [PATCH] Meta runtime cases: add testcases for kernel sample

Hongzhi, Song hongzhi.song at windriver.com
Fri Jun 1 23:48:49 UTC 2018


Hi Richard,

I have made patch-v2 with shared functions.
And these kernel-samples are just for testing, so maybe it's unnecessary 
to enable them by default.


On 2018年06月01日 16:12, Richard Purdie wrote:
> On Fri, 2018-06-01 at 04:02 -0400, Hongzhi.Song wrote:
>> We are going to let runtime test support kernel tests. Now we just
>> add
>> kernel self-contained sample tests. And we plan to add overall kernel
>> tests in the future.
>>
>> This patch is just add kernel samples test which contains about 13
>> tests
>> enabled by kernel-sample.scc. So it needs statement,
>> KERNEL_FEATURES_append += " kernel-sample/kernel-sample.scc" in
>> local.conf.
>>
>> Signed-off-by: Hongzhi.Song <hongzhi.song at windriver.com>
>> ---
>>   meta/lib/oeqa/runtime/cases/ksample.py | 440
>> +++++++++++++++++++++++++++++++++
>>   1 file changed, 440 insertions(+)
>>   create mode 100644 meta/lib/oeqa/runtime/cases/ksample.py
> [...]
>> +        # check config
>> +        status, ret = self.target.run('zcat /proc/config.gz | grep CONFIG_TRACING_SUPPORT')
>> +        result = "CONFIG_TRACING_SUPPORT=y" in ret
>> +        if not result:
>> +            self.skipTest("CONFIG error")
>> +        # make sure if module exists
>> +        status, ret = self.target.run('uname -r')
>> +        cmd = "ls " + "/lib/modules/" + ret + "/kernel/samples/trace_events/trace-events-sample.ko"
>> +        status, output = self.target.run(cmd)
>> +        if status != 0:
>> +            self.skipTest("trace-events-sample.ko doesn't exist")
>
> There looks to be a fair bit of copy and paste code in these tests such
> as the code above to look at config.gz. Could you turn some of these
> into shared functions please?
>
> Also, do we want to include this kernel-sample feature to the qemu
> machines by default so that we enable these tests?
>
> Cheers,
>
> Richard
>
>




More information about the Openembedded-core mailing list