[Avocado-devel] Passing test parameters on the command-line?

Sergey Bronnikov estetus at gmail.com
Thu Aug 23 08:10:42 UTC 2018


Hi,

there are many ways to do it.
Avocado can read parameters via command line, config files (aka cartesian
config) and YAML configs.
Parameters from all these sources are merged together before run and used
in tests.
Avocado prints parameters used in test before running it (see output with
--show-job-log).

The simpliest way for you is using command line. Just pass qemu_bin value
via extra params:
$ avocado run --show-job-log io-github-autotest-qemu.boot --vt-extra-params
qemu_bin=/bin/true
or special special option for overriding QEMU binary - "--vt-qemu-bin":
$ avocado run --show-job-log io-github-autotest-qemu.boot --vt-qemu-bin
/bin/true

Sergey

чт, 23 авг. 2018 г. в 6:44, Eduardo Habkost <ehabkost at redhat.com>:

> Hi,
>
> I am reading the docs about test parameters[1][2][3], and I
> learned how to access them inside the test code.  But I couldn't
> find one piece of information: what's the simplest way to _pass_
> parameters to tests?
>
> My use case is simple: I want to set the 'qemu_bin' parameter
> when running avocado_qemu tests[4], and I don't know how to do
> it when running 'avocado run'.
>
>
> [1]
> https://avocado-framework.readthedocs.io/en/63.0/WritingTests.html#accessing-test-parameters
> [2] https://avocado-framework.readthedocs.io/en/63.0/TestParameters.html
> [3]
> https://avocado-framework.readthedocs.io/en/63.0/optional_plugins/varianter_yaml_to_mux.html#yaml-to-mux-plugin
> [4]
> https://github.com/qemu/qemu/blob/master/tests/acceptance/avocado_qemu/__init__.py#L46
>
> --
> Eduardo
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/avocado-devel/attachments/20180823/23857f66/attachment.htm>


More information about the Avocado-devel mailing list