.opal-template-fedora:
  extends:
    - .dnf-openssl-backend
  tags:
    - libvirt
    - cryptsetup-fedora-rawhide
  stage: test-opal
  interruptible: false
  variables:
    OPAL2_DEV: "/dev/nvme0n1"
    OPAL2_PSID_FILE: "/home/gitlab-runner/psid.txt"
    VOLATILE: 1
  script:
    - sudo dnf install -y -q nvme-cli
    - sudo nvme list
    - make -j
    - make -j -C tests check-programs
    - sudo -E make check TESTS="00modules-test compat-test-opal"

# Samsung SSD 980 500GB (on tiber machine)
test-commit-rawhide-samsung980:
  rules:
    - if: $CI_PROJECT_PATH != "cryptsetup/cryptsetup"
      when: never
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /v2\..\.x$/
  extends:
    - .opal-template-fedora
  tags:
    - tiber
  resource_group: samsung980-on-tiber
  interruptible: false
  variables:
    PCI_PASSTHROUGH_VENDOR_ID: "144d"
    PCI_PASSTHROUGH_DEVICE_ID: "a809"

test-mergerq-rawhide-samsung980:
  rules:
    - if: $CI_PROJECT_PATH != "cryptsetup/cryptsetup"
      when: never
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
  extends:
    - .opal-template-fedora
  tags:
    - tiber
  resource_group: samsung980-on-tiber
  interruptible: false
  variables:
    PCI_PASSTHROUGH_VENDOR_ID: "144d"
    PCI_PASSTHROUGH_DEVICE_ID: "a809"

# WD PC SN740 SDDQNQD-512G-1014 (on tiber machine)
test-commit-rawhide-sn740:
  rules:
    - if: $CI_PROJECT_PATH != "cryptsetup/cryptsetup"
      when: never
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /v2\..\.x$/
  extends:
    - .opal-template-fedora
  tags:
    - tiber
  resource_group: sn740-on-tiber
  interruptible: false
  variables:
    PCI_PASSTHROUGH_VENDOR_ID: "15b7"
    PCI_PASSTHROUGH_DEVICE_ID: "5017"

test-mergerq-rawhide-sn740:
  rules:
    - if: $CI_PROJECT_PATH != "cryptsetup/cryptsetup"
      when: never
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
  extends:
    - .opal-template-fedora
  tags:
    - tiber
  resource_group: sn740-on-tiber
  interruptible: false
  variables:
    PCI_PASSTHROUGH_VENDOR_ID: "15b7"
    PCI_PASSTHROUGH_DEVICE_ID: "5017"

# Samsung SSD 980 PRO 1TB (on trantor machine)
test-commit-rawhide-samsung980pro:
  rules:
    - if: $CI_PROJECT_PATH != "cryptsetup/cryptsetup"
      when: never
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /v2\..\.x$/
  extends:
    - .opal-template-fedora
  tags:
    - trantor
  resource_group: samsung980pro-on-trantor
  interruptible: false
  variables:
    PCI_PASSTHROUGH_VENDOR_ID: "144d"
    PCI_PASSTHROUGH_DEVICE_ID: "a80a"

test-mergerq-rawhide-samsung980pro:
  rules:
    - if: $CI_PROJECT_PATH != "cryptsetup/cryptsetup"
      when: never
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
  extends:
    - .opal-template-fedora
  tags:
    - trantor
  resource_group: samsung980pro-on-trantor
  interruptible: false
  variables:
    PCI_PASSTHROUGH_VENDOR_ID: "144d"
    PCI_PASSTHROUGH_DEVICE_ID: "a80a"

# # UMIS RPETJ256MGE2MDQ (on tiber machine)
# test-commit-rawhide-umis:
#   rules:
#     - if: $CI_PROJECT_PATH != "cryptsetup/cryptsetup"
#       when: never
#     - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /v2\..\.x$/
#   extends:
#     - .opal-template-fedora
#   tags:
#     - tiber
#   resource_group: umis-on-tiber
#   stage: test
#   interruptible: false
#   variables:
#     PCI_PASSTHROUGH_VENDOR_ID: "1cc4"
#     PCI_PASSTHROUGH_DEVICE_ID: "6302"
#
# test-mergerq-rawhide-umis:
#   rules:
#     - if: $CI_PROJECT_PATH != "cryptsetup/cryptsetup"
#       when: never
#     - if: $CI_PIPELINE_SOURCE == "merge_request_event"
#   extends:
#     - .opal-template-fedora
#   tags:
#     - tiber
#   resource_group: umis-on-tiber
#   stage: test
#   interruptible: false
#   variables:
#     PCI_PASSTHROUGH_VENDOR_ID: "1cc4"
#     PCI_PASSTHROUGH_DEVICE_ID: "6302"
