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

Cleber Rosa crosa at redhat.com
Thu Aug 23 15:03:45 UTC 2018



On 08/23/2018 10:42 AM, Amador Pahim wrote:
> On Thu, Aug 23, 2018 at 4:27 PM Eduardo Habkost <ehabkost at redhat.com> wrote:
>>
>> On Thu, Aug 23, 2018 at 11:08:54AM +0200, Amador Pahim wrote:
>>> 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.")
>>
>> Thanks!  This looks like what I'm looking for.
>>
>> I'm surprised that a core test API feature (test parameters) can
>> only be used through an optional plugin (yaml_to_mux).
> 

It's surprising... and a bit of a shame.  We're working on that, though:

https://trello.com/c/NTSCLnvv/962-define-and-improve-sources-of-test-params

The idea is that parameters will be a first class and core concept, and
not depend on the varianter.

> Well, the Varianter API[1] can receive variants from anywhere. Each
> variant will carry the parameters that will be exposed for a test to
> consume.
> Yes, right now the only one[2] sending variants to the Varianter API
> is the yaml_to_mux plugin.
> It would be easy to create a "simple parameter interface", closer to
> the core package, that would create one variant will all the
> parameters you want, i.e. from the command line. But someone has to
> write that internal plugin :)
> 
> [1] - https://avocado-framework.readthedocs.io/en/latest/TestParameters.html#test-parameters
> [2] - Apart from varianter_pict and varianter_cit plugins
> 
>>
>> --
>> Eduardo
> 
> 
> 

Well noted from Amador: the CIT varianter plugin can be (ab)used for
simple parameter passing, because it uses a simpler configuration file
format, and is thus easier to use.  That plugin is going to be part of
Avocado 64.0, with ETA of Aug 27th.

-- 
Cleber Rosa
[ Sr Software Engineer - Virtualization Team - Red Hat ]
[ Avocado Test Framework - avocado-framework.github.io ]
[  7ABB 96EB 8B46 B94D 5E0F  E9BB 657E 8D33 A5F2 09F3  ]




More information about the Avocado-devel mailing list