- job-template:
    name: '{pipeline}-tempest-dsvm-networking-midonet{branch-designator}'
    node: '{node}'

    wrappers:
      - build-timeout:
          timeout: 125
      - timestamps

    builders:
      - link-logs
      - net-info
      - devstack-checkout
      - shell: |
          #!/bin/bash -xe
          export PYTHONUNBUFFERED=true
          export DEVSTACK_GATE_TIMEOUT=120
          export DEVSTACK_GATE_NEUTRON=1
          export DEVSTACK_GATE_TEMPEST=1
          export BRANCH_OVERRIDE={branch-override}
          if [ "$BRANCH_OVERRIDE" != "default" ] ; then
              export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
          fi
          # Because we are testing a non standard project, add
          # our project repository. This makes zuul do the right
          # reference magic for testing changes.
          export PROJECTS="stackforge/networking-midonet $PROJECTS"
          # Note the actual url here is somewhat irrelevant because it
          # caches in nodepool, however make it a valid url for
          # documentation purposes.
          export DEVSTACK_LOCAL_CONFIG="enable_plugin networking-midonet git://git.openstack.org/stackforge/networking-midonet"

          # Keep localrc to be able to set some vars in pre_test_hook
          export KEEP_LOCALRC=1

          # We are only interested on Neutron, so very few services are needed
          # to deploy devstack and run the tests
          s=""
          s+="mysql,rabbit"
          s+=",key"
          s+=",n-api,n-cond,n-cpu,n-crt,n-obj,n-sch"
          s+=",g-api,g-reg"
          s+=",q-dhcp,q-meta,q-svc,quantum"
          s+=",tempest"
          export OVERRIDE_ENABLED_SERVICES="$s"

          # Run api network tests, for it is the only api that MidoNet
          # implements; and the scenario ones for higher level tests
          export DEVSTACK_GATE_TEMPEST_REGEX="tempest.api.network \
                                              tempest.scenario"

          cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
          ./safe-devstack-vm-gate-wrap.sh

    publishers:
      - devstack-logs
      - console-log