plans:
- adjust:
  - prepare+:
    - directory: tmp/RPMS/noarch
      how: install
      name: tmt
    when: how == full
  - prepare+:
    - how: shell
      name: disable systemd resolved
      script: 'set -x

        dnf install -y /usr/bin/netstat

        systemctl unmask systemd-resolved

        systemctl disable systemd-resolved

        systemctl stop systemd-resolved

        systemctl mask systemd-resolved

        rm -f /etc/resolv.conf

        systemctl restart NetworkManager

        sleep 5

        cat /etc/resolv.conf

        ps xa | grep resolv

        netstat -pnl

        '
    when: initiator == packit and distro == fedora
  - provision:
      feeling-safe: true
      guest: 3.21.242.107
      hard-reboot: /opt/artemis-cli/bin/artemis-cli guest reboot 98368312-0b48-49e4-927f-52c536a27a7a
      hardware: &id001
        cpu:
          processors: '>= 8'
      how: connect
      key:
      - /etc/citool.d/id_rsa_artemis
      name: default-0
      port: '22'
    when: trigger == commit
  cleanup:
    enabled: true
    phases:
    - how: tmt
      name: default-0
      order: 50
  description: 'A subset of unit tests that spawns containers.

    '
  discover:
    enabled: true
    phases:
    - dist-git-download-only: false
      dist-git-init: false
      dist-git-install-builddeps: false
      dist-git-merge: false
      dist-git-remove-fmf-root: false
      dist-git-source: false
      fmf-id: false
      how: fmf
      modified-only: false
      name: default-0
      order: 50
      prune: false
      sync-repo: false
      test:
      - /tests/unit/.*?/extended
      url-content-type: git
    tests:
    - adjust:
      - because: we don't want to run the avc check for local testing as it needs
          root and we're executing tests under a regular user
        check: []
        when: initiator is not defined or initiator != packit
      - because: 'Virtual provision have started to be quite slow, will investigate
          what caused the slowdown with the test /tests/execute/unresponsive

          '
        duration+: '*2'
        when: provision_how == virtual
      - environment+:
          HATCH_ENVIRONMENT: dev-not-editable
        when: distro == centos-stream-9
      - because: Enable in CI only
        enabled: true
        when: initiator == packit
      check:
      - delay-before-report: 5
        enabled: true
        how: avc
        ignore-pattern:
        - type=USER_AVC.*received policyload notice
        result: respect
        test-method: timestamp
      contact:
      - Petr Šplíchal <psplicha@redhat.com>
      description: Run all available python unit tests using pytest.
      discover-phase: default-0
      duration: 1h
      enabled: true
      environment:
        ENABLE_CONTAINERS: yes
        ENABLE_PARALLELIZATION: yes
        LANG: en_US.UTF-8
        WITH_SYSTEM_PACKAGES: yes
      framework: beakerlib
      manual: false
      name: /tests/unit/with-system-packages/extended
      order: 50
      path: /default-0/tests/tests/unit
      require:
      - tmt
      - gcc
      - git
      - python3-nitrate
      - libvirt-devel
      - krb5-devel
      - libpq-devel
      - python3-devel
      - jq
      - podman
      - buildah
      - python3-pytest
      restart-max-count: 1
      restart-with-reboot: false
      result: respect
      serial-number: 1
      summary: Extended unit tests (system packages)
      test: ./test.sh
      tier: '2'
      tty: false
  enabled: true
  environment:
    PYTEST: python3 -m pytest -vvv -ra --showlocals
  execute:
    enabled: true
    phases:
    - duration: 1h
      exit-first: false
      how: tmt
      ignore-duration: false
      interactive: false
      name: default-0
      no-progress-bar: false
      order: 50
      restraint-compatible: false
    results-path: plans/features/extended-unit-tests/execute/results.yaml
  finish:
    enabled: true
    phases:
    - how: shell
      name: default-0
      order: 50
  name: /plans/features/extended-unit-tests
  order: 50
  prepare:
    enabled: true
    phases:
    - how: install
      missing: fail
      name: default-0
      order: 50
      package:
      - jq
      - yq
      - make
      - python3-pip
      - python3-pytest
    - how: shell
      name: default-1
      order: 50
      script:
      - "mkdir -p ~/.koji\nif [ -f ~/.koji/config ]; then\n  echo \"~/.koji/config
        was already set:\"\n  cat ~/.koji/config\nelse\n  cat <<EOF > ~/.koji/config\n[koji]\nanon_retry
        = true\nEOF\nfi\n"
      summary: Make sure we run koji commands with automatic retry to avoid 50x errors
    - how: shell
      name: disable systemd resolved
      order: 50
      script:
      - 'set -x

        dnf install -y /usr/bin/netstat

        systemctl unmask systemd-resolved

        systemctl disable systemd-resolved

        systemctl stop systemd-resolved

        systemctl mask systemd-resolved

        rm -f /etc/resolv.conf

        systemctl restart NetworkManager

        sleep 5

        cat /etc/resolv.conf

        ps xa | grep resolv

        netstat -pnl

        '
  provision:
    enabled: true
    phases:
    - become: false
      guest: 3.21.242.107
      hard-reboot: /opt/artemis-cli/bin/artemis-cli guest reboot 98368312-0b48-49e4-927f-52c536a27a7a
      hardware: *id001
      how: connect
      key:
      - /etc/citool.d/id_rsa_artemis
      name: default-0
      order: 50
      port: 22
      user: root
  report:
    enabled: true
    phases:
    - display-guest: auto
      how: display
      name: default-0
      order: 50
  summary: Unit tests working with containers
run:
  context:
    arch:
    - x86_64
    distro:
    - fedora-44
    initiator:
    - packit
    trigger:
    - commit
  environment:
    PACKIT_BUILD_LOG_URL: https://download.copr.fedorainfracloud.org/results/packit/teemtee-tmt-4904/fedora-44-x86_64/10515802-tmt/builder-live.log
    PACKIT_COMMIT_SHA: 5793f160ea6a83eb7aa78b1dd7135b1303c18ef4
    PACKIT_COPR_BUILD_ID: '10515802'
    PACKIT_COPR_PROJECT: packit/teemtee-tmt-4904
    PACKIT_COPR_RPMS: tmt+export-polarion-1.75.0.dev3+g5793f160e-1.20260527082731650792.pr4904.3.g5793f160.fc44.noarch
      tmt+report-polarion-1.75.0.dev3+g5793f160e-1.20260527082731650792.pr4904.3.g5793f160.fc44.noarch
      tmt+provision-mock-1.75.0.dev3+g5793f160e-1.20260527082731650792.pr4904.3.g5793f160.fc44.noarch
      tmt+provision-container-1.75.0.dev3+g5793f160e-1.20260527082731650792.pr4904.3.g5793f160.fc44.noarch
      tmt+test-convert-1.75.0.dev3+g5793f160e-1.20260527082731650792.pr4904.3.g5793f160.fc44.noarch
      tmt+prepare-artifact-1.75.0.dev3+g5793f160e-1.20260527082731650792.pr4904.3.g5793f160.fc44.noarch
      tmt+report-junit-1.75.0.dev3+g5793f160e-1.20260527082731650792.pr4904.3.g5793f160.fc44.noarch
      tmt+provision-virtual-1.75.0.dev3+g5793f160e-1.20260527082731650792.pr4904.3.g5793f160.fc44.noarch
      tmt+link-jira-1.75.0.dev3+g5793f160e-1.20260527082731650792.pr4904.3.g5793f160.fc44.noarch
      tmt+all-1.75.0.dev3+g5793f160e-1.20260527082731650792.pr4904.3.g5793f160.fc44.noarch
      tmt+provision-beaker-1.75.0.dev3+g5793f160e-1.20260527082731650792.pr4904.3.g5793f160.fc44.noarch
      tmt+provision-bootc-1.75.0.dev3+g5793f160e-1.20260527082731650792.pr4904.3.g5793f160.fc44.noarch
      tmt-1.75.0.dev3+g5793f160e-1.20260527082731650792.pr4904.3.g5793f160.fc44.noarch
    PACKIT_DOWNSTREAM_NAME: tmt
    PACKIT_DOWNSTREAM_URL: https://src.fedoraproject.org/rpms/tmt.git
    PACKIT_FULL_REPO_NAME: teemtee/tmt
    PACKIT_PACKAGE_NAME: tmt
    PACKIT_PACKAGE_NVR: tmt+export-polarion-1.75.0.dev3+g5793f160e-1.20260527082731650792.pr4904.3.g5793f160.fc44
    PACKIT_PR_ID: '4904'
    PACKIT_SOURCE_BRANCH: document-user-key-better
    PACKIT_SOURCE_SHA: 5793f160ea6a83eb7aa78b1dd7135b1303c18ef4
    PACKIT_SOURCE_URL: https://github.com/teemtee/tmt
    PACKIT_SRPM_URL: https://download.copr.fedorainfracloud.org/results/packit/teemtee-tmt-4904/srpm-builds/10515802/tmt-1.75.0.dev3+g5793f160e-1.20260527082731650792.pr4904.3.g5793f160.src.rpm
    PACKIT_TARGET_BRANCH: main
    PACKIT_TARGET_SHA: ba64efc6eb8bc54e1c9b7971fe42c7227cdd8096
    PACKIT_TARGET_URL: https://github.com/teemtee/tmt
    PACKIT_UPSTREAM_NAME: tmt
    PACKIT_UPSTREAM_URL: https://github.com/teemtee/tmt
    TESTING_FARM_GIT_REF: 5793f160ea6a83eb7aa78b1dd7135b1303c18ef4
    TESTING_FARM_GIT_URL: https://github.com/teemtee/tmt
    TESTING_FARM_REQUEST_ID: 5b477032-9f8e-4421-95ad-862dff7e8a61
    TESTING_FARM_TEST_TYPE: fmf
  remove: false
  root: /var/ARTIFACTS/git-ba64efc6eb8bc54e1c9b7971fe42c7227cdd8096vcmdgy85
