Skip to content
  • Thomas Petazzoni's avatar
    support/testing: core testing infrastructure · a732fb22
    Thomas Petazzoni authored
    
    
    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: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
    a732fb22