Skip to content

Add Test Suite

rli9 edited this page Mar 30, 2017 · 3 revisions

Add Pack Script

This step is to prepare the test environment such as building the test suite, installing necessary dependencies and etc. It generates ${test_suite}.cgz by below scripts

pack/${test_suite}
distro/depends/${test_suite}-dev
distro/depends/${test_suite}

Pack

A test suite specific script is required to generate the cgz, which is added at pack/${test_suite}. This typically does steps like download the source, build the source and install necessary files to cgz, e.g. pack/hwsim.

Meanwhile, a dependency description file is needed if there's any dependencies required when building the source, which is added at distro/depends/${test_suite}, e.g. distro/depends/hwsim-dev. The packing system will install necessary dependencies according to it before running the pack code.

Runtime Dependencies

Another dependency description file is used for runtime, which is added at distro/depends/${test_suite}, e.g. distro/depends/hwsim.

Add Initial Job File

A job file is in the yaml format to describe the properties of a job. Usually we have one default yaml for each of the test suite, e.g jobs/hwsim.yaml.

$ cat > jobs/${test_suite}.yaml
testcase: ${test_suite}
${test_suite}:
[CTRL+D]

We then can use lkp install to verify the pack step.

$ lkp install jobs/${test_suite}.yaml

Add Test Script

The script executes the test, and can take parameters defined in job.yaml, which is added at tests/${test_suite}, e.g. tests/hwsim.

Add Parsing Script

It extracts the meaningful part of the test output and converts it to "key: value" style, which is added at stats/${test_suite}, e.g. stats/hwsim.

Run the Test

$ lkp split-job jobs/${test_suite}.yaml
$ lkp run ${one_of_the_splitted_job}.yaml

Summary

Currently, below changes are needed to add a test suite

pack/${test_suite}
distro/depends/${test_suite}-dev
distro/depends/${test_suite}
jobs/${test_suite}
tests/${test_suite}
stats/${test_suite}