Skip to content

Support passing hardware specification as a JSON string on the command line #4698

@thrix

Description

@thrix

Feature Request

Currently, the --hardware CLI option for tmt run provision accepts key-value pairs like --hardware hostname=foo.example.com. However, there is no way to pass a full hardware specification as a JSON string on the command line.

This would be useful for integrations (such as Testing Farm) that need to pass complex hardware requirements from their API directly to tmt, especially in multihost scenarios where each guest may have different hardware constraints.

Use case

Testing Farm receives hardware requirements via its API as structured JSON objects, for example:

{
    "hostname": "=~storageqe-60.rhts.eng.pek2.redhat.com"
}

Currently, these cannot be forwarded directly to tmt's --hardware option in their full structured form. Supporting a JSON string input would allow seamless passthrough of hardware specifications.

Proposed behavior

Allow --hardware to accept a JSON string, e.g.:

tmt run provision -h beaker --hardware '{"hostname": "=~storageqe-60.rhts.eng.pek2.redhat.com"}'

This should be equivalent to:

tmt run provision -h beaker --hardware hostname="=~storageqe-60.rhts.eng.pek2.redhat.com"

Jira reference

TFT-4171 - Support passing hardware from API to tmt for multihost

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    backlog

    Status

    triaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions