- job:
    name: networking-odl-config-job
    description: Fake job to hold configuration settings for jobs
    vars:
      odl_version_map:
        oxygen: &oxygen oxygen-latest
        fluorine: &fluorine fluorine-snapshot-0.9
        neon: &neon neon-snapshot-0.10
        sodium: &sodium sodium-snapshot-0.11
      common_devstack_vars: &devstack_vars
        devstack_localrc:
          ODL_TIMEOUT: 60
          ODL_RELEASE: latest-snapshot
          # Set here which ODL openstack service provider to use
          ODL_NETVIRT_KARAF_FEATURE: odl-neutron-service,odl-restconf-all,odl-aaa-authn,odl-dlux-core,odl-mdsal-apidocs,odl-netvirt-openstack,odl-neutron-logger,odl-neutron-hostconfig-ovs
          # Switch to using the ODL's L3 implementation
          ODL_L3: True
          # public network connectivity
          ODL_PROVIDER_MAPPINGS: public:br-ex
          PUBLIC_PHYSICAL_NETWORK: public
          PUBLIC_BRIDGE: br-ex
          Q_USE_PUBLIC_VETH: False
          # Enable debug logs for odl ovsdb
          ODL_NETVIRT_DEBUG_LOGS: True
          # Database
          MYSQL_PASSWORD: secretmysql
          DATABASE_QUERY_LOGGING: True
          OS_LOG_PATH: '{{ zuul.executor.log_root }}'
          IS_GATE: True
        devstack_services: &devstack_services
          c-api: True
          c-bak: True
          c-sch: True
          c-vol: True
          cinder: True
          dstat: True
          g-api: True
          g-reg: True
          horizon: False
          key: True
          mysql: True
          n-api-meta: True
          n-api: True
          n-cauth: False
          n-cond: True
          n-cpu: True
          n-crt: True
          n-novnc: False
          n-obj: True
          n-sch: True
          neutron: True
          neutron-agent: False
          neutron-api: True
          neutron-dhcp: True
          neutron-l3: False
          neutron-metadata-agent: True
          neutron-qos: True
          placement-api: True
          placement-client: False
          q-agt: False
          q-dhcp: False
          q-l3: False
          q-meta: False
          q-svc: False
          rabbit: True
        devstack_plugins: &devstack_plugins
          networking-odl: https://opendev.org/openstack/networking-odl
          neutron: https://opendev.org/openstack/neutron

- job:
    name: networking-odl-tempest-base
    parent: devstack-tempest
    description: |
        Base job for tempest-based tests
    pre-run: playbooks/tempest/pre.yaml
    run: playbooks/tempest/run.yaml
    post-run: playbooks/tempest/post.yaml
    voting: false
    required-projects:
      - openstack/networking-odl
      - openstack/networking-l2gw
      - openstack/networking-sfc
      - openstack/networking-bgpvpn
      - openstack/neutron-fwaas
      - openstack/neutron-tempest-plugin
    roles:
      - zuul: openstack/devstack
    timeout: 9000
    irrelevant-files: &irrelevant_files
      - ^.*\.rst$
      - ^doc/.*$
      - ^releasenotes/.*$
    vars:
      <<: *devstack_vars
      tox_envlist: all-plugin
      zuul_copy_output:
        '{{ devstack_log_dir }}/screen-karaf.log': 'logs'
      extensions_to_txt:
        log: True
        ini: True
      devstack_plugins:
        <<: *devstack_plugins
        neutron-tempest-plugin: https://opendev.org/openstack/neutron-tempest-plugin.git
      # Only scenario tests and some compute API tests actually verify ODL is working
      # Any API networking tests don't bring up any VMs and just verify that stuff happened in the
      # Neutron DB, so they don't actually fail even if ODL is not running at all.
      tempest_test_regex: tempest\.(api.compute|scenario|thirdparty)|neutron_tempest_plugin.scenario
      tempest_test_blacklist: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tempest-blacklist.txt"

- job:
    name: networking-odl-tempest-oxygen
    parent: networking-odl-tempest-base
    vars:
      devstack_localrc:
        ODL_RELEASE: *oxygen

- job:
    name: networking-odl-tempest-fluorine
    parent: networking-odl-tempest-base
    vars:
      devstack_localrc:
        ODL_RELEASE: *fluorine

- job:
    name: networking-odl-devstack-base
    parent: devstack
    description: |
        Base job for devstack-based tests
    pre-run: playbooks/devstack/pre.yaml
    required-projects:
      - openstack/networking-odl
      - openstack/networking-l2gw
      - openstack/networking-sfc
      - openstack/networking-bgpvpn
      - openstack/neutron-fwaas
    roles:
      - zuul: openstack/devstack
    timeout: 9000
    irrelevant-files: *irrelevant_files
    vars:
      <<: *devstack_vars
      run_devstack: True

