- project:
    queue: magnum
    templates:
      - check-requirements
      - tempest-plugin-jobs
    check:
      jobs:
        - magnum-tempest-plugin-tests-api
        - magnum-tempest-plugin-tests-api-rbac
        - magnum-tempest-plugin-tests-api-2023-1
        - magnum-tempest-plugin-tests-api-zed
        - magnum-tempest-plugin-tests-api-yoga
        - magnum-tempest-plugin-tests-cluster-k8s_fcos_v1
    gate:
      jobs:
        - magnum-tempest-plugin-tests-api

- job:
    name: magnum-tempest-plugin-tests-api-2023-1
    parent: magnum-tempest-plugin-tests-api
    nodeset: openstack-single-node-jammy
    override-checkout: stable/2023.1

- job:
    name: magnum-tempest-plugin-tests-api-zed
    parent: magnum-tempest-plugin-tests-api
    nodeset: openstack-single-node-focal
    override-checkout: stable/zed

- job:
    name: magnum-tempest-plugin-tests-api-yoga
    parent: magnum-tempest-plugin-tests-api
    nodeset: openstack-single-node-focal
    override-checkout: stable/yoga

- job:
    name: magnum-tempest-plugin-tests-api-rbac
    parent: magnum-tempest-plugin-tests-api
    vars:
      tempest_test_regex: ^magnum_tempest_plugin.tests.api.v1.rbac
      devstack_localrc:
        MAGNUM_ENFORCE_SCOPE: true
      devstack_local_conf:
        test-config:
          $TEMPEST_CONFIG:
            enforce_scope:
              magnum: true

- job:
    name: magnum-tempest-plugin-tests-cluster-k8s_fcos_v1
    parent: magnum-tempest-plugin-tests-cluster

- job:
    name: magnum-tempest-plugin-tests-api
    parent: magnum-tempest-plugin-base
    vars:
      tox_envlist: all
      tempest_test_regex: ^magnum_tempest_plugin.tests.api
      tempest_exclude_regex: (test_create_list_sign_delete_clusters|test_create_cluster_with_zero_nodes)
      devstack_local_conf:
        test-config:
          $TEMPEST_CONFIG:
            magnum:
              image_id: fedora-coreos-38.20230806.3.0-openstack.x86_64
              nic_id: public
              keypair_id: default
              flavor_id: ds2G
              master_flavor_id: ds2G
              copy_logs: true

- job:
    name: magnum-tempest-plugin-tests-cluster
    parent: magnum-tempest-plugin-base
    nodeset: magnum-nested-virt-ubuntu-jammy
    vars:
      configure_swap_size: 8192
      tox_envlist: all
      tempest_test_regex: ^magnum_tempest_plugin.tests.api.v1.test_cluster.ClusterTest.test_create_list_sign_delete_clusters
      devstack_local_conf:
        test-config:
          $TEMPEST_CONFIG:
            magnum:
              image_id: fedora-coreos-38.20230806.3.0-openstack.x86_64
              nic_id: public
              keypair_id: default
              flavor_id: ds2G
              master_flavor_id: ds2G
              copy_logs: true
              copy_logs_sucess: true
      devstack_localrc:
        LIBVIRT_TYPE: kvm
        LIBVIRT_CPU_MODE: host-passthrough
      zuul_copy_output:
        /tmp/magnum-nodes: logs

- job:
    name: magnum-tempest-plugin-base
    description: |
      Magnum functional tests base layer
    parent: devstack-tempest
    required-projects:
      - openstack/barbican
      - openstack/heat
      - openstack/magnum
      - openstack/magnum-tempest-plugin
      - openstack/python-magnumclient
    vars:
      tempest_plugins:
        - magnum-tempest-plugin
      devstack_localrc:
        USE_PYTHON3: true
        GLANCE_LIMIT_IMAGE_SIZE_TOTAL: 5000
        MAGNUM_GUEST_IMAGE_URL: https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/38.20230806.3.0/x86_64/fedora-coreos-38.20230806.3.0-openstack.x86_64.qcow2.xz
        MAGNUM_IMAGE_NAME: fedora-coreos-38.20230806.3.0-openstack.x86_64
      devstack_plugins:
        heat: https://opendev.org/openstack/heat
        barbican: https://opendev.org/openstack/barbican
        magnum: https://opendev.org/openstack/magnum
      devstack_services:
        # Disable swift and dependent c-bak service to support upload of .qcow2.xz image in the gate
        s-account: false
        s-container: false
        s-object: false
        s-proxy: false
        c-bak: false
    irrelevant-files:
      - ^.*\.rst$
      - ^api-ref/.*$
      - ^doc/.*$
      - ^specs/.*$
      - ^install-guide/.*$
      - ^releasenotes/.*$
      - ^dockerfiles/.*$

- nodeset:
    name: magnum-nested-virt-ubuntu-jammy
    nodes:
      - name: controller
        label: nested-virt-ubuntu-jammy
    groups:
      - name: tempest
        nodes:
          - controller

