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

Amador Pahim amador at pahim.org
Thu Aug 23 09:08:54 UTC 2018


On Thu, Aug 23, 2018 at 5:44 AM Eduardo Habkost <ehabkost at redhat.com> wrote:
>
> 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?

avocado run --mux-inject 'foo:bar' -- test.py

("--mux-inject   Inject [path:]key:node values into the final multiplex tree.")


>
> 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
>


-- 
Pahim




More information about the Avocado-devel mailing list