Ironic/Testing
Contents
Testing your changes locally
If you just want to test your changes locally (which you should), the developer documentation provides a good starting point.
Upstream CI Testing
We have several classes of tests run within OpenStack CI:
- pep8 and python unit tests, run from within Ironic.
- Tempest API tests
- http://git.openstack.org/cgit/openstack/tempest/tree/tempest/api/baremetal/base.py
- Devstack starts the Ironic service and create nodes with the "fake" driver.
- Tempest exercises Ironic's API.
- Other services are not involved in this test, but may be started by devstack none the less.
- functional testing, using Nova with Ironic to provision emulated hardware, also run by Tempest.
- http://git.openstack.org/cgit/openstack/tempest/tree/tempest/scenario/test_baremetal_basic_ops.py
- Devstack configures Nova to use the nova.virt.ironic driver, and starts all Ironic services.
- Devstack creates virtual machine(s) and enrolls them in Ironic
- Tempest issues commands to Nova, and validates the resulting operations in Ironic.
Testing Hardware Drivers
Drivers are a central component of Ironic's architecture, but many of them can not be tested without access to specialized hardware. For instance, even the IPMIToolPowerDriver module can not be tested without having access to hardware with a BMC that supports at least IPMI v1.5, which is not present in most laptops or workstations, and is not emulatable. As such, vendor-authors of hardware drivers are expected to contribute CI resources for the drivers they have authored. A list of the status of CI testing on each supported driver is maintained at Ironic/Drivers.
What follows is a discussion of the CI testing efforts for Ironic in general, and for the third-party drivers specifically.
Third party CI
Third-party (aka "vendor") drivers are drivers which can not be tested upstream because they depend on specific capabilities of physical hardware. Such drivers may be allowed in Ironic if they meet the following requirements:
- each driver must adhere to the existing driver interfaces.
- drivers must function in a common environment with other drivers.
- each driver must have comprehensive unit test coverage and sufficient in-line documentation. The unit tests should mock any third-party libraries, so that they can be run without those libraries.
- vendors are responsible for fixing bugs in their driver in a timely fashion.
- vendors provide third-party, non-voting tests on supported hardware platform. [*]
- vendors contribute (at least) one developer to upstream participation.
[*] General reference on running third-party CI systems for OpenStack: http://ci.openstack.org/third_party.html
These guidelines are evolving and were originally proposed here: http://lists.openstack.org/pipermail/openstack-dev/2014-January/024823.html