- job:
    name: networking-odl-devstack-base-tox
    parent: networking-odl-devstack-base
    pre-run: playbooks/devstack-tox/pre.yaml
    run: playbooks/devstack-tox/run.yaml
    post-run: playbooks/devstack-tox/post.yaml
    description: |
        Base job for devstack tests that use a tox environment

- job:
    name: networking-odl-functional-base
    parent: networking-odl-devstack-base-tox
    pre-run: playbooks/functional/pre.yaml
    description: |
        Base job for functional tests
    timeout: 1800
    roles:
      - zuul: openstack/devstack
    vars:
      tox_envlist: functional
      zuul_copy_output:
        '{{ devstack_log_dir }}/functional-logs': 'logs'
        '{{ devstack_log_dir }}/screen-karaf.log': 'logs'
      extensions_to_txt:
        log: True
      devstack_localrc:
        HOST_IP: 127.0.0.1
        UNSTACK_KEEP_ODL: True
        USE_PYTHON3: True
      run_devstack: False

- job:
    name: networking-odl-functional-neon
    parent: networking-odl-functional-base
    vars:
      devstack_localrc:
        ODL_RELEASE: *neon

- job:
    name: networking-odl-functional-sodium
    parent: networking-odl-functional-base
    vars:
      devstack_localrc:
        ODL_RELEASE: *sodium

- job:
    name: networking-odl-rally-neon
    parent: rally-task-at-devstack
    vars:
      devstack_localrc:
        ODL_RELEASE: *neon
      devstack_plugins:
        rally-openstack: https://opendev.org/openstack/rally-openstack
        networking-odl: https://opendev.org/openstack/networking-odl
      rally_task: rally-jobs/odl.yaml
    timeout: 7500
    required-projects:
      - openstack/devstack
      - openstack/devstack-gate
      - openstack/networking-odl
      - openstack/rally
      - openstack/rally-openstack
    irrelevant-files:
      - ^.*\.rst$
      - ^doc/.*$
      - ^neutron/locale/.*$
      - ^neutron/tests/unit/.*$
      - ^releasenotes/.*$
      - ^tools/.*$
      - ^tox.ini$

- job:
    name: networking-odl-rally-sodium
    parent: rally-task-at-devstack
    vars:
      devstack_localrc:
        ODL_RELEASE: *sodium
      devstack_plugins:
        rally-openstack: https://opendev.org/openstack/rally-openstack
        networking-odl: https://opendev.org/openstack/networking-odl
      rally_task: rally-jobs/odl.yaml
    timeout: 7500
    required-projects:
      - openstack/devstack
      - openstack/devstack-gate
      - openstack/networking-odl
      - openstack/rally
      - openstack/rally-openstack
    irrelevant-files:
      - ^.*\.rst$
      - ^doc/.*$
      - ^neutron/locale/.*$
      - ^neutron/tests/unit/.*$
      - ^releasenotes/.*$
      - ^tools/.*$
      - ^tox.ini$

# >>> LEGACY JOBS TO REPLACE

- job:
    name: networking-odl-grenade
    parent: legacy-dsvm-base
    run: playbooks/legacy/grenade-dsvm-networking-odl/run.yaml
    post-run: playbooks/legacy/grenade-dsvm-networking-odl/post.yaml
    timeout: 9000
    required-projects:
      - openstack/grenade
      - openstack/devstack-gate
      - openstack/networking-odl

- job:
    name: networking-odl-tempest-oxygen-multinode
    parent: legacy-dsvm-base-multinode
    run: playbooks/legacy/tempest-dsvm-networking-odl-multinode-oxygen-snapshot/run.yaml
    post-run: playbooks/legacy/tempest-dsvm-networking-odl-multinode-oxygen-snapshot/post.yaml
    timeout: 10800
    required-projects:
      - openstack/devstack-gate
      - openstack/networking-odl
      - openstack/tempest
    nodeset: legacy-ubuntu-xenial-2-node

- job:
    name: networking-odl-tempest-fluorine-multinode
    parent: legacy-dsvm-base-multinode
    run: playbooks/legacy/tempest-dsvm-networking-odl-multinode-fluorine-snapshot/run.yaml
    post-run: playbooks/legacy/tempest-dsvm-networking-odl-multinode-fluorine-snapshot/post.yaml
    timeout: 10800
    required-projects:
      - openstack/devstack-gate
      - openstack/networking-odl
      - openstack/tempest
    nodeset: legacy-ubuntu-xenial-2-node

# <<< LEGACY JOBS TO REPLACE
