- nodeset:
    name: octavia-two-node
    nodes:
      - name: controller
        label: ubuntu-xenial
      - name: controller2
        label: ubuntu-xenial
    groups:
      - name: controller
        nodes:
          - controller
      # Node where tests are executed and test results collected
      - name: tempest
        nodes:
          - controller
      # Nodes running the compute service
      - name: compute
        nodes:
          - controller
          - controller2
      # Nodes that are not the controller
      - name: subnode
        nodes:
          - controller2
      # Switch node for multinode networking setup
      - name: switch
        nodes:
          - controller
      # Peer nodes for multinode networking setup
      - name: peers
        nodes:
          - controller2

- job:
    name: octavia-dsvm-base
    parent: devstack-tempest
    timeout: 7800
    required-projects:
      - openstack/octavia
      - openstack/octavia-lib
      - openstack/octavia-tempest-plugin
      - openstack/python-octaviaclient
    pre-run: playbooks/Octavia-DSVM/pre.yaml
    irrelevant-files:
      - ^.*\.rst$
      - ^api-ref/.*$
      - ^doc/.*$
      - ^etc/.*$
      - ^releasenotes/.*$
    vars:
      devstack_localrc:
        TEMPEST_PLUGINS: "'/opt/stack/octavia-tempest-plugin'"
        USE_PYTHON3: true
      devstack_local_conf:
        post-config:
          $OCTAVIA_CONF:
            DEFAULT:
              debug: True
      devstack_services:
        c-bak: false
        ceilometer-acentral: false
        ceilometer-acompute: false
        ceilometer-alarm-evaluator: false
        ceilometer-alarm-notifier: false
        ceilometer-anotification: false
        ceilometer-api: false
        ceilometer-collector: false
        c-sch: false
        c-api: false
        c-vol: false
        cinder: false
        octavia: true
        o-api: true
        o-cw: true
        o-hm: true
        o-hk: true
        swift: false
        s-account: false
        s-container: false
        s-object: false
        s-proxy: false
        tempest: true
      devstack_plugins:
        octavia: https://opendev.org/openstack/octavia.git

- job:
    name: octavia-dsvm-live-base
    parent: octavia-dsvm-base
    timeout: 9000
    required-projects:
      - openstack/diskimage-builder
    vars:
      devstack_localrc:
        DIB_LOCAL_ELEMENTS: openstack-ci-mirrors
      devstack_local_conf:
        post-config:
          $OCTAVIA_CONF:
            haproxy_amphora:
              # Set these higher for non-nested virt nodepool instances
              connection_max_retries: 300
              build_active_retries: 300
            amphora_agent:
              forward_all_logs: True
      devstack_services:
        neutron-qos: true
      devstack_plugins:
        neutron: https://opendev.org/openstack/neutron.git
      zuul_copy_output:
        '/var/log/dib-build' : logs
        '/var/log/octavia-amphora.log': logs
        '/var/log/octavia-tenant-traffic.log': logs

- job:
    name: octavia-dsvm-live-two-node-base
    parent: octavia-dsvm-base
    nodeset: octavia-two-node
    timeout: 9000
    required-projects:
      - openstack/diskimage-builder
    host-vars:
      controller:
        devstack_localrc:
          # From devstack "vars:"
          DATABASE_USER: octavia
          DATABASE_PASSWORD: octavia_database_pw
          RABBIT_PASSWORD: octavia_rabbit_pw
          ADMIN_PASSWORD: octavia_admin_pw
          SERVICE_PASSWORD: octavia_service_pw
          NETWORK_GATEWAY: 10.1.0.1
          FIXED_RANGE: 10.1.0.0/20
          IPV4_ADDRS_SAFE_TO_USE: 10.1.0.0/20
          FLOATING_RANGE: 172.24.5.0/24
          PUBLIC_NETWORK_GATEWAY: 172.24.5.1
          LOGFILE: /opt/stack/logs/devstacklog.txt
          LOG_COLOR: false
          VERBOSE: true
          VERBOSE_NO_TIMESTAMP: true
          NOVNC_FROM_PACKAGE: true
          ERROR_ON_CLONE: true
          MULTI_HOST: 1
          SERVICE_HOST: "{{ hostvars['controller']['nodepool']['private_ipv4'] }}"
          HOST_IP: "{{ hostvars['controller']['nodepool']['private_ipv4'] }}"
          TEMPEST_PLUGINS: "'/opt/stack/octavia-tempest-plugin'"
          USE_PYTHON3: true
          # Octavia specific settings
          OCTAVIA_CONTROLLER_IP_PORT_LIST: 192.168.0.3:5555,192.168.0.4:5555
          OCTAVIA_MGMT_PORT_IP: 192.168.0.3
          OCTAVIA_NODE: main
          OCTAVIA_NODES: "main:{{ hostvars['controller']['nodepool']['private_ipv4'] }},second:{{ hostvars['controller2']['nodepool']['private_ipv4'] }}"
          OCTAVIA_USE_PREGENERATED_CERTS: true
        devstack_plugins:
          neutron: https://opendev.org/openstack/neutron.git
          octavia: https://opendev.org/openstack/octavia.git
        zuul_copy_output:
          '/var/log/dib-build' : logs
          '/var/log/octavia-amphora.log': logs
          '/var/log/octavia-tenant-traffic.log': logs
      controller2:
        devstack_localrc:
          # From devstack "vars:"
          DATABASE_USER: octavia
          DATABASE_PASSWORD: octavia_database_pw
          RABBIT_PASSWORD: octavia_rabbit_pw
          ADMIN_PASSWORD: octavia_admin_pw
          SERVICE_PASSWORD: octavia_service_pw
          NETWORK_GATEWAY: 10.1.0.1
          FIXED_RANGE: 10.1.0.0/20
          IPV4_ADDRS_SAFE_TO_USE: 10.1.0.0/20
          FLOATING_RANGE: 172.24.5.0/24
          PUBLIC_NETWORK_GATEWAY: 172.24.5.1
          LOGFILE: /opt/stack/logs/devstacklog.txt
          LOG_COLOR: false
          VERBOSE: true
          VERBOSE_NO_TIMESTAMP: true
          NOVNC_FROM_PACKAGE: true
          ERROR_ON_CLONE: true
          MULTI_HOST: 1
          HOST_IP: "{{ hostvars['controller2']['nodepool']['private_ipv4'] }}"
          SERVICE_HOST: "{{ hostvars['controller']['nodepool']['private_ipv4'] }}"
          NEUTRON_SERVICE_HOST: "{{ hostvars['controller']['nodepool']['private_ipv4'] }}"
          DATABASE_HOST: "{{ hostvars['controller']['nodepool']['private_ipv4'] }}"
          RABBIT_HOST: "{{ hostvars['controller']['nodepool']['private_ipv4'] }}"
          GLANCE_HOSTPORT: "{{ hostvars['controller']['nodepool']['private_ipv4'] }}:9292"
          USE_PYTHON3: true
          # Octavia specific settings
          OCTAVIA_CONTROLLER_IP_PORT_LIST: 192.168.0.3:5555,192.168.0.4:5555
          OCTAVIA_NODE: subnode
          OCTAVIA_USE_PREGENERATED_CERTS: true
          OCTAVIA_MGMT_PORT_IP: 192.168.0.4
        devstack_plugins:
          octavia: https://opendev.org/openstack/octavia.git
        zuul_copy_output:
          '/var/log/octavia-amphora.log': logs
          '/var/log/octavia-tenant-traffic.log': logs
    group-vars:
      controller:
        devstack_local_conf:
          post-config:
            $OCTAVIA_CONF:
              DEFAULT:
                debug: True
              api_settings:
                api_v1_enabled: False
              amphora_agent:
                forward_all_logs: True
        devstack_services:
          base: false
          barbican: false
          dstat: true
          g-api: true
          g-reg: true
          key: true
          mysql: true
          n-api: true
          n-api-meta: true
          n-cauth: true
          n-cond: true
          n-cpu: true
          n-obj: true
          n-sch: true
          neutron-qos: true
          octavia: true
          o-api-ha: true
          o-api: true
          o-cw: true
          o-hm: true
          o-hk: true
          peakmem_tracker: true
          placement-api: true
          q-agt: true
          q-dhcp: true
          q-l3: true
          q-meta: true
          q-svc: true
          rabbit: true
          tempest: true
          tls-proxy: true
      subnode:
        devstack_local_conf:
          post-config:
            $OCTAVIA_CONF:
              DEFAULT:
                debug: True
              api_settings:
                api_v1_enabled: False
              amphora_agent:
                forward_all_logs: True
        devstack_services:
          c-vol: false
          c-bak: false
          octavia: true
          o-api: true
          o-cw: true
          o-hm: true
          o-hk: true
          q-agt: true

