- job-template:
    name: '{pipeline}-keystone-dsvm-functional{job-suffix}'
    node: '{node}'

    wrappers:
      - build-timeout:
          timeout: 70
      - timestamps

    builders:
      - link-logs
      - net-info
      - devstack-checkout
      - shell: |
          #!/bin/bash -xe
          export PYTHONUNBUFFERED=true
          export DEVSTACK_GATE_TEMPEST=1
          export BRANCH_OVERRIDE={branch-override}
          if [ "$BRANCH_OVERRIDE" != "default" ] ; then
              export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
          fi

          export DEVSTACK_GATE_TEMPEST_ALL_PLUGINS=1
          export DEVSTACK_GATE_TEMPEST_REGEX='keystone'

          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

- job-template:
    name: '{pipeline}-keystone-dsvm-functional-v3-only{job-suffix}'
    node: '{node}'

    wrappers:
      - build-timeout:
          timeout: 70
      - timestamps

    builders:
      - link-logs
      - net-info
      - devstack-checkout
      - shell: |
          #!/bin/bash -xe
          export PYTHONUNBUFFERED=true
          export DEVSTACK_GATE_TEMPEST=1
          export BRANCH_OVERRIDE={branch-override}
          if [ "$BRANCH_OVERRIDE" != "default" ] ; then
              export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
          fi

          export DEVSTACK_GATE_TEMPEST_ALL_PLUGINS=1
          export DEVSTACK_GATE_TEMPEST_REGEX='keystone'
          export DEVSTACK_LOCAL_CONFIG="ENABLE_IDENTITY_V2=False"

          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

- job-template:
    name: '{pipeline}-keystoneclient-dsvm-functional{job-suffix}'
    node: '{node}'

    wrappers:
      - build-timeout:
          timeout: 70
      - timestamps

    builders:
      - link-logs
      - net-info
      - devstack-checkout
      - shell: |
          #!/bin/bash -xe
          export PYTHONUNBUFFERED=true
          export BRANCH_OVERRIDE={branch-override}
          export PROJECTS="openstack/python-keystoneclient $PROJECTS"
          export DEVSTACK_PROJECT_FROM_GIT=python-keystoneclient
          if [ "$BRANCH_OVERRIDE" != "default" ] ; then
              export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
          fi

          function post_test_hook {{
              # Configure and run functional tests
              $BASE/new/python-keystoneclient/keystoneclient/tests/functional/hooks/post_test_hook.sh
          }}
          export -f post_test_hook

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

    publishers:
      - test-results
      - devstack-logs
      - console-log