[Avocado-devel] Multiplex and avocado-vt

Lukáš Doktor ldoktor at redhat.com
Wed Nov 25 11:58:30 UTC 2015


Hello Olav,

yes, the params from cartesian config and multiplexer ones are 
completely separated. Anyway maybe it's time to review my idea of having 
a way to inject params into the cartesian config params.

The way I implemented it a while ago was, that the avocado-vt test 
iterated items of `/plugins/vt/params/*` of avocado params and injected 
key-value pairs. I wanted to use it to run `up` and `smp` variants in 
one avocado run, but the idea was rejected, because the test name did 
not reflected the values (it'd still be called ....smp... even when cpu 
= 1). My argument that you can override the `shortname` and `testname` 
the same way you override the `cpu` did not work.

So what do you guys think, would it be useful? I like the flexibility of 
multiplexer and I think avocado-vt will be with us for a while...

Kind regards,
Lukáš

PS: For single runs you can override some params from cmdline using 
`--vt-extra-params`, which is what I use nowadays for minor tweaks (like 
different vga).

Dne 20.11.2015 v 15:20 Lucas Meneghel Rodrigues napsal(a):
>
>
> On Fri, Nov 20, 2015 at 12:18 PM Olav Philipp Henschel
> <olavph at linux.vnet.ibm.com <mailto:olavph at linux.vnet.ibm.com>> wrote:
>
>     I've just noticed the parameter "test", which is passed to the method
>     "run" in avocado-vt is an instance of class VirtTest.
>     So there's no need for that function that I've written. I just need to
>     use the command you mentioned replacing "self" with "test".
>
>     sleep_length = test.avocado_params.get('sleep_length', default=1)
>
>
> Yes, I was writing the answer when you sent this message, but that's
> pretty much it.
>
>     On 20-11-2015 11:24, Olav Philipp Henschel wrote:
>      > 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
>     <mailto:olavph at linux.vnet.ibm.com>>
>      >>> To: avocado-devel at redhat.com <mailto: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 <mailto:Avocado-devel at redhat.com>
>      >>> https://www.redhat.com/mailman/listinfo/avocado-devel
>      >>>
>      >> _______________________________________________
>      >> Avocado-devel mailing list
>      >> Avocado-devel at redhat.com <mailto:Avocado-devel at redhat.com>
>      >> https://www.redhat.com/mailman/listinfo/avocado-devel
>      >>
>      >
>      > _______________________________________________
>      > Avocado-devel mailing list
>      > Avocado-devel at redhat.com <mailto:Avocado-devel at redhat.com>
>      > https://www.redhat.com/mailman/listinfo/avocado-devel
>      >
>
>     _______________________________________________
>     Avocado-devel mailing list
>     Avocado-devel at redhat.com <mailto: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