- job:
    name: octavia-dsvm-noop-base
    parent: octavia-dsvm-base
    vars:
      devstack_localrc:
        DISABLE_AMP_IMAGE_BUILD: True
      devstack_local_conf:
        test-config:
          "$TEMPEST_CONFIG":
            load_balancer:
              test_with_noop: True
        post-config:
          $OCTAVIA_CONF:
            controller_worker:
              amphora_driver: amphora_noop_driver
              compute_driver: compute_noop_driver
              network_driver: network_noop_driver
            certificates:
              cert_manager: local_cert_manager
      devstack_services:
        barbican: false

- job:
    name: octavia-v2-dsvm-noop-api
    parent: octavia-dsvm-noop-base
    vars:
      devstack_local_conf:
        post-config:
          $OCTAVIA_CONF:
            api_settings:
              api_v1_enabled: False
            audit:
              enabled: True
            audit_middleware_notifications:
              driver: log
      tempest_concurrency: 2
      tempest_test_regex: ^octavia_tempest_plugin.tests.api.v2
      tox_envlist: all

- job:
    name: octavia-v2-dsvm-noop-py2-api
    parent: octavia-v2-dsvm-noop-api
    vars:
      devstack_localrc:
        USE_PYTHON3: False

- job:
    name: octavia-v2-dsvm-noop-api-stable-stein
    parent: octavia-v2-dsvm-noop-api
    override-checkout: stable/stein

- job:
    name: octavia-v2-dsvm-noop-py2-api-stable-rocky
    parent: octavia-v2-dsvm-noop-py2-api
    override-checkout: stable/rocky

- job:
    name: octavia-v2-dsvm-noop-py2-api-stable-queens
    parent: octavia-v2-dsvm-noop-py2-api
    override-checkout: stable/queens

- job:
    name: octavia-v2-dsvm-scenario
    parent: octavia-dsvm-live-base
    vars:
      devstack_local_conf:
        post-config:
          $OCTAVIA_CONF:
            api_settings:
              api_v1_enabled: False
      tempest_concurrency: 2
      tempest_test_regex: ^octavia_tempest_plugin.tests.scenario.v2
      tox_envlist: all

- job:
    name: octavia-v2-dsvm-py2-scenario
    parent: octavia-v2-dsvm-scenario
    vars:
      devstack_localrc:
        USE_PYTHON3: False

- job:
    name: octavia-v2-dsvm-scenario-stable-stein
    parent: octavia-v2-dsvm-scenario
    override-checkout: stable/stein

- job:
    name: octavia-v2-dsvm-py2-scenario-stable-rocky
    parent: octavia-v2-dsvm-py2-scenario
    override-checkout: stable/rocky

- job:
    name: octavia-v2-dsvm-py2-scenario-stable-queens
    parent: octavia-v2-dsvm-py2-scenario
    override-checkout: stable/queens

- job:
    name: octavia-v2-dsvm-scenario-two-node
    parent: octavia-dsvm-live-two-node-base
    vars:
      tempest_concurrency: 2
      tempest_test_regex: ^octavia_tempest_plugin.tests.scenario.v2
      tox_envlist: all

- job:
    name: octavia-v2-dsvm-py2-scenario-two-node
    parent: octavia-v2-dsvm-scenario-two-node
    host-vars:
      controller:
        devstack_localrc:
          USE_PYTHON3: False
      controller2:
        devstack_localrc:
          USE_PYTHON3: False

- job:
    name: octavia-v2-dsvm-py2-scenario-centos-7
    parent: octavia-v2-dsvm-py2-scenario
    nodeset: devstack-single-node-centos-7
    vars:
      devstack_localrc:
        OCTAVIA_AMP_BASE_OS: centos
        OCTAVIA_AMP_DISTRIBUTION_RELEASE_ID: 7
        OCTAVIA_AMP_IMAGE_SIZE: 3

- job:
    name: octavia-v2-dsvm-scenario-ubuntu-bionic
    parent: octavia-v2-dsvm-scenario
    vars:
      devstack_localrc:
        OCTAVIA_AMP_BASE_OS: ubuntu
        OCTAVIA_AMP_DISTRIBUTION_RELEASE_ID: bionic

