---

#
# JSON Schema definition for `shell` discover plugin
#
# https://tmt.readthedocs.io/en/stable/spec/plans.html#shell
#

$id: /schemas/discover/shell
$schema: https://json-schema.org/draft-07/schema

type: object
additionalProperties: false

properties:

  how:
    type: string
    enum:
      - shell

  name:
    type: string

  summary:
    $ref: "/schemas/core#/definitions/summary"

  url:
    $ref: "/schemas/common#/definitions/fmf_id/properties/url"

  url-content-type:
    type: string
    enum:
      - git
      - archive

  ref:
    $ref: "/schemas/common#/definitions/fmf_id/properties/ref"

  dist-git-source:
    $ref: "/schemas/common#/definitions/dist-git-source"

  dist-git-type:
    $ref: "/schemas/common#/definitions/dist-git-type"

  dist-git-download-only:
    $ref: "/schemas/common#/definitions/dist-git-download-only"

  dist-git-install-builddeps:
    $ref: "/schemas/common#/definitions/dist-git-install-builddeps"

  dist-git-require:
    $ref: "/schemas/common#/definitions/dist-git-require"

  order:
    $ref: "/schemas/core#/definitions/order"

  keep-git-metadata:
    type: boolean

  where:
    $ref: "/schemas/common#/definitions/where"

  when:
    $ref: "/schemas/common#/definitions/when"

  tests:
    type: array
    items:
      type: object

      additionalProperties: false

      properties:

        # https://tmt.readthedocs.io/en/stable/spec/core.html#adjust
        adjust:
          $ref: "/schemas/core#/definitions/adjust"

        # https://tmt.readthedocs.io/en/stable/spec/core.html#author
        author:
          $ref: "/schemas/core#/definitions/author"

        # https://tmt.readthedocs.io/en/stable/spec/tests.html#check
        check:
          $ref: "/schemas/test#/properties/check"

        # https://tmt.readthedocs.io/en/stable/spec/tests.html#component
        component:
          $ref: "/schemas/test#/properties/component"

        # https://tmt.readthedocs.io/en/stable/spec/core.html#contact
        contact:
          $ref: "/schemas/core#/definitions/contact"

        # https://tmt.readthedocs.io/en/stable/spec/core.html#description
        description:
          $ref: "/schemas/core#/definitions/description"

        # https://tmt.readthedocs.io/en/stable/spec/tests.html#duration
        duration:
          $ref: "/schemas/test#/properties/duration"

        # https://tmt.readthedocs.io/en/stable/spec/core.html#enabled
        enabled:
          $ref: "/schemas/core#/definitions/enabled"

        # https://tmt.readthedocs.io/en/stable/spec/tests.html#environment
        environment:
          $ref: "/schemas/test#/properties/environment"

        # https://tmt.readthedocs.io/en/stable/spec/tests.html#framework
        framework:
          $ref: "/schemas/test#/properties/framework"

        # https://tmt.readthedocs.io/en/stable/spec/core.html#id
        id:
          $ref: "/schemas/core#/definitions/id"

        # https://tmt.readthedocs.io/en/stable/spec/core.html#link
        link:
          $ref: "/schemas/core#/definitions/link"

        # https://tmt.readthedocs.io/en/stable/spec/tests.html#manual
        manual:
          $ref: "/schemas/test#/properties/manual"

        # name of the test
        name:
          type: string

        # https://tmt.readthedocs.io/en/stable/spec/core.html#order
        order:
          $ref: "/schemas/core#/definitions/order"

        # https://tmt.readthedocs.io/en/stable/spec/tests.html#path
        path:
          $ref: "/schemas/test#/properties/path"

        # https://tmt.readthedocs.io/en/stable/spec/tests.html#recommend
        recommend:
          $ref: "/schemas/test#/properties/recommend"

        # https://tmt.readthedocs.io/en/stable/spec/tests.html#require
        require:
          $ref: "/schemas/test#/properties/require"

        # https://tmt.readthedocs.io/en/stable/spec/tests.html#result
        result:
          $ref: "/schemas/test#/properties/result"

        # https://tmt.readthedocs.io/en/stable/spec/core.html#summary
        summary:
          $ref: "/schemas/core#/definitions/summary"

        # https://tmt.readthedocs.io/en/stable/spec/tests.html#tag
        tag:
          $ref: "/schemas/test#/properties/tag"

        # https://tmt.readthedocs.io/en/stable/spec/tests.html#test
        test:
          $ref: "/schemas/test#/properties/test"

        # https://tmt.readthedocs.io/en/stable/spec/tests.html#tier
        tier:
          $ref: "/schemas/test#/properties/tier"

        # https://tmt.readthedocs.io/en/stable/spec/tests.html#tty
        tty:
          $ref: "/schemas/test#/properties/tty"

      # User-defined metadata
      patternProperties:
        ^extra-: {}

      required:
        - name
        - test

  require-test:
    $ref: "/schemas/common#/definitions/one_or_more_strings"

required:
  - how
