summaryrefslogtreecommitdiffstats
path: root/support/testing/tests/package/test_python_autobahn.py
diff options
context:
space:
mode:
authorRicardo Martincoski <ricardo.martincoski@gmail.com>2018-11-10 00:16:02 -0200
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>2018-11-13 20:55:45 +0100
commit13e3c14ed277e7f53ed9cdc7d161a4435c2ddbe0 (patch)
tree21e1205ae250e507e7f0c25fe37e40ee18083169 /support/testing/tests/package/test_python_autobahn.py
parent80fe11cd26205ecb4a78c18c79dad8b1f6b4bd23 (diff)
downloadbuildroot-13e3c14ed277e7f53ed9cdc7d161a4435c2ddbe0.tar.gz
buildroot-13e3c14ed277e7f53ed9cdc7d161a4435c2ddbe0.zip
support/testing: create default test case for python packages
Test cases for python packages are very similar among each other: run a simple script in the target that minimally tests the package. So create a new helper class named TestPythonPackageBase that holds all the logic to run a script on the target. TestPythonPackageBase adds in build time one or more sample scripts to be run on the target. The test case for the python package must explicitly list them in the "sample_scripts" property. The test case then automatically logins to the target, checks the scripts are really in the rootfs (it calls "md5sum" instead of "ls" or "test" in an attempt to make the logfile more friendly, since someone analysing a failure can easily check the expected script was executed) and then calls the python interpreter passing the sample script as parameter. An optional property "timeout" exists for the case the sample script needs more time to run than the default timeout from the test infra (currently 5 seconds). A simple test case for a package that only supports Python 2 will look like this: |from tests.package.test_python import TestPythonPackageBase | | |class TestPythonPy2<Package>(TestPythonPackageBase): | __test__ = True | config = TestPythonPackageBase.config + \ | """ | BR2_PACKAGE_PYTHON=y | BR2_PACKAGE_PYTHON_<PACKAGE>=y | """ | sample_scripts = ["tests/package/sample_python_<package>.py"] | timeout = 15 Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Asaf Kahlon <asafka7@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Diffstat (limited to 'support/testing/tests/package/test_python_autobahn.py')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud