[Avocado-devel] Multiplex and avocado-vt

Olav Philipp Henschel olavph at linux.vnet.ibm.com
Fri Nov 20 13:24:54 UTC 2015


I believe the syntax you've given is for an avocado-virt test, which inherits from the class VirtTest, right?
The way I use them, avocado-vt tests don't have a class, they are defined just by a "run" method.
Based on the code you pointed to, in VirtTest __init__, I've written a simple function to get the avocado params:

from avocado.core import multiplexer
def get_avocado_params(params):
     avocado_params_raw = params.get('avocado_params', None)
     if avocado_params_raw is not None:
         params_list, mux_path = avocado_params_raw[0], avocado_params_raw[1]
     else:
         params_list, mux_path = [], []
     return multiplexer.AvocadoParams(params_list, "", "", mux_path, {})

This way, I've been able to use them in an avocado-vt test like this:

avocado_params = get_avocado_params(params)
param = avocado_params.get("param_name")

If there's a simpler way, please tell me.

I'm eager to move to avocado-virt, it seems much nicer than avocado-vt, but we need the unattended_install test, which I believe is not yet supported.
I might even give a try in porting it eventually.


Thank you for helping me with this,
Olav


On 19-11-2015 19:42, Cleber Rosa wrote:
> Hi Olav,
>
> Avocado-vt tests, by default, do not use the parameters from the multiplex. By default, is parameters come from the precursor of the multiplexer (known as the cartesian config file).
>
> But, Avocado actually sends the parameters over, and there's a way to actually use them from within avocado-vt tests. The syntax (from within a test) is:
>
>     sleep_length = self.avocado_params.get('sleep_length', default=1)
>
> The parameter 'sleep_length' is a parameter that should come from the multiplexer.
>
> About Avocado-virt: this is where a more native (and pleasant) experience should be found. Unfortunately, it's still far from the same level of features and tests as Avocado-vt. But, Avocado-virt should receive most of our development energy from now on.
>
> If you feel that Avocado-virt better suits your needs, great! Let's work together on that!
>
> BTW, a few pointers on Avocado-vt + multiplexer:
>
>   - https://github.com/avocado-framework/avocado-vt/blob/master/avocado/core/plugins/vt.py#L254
>   - https://github.com/avocado-framework/avocado-vt/blob/master/avocado/core/plugins/vt.py#L321
>
>
> Thanks,
> CR.
>
> ----- Original Message -----
>> From: "Olav Philipp Henschel" <olavph at linux.vnet.ibm.com>
>> To: avocado-devel at redhat.com
>> Sent: Thursday, November 19, 2015 4:09:06 PM
>> Subject: [Avocado-devel] Multiplex and avocado-vt
>>
>> Now that I got multiplexing to work, I've tried to use it with
>> avocado-vt and didn't get the expected results.
>> It prints the "Multiplex tree representation" and executes the tests
>> once for each variant, but the tests didn't get the param values.
>> I've noticed the params in new tests are an attribute of the Test class,
>> which is not used in avocado-vt.
>>
>> Is it even possible to multiplex avocado-vt tests?
>> If not, what's the current status on avocado-virt? Can we port other
>> distros as guests already?
>>
>> Any information is appreciated,
>> Olav P. Henschel
>>
>> _______________________________________________
>> Avocado-devel mailing list
>> Avocado-devel at redhat.com
>> https://www.redhat.com/mailman/listinfo/avocado-devel
>>
> _______________________________________________
> Avocado-devel mailing list
> Avocado-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/avocado-devel
>




More information about the Avocado-devel mailing list