summaryrefslogtreecommitdiffstats
path: root/support/testing/infra/builder.py
Commit message (Collapse)AuthorAgeFilesLines
* support/testing/infra/builder: configure and build with make target and ↵Ricardo Martincoski2019-01-291-4/+32
| | | | | | | | | | | | | | | | | | | | | | environment Make the builder able to call 'VAR1=1 make VAR2=2 target'. Allow sending extra parameters to be added to the end of make command line. Uses for these purposes: - to configure a br2-external, using the 'BR2_EXTERNAL="dir" variable. - to specify a make target, such as 'foo-source.' Allow adding variables to the environment when calling make. These added variables allow a user to override default values from BuildRoot, such as 'BR2_DL_DIR="dl"'. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@datacom.ind.br> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Matt Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Daniel J. Leach <dleach@belcan.com> Signed-off-by: Adam Duskett <Aduskett@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* support/testing/infra: rm extra log flush in builder.pyMatt Weber2018-08-111-1/+0
| | | | | | | | While integrating proxy support in builder.py, a log flush was left in the code. This commit cleans/removes that code. Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* support/testing: runtest proxy supportMatt Weber2018-08-101-0/+6
| | | | | | | | | Allow builder.py to inherit the system proxy settings from the env if they are present. Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* testing/infra/builder: split configure() from build()Ricardo Martincoski2018-04-011-1/+3
| | | | | | | | | | | | | | | | | Some test cases don't use a full build as setup, so split the build() method into configure() and build(). It allows a test case to perform configuration at the setup stage and the build inside the test itself. Call this new method just before build in the BRTest base class, to keep the current behavior for existing test cases. This change will be needed when adding a common class to test the git download infra. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@datacom.ind.br> Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* testing/infra/builder: call make with empty envRicardo Martincoski2018-04-011-2/+5
| | | | | | | | | | | | | | | | | | | | | Use an empty environment when calling make, but import PATH so the buildroot tree under test can find binaries from the host machine. Since environment variables are now ignored, move the handling of BR2_DL_DIR to the defconfig to keep the current precedence of -d: BR2_DL_DIR | -d DIR | test downloads | BR downloads ------------+----------+------------------+-------------- unset | unset | [error] | [error] unset | set | in $(DIR) | in $(DIR) set | unset | in $(BR2_DL_DIR) | in $(BR2_DL_DIR) set | set | in $(DIR) | in $(DIR) Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* support/testing: fix code styleRicardo Martincoski2017-10-061-0/+1
| | | | | | | | | | | Fix the trivial warnings from flake8: - remove modules imported but unused; - use 2 lines before class or module level method; - remove blank line at end of file. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
* support/testing: allow to indent ccache defconfig fragmentRicardo Martincoski2017-10-061-1/+2
| | | | | | | | | | | | | | | | | | Move the strip out of leading spaces in defconfig fragments from the BRTest class to the Builder class. It actually postpones the strip out, consequentially allowing test cases to post-process the defconfig in their own __init__ before calling the __init__ method from BRTest. Moving this code to the Builder class also allows any new test class that inherits from BRTest to reuse the same code even if the new class overrides the setUp method. At same time, prepend a newline to the jlevel handling otherwise it would stop working for defconfig fragments that don't end in a newline. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Cc: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
* testing/infra/builder: dump defconfig to logRicardo Martincoski2017-07-241-0/+4
| | | | | | | | | | | The defconfig is composed on-the-fly by test infra + tests. Dump it to the logfile before running 'make olddefconfig' so it can easily analysed when debugging. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/testing: simplify logging by keeping the log file openLuca Ceresoli2017-05-171-9/+3
| | | | | | | | | | | | | | | We currently call infra.smart_open() to open log files each time we need to write to them. Opening the file once in the constructor of Builder and Emulator and writing to it whenever needed is simpler and slightly more efficient. Remove smart_open and instead create a new open_log_file() function which just opens the logfile. Also let it compute the filename, in order to simplify even further the Builder and Emulator code. Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/testing: core testing infrastructureThomas Petazzoni2017-05-071-0/+49
This commit adds the core of a new testing infrastructure that allows to perform runtime testing of Buildroot generated systems. This infrastructure uses the Python unittest logic as its foundation. This core infrastructure commit includes the following aspects: - A base test class, called BRTest, defined in support/testing/infra/basetest.py. This base test class inherited from the Python provided unittest.TestCase, and must be subclassed by all Buildroot test cases. Its main purpose is to provide the Python unittest setUp() and tearDown() methods. In our case, setUp() takes care of building the Buildroot system described in the test case, and instantiate the Emulator object in case runtime testing is needed. The tearDown() method simply cleans things up (stop the emulator, remove the output directory). - A Builder class, defined in support/testing/infra/builder.py, simply responsible for building the Buildroot system in each test case. - An Emulator class, defined in support/testing/infra/emulator.py, responsible for running the generated system under Qemu, allowing each test case to run arbitrary commands inside the emulated system. - A run-tests script, which is the entry point to start the tests. Even though I wrote the original version of this small infrastructure, a huge amount of rework and improvement has been done by Maxime Hadjinlian, and squashed into this patch. So many thanks to Maxime for cleaning up and improving my Python code! Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
OpenPOWER on IntegriCloud