Jump to: navigation, search


< Ironic
Revision as of 20:36, 24 November 2015 by Thingee (talk | contribs)

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:

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:

  1. each driver must adhere to the existing driver interfaces.
  2. drivers must function in a common environment with other drivers.
  3. 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.
  4. vendors are responsible for fixing bugs in their driver in a timely fashion.
  5. vendors provide third-party, non-voting tests on supported hardware platform.
  6. 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


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


  • 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.



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

    # set this to your gerrit change number

                      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

    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


    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.