- job:
    name: octavia-v2-dsvm-scenario-ubuntu-xenial
    parent: octavia-v2-dsvm-scenario
    nodeset: openstack-single-node-xenial
    vars:
      devstack_localrc:
        OCTAVIA_AMP_BASE_OS: ubuntu
        OCTAVIA_AMP_DISTRIBUTION_RELEASE_ID: xenial

- job:
    name: octavia-v2-dsvm-tls-barbican
    parent: octavia-v2-dsvm-scenario
    required-projects:
      - openstack/barbican
      - openstack/diskimage-builder
      - openstack/python-barbicanclient
      - openstack/barbican-tempest-plugin
    vars:
      tempest_test_regex: ^octavia_tempest_plugin.tests.barbican_scenario.v2
      devstack_services:
        barbican: true
      devstack_plugins:
        barbican: https://opendev.org/openstack/barbican.git
      devstack_localrc:
        TEMPEST_PLUGINS: '"/opt/stack/octavia-tempest-plugin /opt/stack/barbican-tempest-plugin"'

- job:
    name: octavia-v2-dsvm-tls-barbican-stable-stein
    parent: octavia-v2-dsvm-tls-barbican
    override-checkout: stable/stein

- job:
    name: octavia-v2-dsvm-tls-barbican-stable-rocky
    parent: octavia-v2-dsvm-tls-barbican
    override-checkout: stable/rocky

- job:
    name: octavia-v2-dsvm-tls-barbican-stable-queens
    parent: octavia-v2-dsvm-tls-barbican
    override-checkout: stable/queens

# Temporary transitional aliases for gates used in other repos
# Remove once octavia has transitioned job names
- job:
    name: octavia-v2-dsvm-noop-py35-api
    parent: octavia-v2-dsvm-noop-api

- job:
    name: octavia-v2-dsvm-py35-scenario
    parent: octavia-v2-dsvm-scenario

- job:
    name: octavia-v2-dsvm-scenario-centos-7
    parent: octavia-v2-dsvm-py2-scenario-centos-7

- job:
    name: octavia-v2-act-stdby-dsvm-scenario
    parent: octavia-dsvm-live-base
    pre-run: playbooks/act_stby_iptables/pre.yaml
    vars:
      devstack_localrc:
        OCTAVIA_USE_PREGENERATED_SSH_KEY: True
        OCTAVIA_PREGENERATED_SSH_KEY_PATH: /tmp/octavia_ssh_key
      devstack_local_conf:
        post-config:
          $OCTAVIA_CONF:
            api_settings:
              api_v1_enabled: False
            controller_worker:
              loadbalancer_topology: ACTIVE_STANDBY
            task_flow:
              engine: parallel
              devstack_local_conf:
        test-config:
          "$TEMPEST_CONFIG":
            load_balancer:
              check_timeout: 180
      tempest_test_regex: ^octavia_tempest_plugin.tests.act_stdby_scenario.v2.test_active_standby_iptables
      tox_envlist: all

- job:
    name: octavia-v2-act-stdby-dsvm-py2-scenario
    parent: octavia-v2-act-stdby-dsvm-scenario
    vars:
      devstack_localrc:
        USE_PYTHON3: False

- job:
    name: octavia-v2-act-stdby-dsvm-py2-scenario-centos-7
    parent: octavia-v2-act-stdby-dsvm-py2-scenario
    nodeset: devstack-single-node-centos-7
    vars:
      devstack_localrc:
        USE_PYTHON3: False
        OCTAVIA_AMP_BASE_OS: centos
        OCTAVIA_AMP_DISTRIBUTION_RELEASE_ID: 7
        OCTAVIA_AMP_IMAGE_SIZE: 3
      devstack_local_conf:
        test-config:
          "$TEMPEST_CONFIG":
            load_balancer:
              amphora_ssh_user: centos

- job:
    name: octavia-v2-act-stdby-dsvm-scenario-stable-stein
    parent: octavia-v2-act-stdby-dsvm-scenario
    override-checkout: stable/stein

- job:
    name: octavia-v2-act-stdby-dsvm-py2-scenario-stable-rocky
    parent: octavia-v2-act-stdby-dsvm-py2-scenario
    override-checkout: stable/rocky

- job:
    name: octavia-v2-act-stdby-dsvm-py2-scenario-stable-queens
    parent: octavia-v2-act-stdby-dsvm-py2-scenario
    override-checkout: stable/queens
