Difference between revisions of "Ironic/Testing"
(→Questions: adding contact for questions) |
(→Testing Hardware Drivers) |
||
Line 20: | Line 20: | ||
== Testing Hardware Drivers == | == 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]]. | + | 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]] and/or [[ThirdPartySystems]]. |
What follows is a discussion of the CI testing efforts for Ironic in general, and for the third-party drivers specifically. | What follows is a discussion of the CI testing efforts for Ironic in general, and for the third-party drivers specifically. |
Revision as of 19:02, 2 December 2015
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 and/or ThirdPartySystems.
What follows is a discussion of the CI testing efforts for Ironic in general, and for the third-party drivers specifically.
Third-party Driver Requirements
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.
These guidelines are evolving and were originally proposed here: http://lists.openstack.org/pipermail/openstack-dev/2014-January/024823.html
Third Party CI
Description
The Ironic community have agreed that if a vendor wishes to submit a driver that said vendor should also be required to set up a third party CI system in their lab which runs appropriate tests against their actual hardware for Ironic patches, and provides feedback in to Gerrit.
Third Party CI Requirements
- See the official Third Party Testing wiki.
- Test all drivers your company has integrated in Ironic.
- Post all test results. Even if you have failure results, those need to be posted.
For example, if your company has two drivers in Ironic, you would need to have a CI that tests against the two drivers and reports the results for each driver, for Ironic upstream patches.
Existing CI Solutions
- Puppet OpenStack CI
Deadlines
- Mitaka-2ː Driver teams will have registered their intent to run CI by creating system accounts and identifying a point of contact for their CI team
- Mitaka Feature Freezeː All driver systems show the ability to receive events and post comments in the sandbox.
- N release feature freezeː Per patch testing and posting comments.
Questions
- Join Third Party Meeting
- Ping krtaylor on #openstack-ironic
FAQ
What tests do I use?
You should have a Jenkins job like {pipeline}-tempest-dsvm-ironic-pxe_ipa{job-suffix}
How do I run my CI to test all Ironic patches with my driver not yet merged?
If using devstack-gate use the pre-test-hook to cherry-pick your driver on top of the Ironic patch under review. If you've submitted your change to gerrit, you can use something like the following:
function pre_test_hook { echo "Cherry-picking latest driver from gerrit" cd $BASE/new/ironic # fetch latest patchset from gerrit UPSTREAM_REMOTE=https://review.openstack.org/openstack/ironic # set this to your gerrit change number CHANGE_NUM=999999 PATCHSET_BASE=refs/changes/${CHANGE_NUM:(-2)}/$CHANGE_NUM LATEST_PATCHSET=$(git ls-remote $UPSTREAM_REMOTE $PATCHSET_BASE/\* | sort -t/ -k 5 -n | tail -n1 | cut -d$'\t' -f2) if [ -z "$LATEST_PATCHSET" ]; then echo "Failed to determine latest patchset of $PATCHSET_BASE from $UPSTREAM_REMOTE" exit 1 fi echo "Latest patchset ref is $LATEST_PATCHSET" git fetch $UPSTREAM_REMOTE $LATEST_PATCHSET && git cherry-pick FETCH_HEAD }
If you haven't submitted your change to gerrit yet, you'll have to fetch the change from your own repository (github or otherwise). For example:
function pre_test_hook { echo "Cherry-picking latest driver from private repository" cd $BASE/new/ironic VENDOR_REMOTE=https://www.github.com/vendor/ironic-driver REFSPEC=bp/new-ironic-driver git fetch $VENDOR_REMOTE $REFSPEC && git cherry-pick FETCH_HEAD }
Otherwise you can make the changes prior to calling stack.sh or via a custom devstack plugin.