- nodeset:
    name: dpdk
    nodes:
      - name: controller
        label: nested-virt-ubuntu-bionic
    groups:
      # Node where tests are executed and test results collected
      - name: tempest
        nodes:
          - controller
      # Nodes running the compute service
      - name: compute
        nodes:
          - controller

- job:
    name: networking-ovs-dpdk-tempest
    # this is too high but it will do for now
    timeout: 10800
    nodeset: dpdk
    parent: tempest-all
    pre-run:
      - playbooks/dpdk/dpdk.yaml
    required-projects:
      - x/networking-ovs-dpdk
    vars:
      zuul_copy_output:
        '/opt/stack/logs/ovs-vswitchd.log': logs
      tempest_concurrency: 1
      tempest_test_regex: '^(?!.*(?:tempest\.scenario\.test_network_advanced_server_ops\.TestNetworkAdvancedServerOps\.test_server_connectivity_suspend_resume.*)|(?:tempest\.scenario\.test_network_advanced_server_ops\.TestNetworkAdvancedServerOps\.test_server_connectivity_pause_unpause.*))((?:tempest\.scenario\.test_network_basic_ops.*)|(?:tempest\.scenario\.test_network_advanced_server_ops.*)).*$'
      tempest_black_regex: 'mtu|keypair|images|negative|disk|quota'
      devstack_services:
        dstat: true
        etcd3: flase
        peakmem_tracker: true
        rabbit: true
        tls-proxy: false
        s-account: false
        s-container: false
        s-object: false
        s-proxy: false
        # disable cinder services
        c-api: false
        c-bak: false
        c-sch: false
        c-vol: false
        cinder: false
      devstack_plugins:
        networking-ovs-dpdk: https://opendev.org/x/networking-ovs-dpdk
      devstack_localrc:
        USE_PYTHON3: True
        LIBVIRT_TYPE: kvm
        # ovs settings
        OVS_SOCKET_MEM: 512
        OVS_DATAPATH_TYPE: netdev
        OVS_LOG_DIR: /opt/stack/logs
        OVS_HUGEPAGE_MOUNT_PAGESIZE: 2M
        OVS_HUGEPAGE_MOUNT: /dev/hugepages
        OVS_ALLOCATE_HUGEPAGES: False
        OVS_DPDK_MODE: controller_ovs_dpdk
        OVS_DPDK_BIND_PORT: False
        # dpdk settings
        OVS_DPDK_MEM_SEGMENTS: 10240
        OVS_DPDK_VHOST_USER_DEBUG: True
        OVS_DPDK_SERVICE_DEBUG_OUTPUT: True
        OVS_INTERFACE_DRIVER: vfio-pci
        # the cpu_dedicated_set will be managed in the job
        # definition so disable auto updating of it here.
        OVS_DPDK_UPDATE_CPU_DEDICATED_SET: False
        OVS_PMD_CORE_MASK: 0x2
        OVS_CORE_MASK: 0x1
      devstack_local_conf:
        post-config:
          $NOVA_CONF:
            compute:
              # NOTE(sean-k-mooney): we have 8 cpus in the gate but
              # core 1 will be used by ovs-dpdk for the dpdk pmd thread
              # so do not add it to the cpu_dedicated_set
              cpu_dedicated_set: 2-7
              cpu_shared_set: 0
            filter_scheduler:
              enabled_filters: 'AvailabilityZoneFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,SameHostFilter,DifferentHostFilter,NUMATopologyFilter'
            libvirt:
              cpu_mode: host-passthrough
              # This job requires nested virt so we explicitly enable kvm virt_type
              virt_type: kvm
        test-config:
          $TEMPEST_CONFIG:
            compute:
              flavor_ref: 420
              flavor_ref_alt: 840
            # network tweaks should not be needed but don't hurt.
            network:
              ping_timeout: 180
              connect_timeout: 180
              ssh_timeout: 300
            volume-feature-enabled:
              backup: False
            compute-feature-enabled:
              resize: True
              scheduler_enabled_filters: 'AvailabilityZoneFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,SameHostFilter,DifferentHostFilter,NUMATopologyFilter'

- project:
    templates:
      - check-requirements
      - openstack-python3-ussuri-jobs
      - build-release-notes-jobs-python3
    check:
      jobs:
        - networking-ovs-dpdk-tempest:
            voting: false
    gate:
      jobs:
        - noop
