Skip to content

Instantly share code, notes, and snippets.

@pvalena
Last active September 23, 2024 14:03
Show Gist options
  • Save pvalena/1fd3e9cbaccb98fadebe9e5bce17b398 to your computer and use it in GitHub Desktop.
Save pvalena/1fd3e9cbaccb98fadebe9e5bce17b398 to your computer and use it in GitHub Desktop.
TMT: get specific info about virtual provisioner using --help
$ tmt -c distro=fedora-rawhide run -vv --all provision -h virtual --help -i fedora:rawhide plans --default
Usage: tmt run provision [OPTIONS]
Local virtual machine using testcloud library.
Minimal config which uses the latest Fedora image:
provision:
how: virtual
Here's a full config example:
provision:
how: virtual
image: fedora
user: root
memory: 2048
As the image use fedora for the latest released Fedora compose,
fedora-rawhide for the latest Rawhide compose, short aliases such as
fedora-32, f-32 or f32 for specific release or a full url to
the qcow2 image for example from https://kojipkgs.fedoraproject.org/compose/.
Short names are also provided for centos, centos-stream, alma,
rocky, oracle, debian and ubuntu (e.g. centos-8 or c8).
NOTE: The non-rpm distros are not fully supported yet in tmt as
the package installation is performed solely using dnf/yum
and rpm.
But you should be able the login to the provisioned guest and start
experimenting. Full support is coming in the future :)
Supported Fedora CoreOS images are:
* fedora-coreos
* fedora-coreos-stable
* fedora-coreos-testing
* fedora-coreos-next
Use the full path for images stored on local disk, for example:
/var/tmp/images/Fedora-Cloud-Base-31-1.9.x86_64.qcow2
In addition to the qcow2 format, Vagrant boxes can be used as well,
testcloud will take care of unpacking the image for you.
Options:
-h, --how METHOD Use specified method for provisioning.
--insert Add this phase instead of overwriting the
existing ones.
--update Update existing phase. Use --name to
specify which one, or omit --name and
update all existing phases.
--update-missing Update existing phase, but make changes to
fields that were not set by fmf data or
previous command line options. Use --name
to specify which one, or omit --name and
update all existing phases.
--allowed-how PATTERN If set, only how matching given
regular expression is allowed.
--name TEXT Name of the existing phase which should be
updated when '--update' is used.
--order INTEGER Order in which the phase should be handled.
--role ROLE Marks related guests so that common actions
can be applied to all such guests at once.
--hardware KEY=VALUE Add a hardware requirement.
-b, --become Whether to run shell scripts in tests,
prepare, and finish with sudo.
-P, --port PORT Use specific port to connect to.
-u, --user USERNAME Username to use for all guest operations.
-k, --key PATH Private key for login into the guest
system.
-p, --password PASSWORD Password for login into the guest system.
--ssh-option OPTION Specify an additional SSH option. Value is
passed to SSH's -o option, see
ssh_config(5) for supported options. Can be
specified multiple times.
-i, --image IMAGE Select image to be used. Provide a short
name, full path to a local file or a
complete url.
-m, --memory SIZE Set available memory in MB, 2048 MB by
default.
-D, --disk SIZE Specify disk size in GB, 10 GB by default.
-c, --connection session|system
What session type to use, 'session' by
default.
-a, --arch x86_64|aarch64|s390x|ppc64le
What architecture to virtualize, host arch
by default.
--list-local-images List locally available images.
-v, --verbose Show more details. Use multiple times to
raise verbosity.
-d, --debug Provide debugging information. Repeat to
see more details.
-q, --quiet Be quiet. Exit code is just enough for me.
--log-topic key-normalization|cli-invocations|command-events|adjust-decisions|help-rendering
If specified, --debug and --verbose would
emit logs also for these topics.
-f, --force Overwrite existing files and step data.
-n, --dry Run in dry mode. No changes, please.
--again Run again, even if already done before.
--feeling-safe WARNING: with this option, tmt would be
allowed to make potentially dangerous
actions. For example, some metadata keys
may cause scripts being executed on the
runner. Do not use this option unless you
trust metadata consumed by tmt, or unless
you know what you are doing.
--help Show this message and exit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment