[Avocado-devel] Arguments with remote target

Cleber Rosa crosa at redhat.com
Tue Nov 27 01:01:14 UTC 2018



On 11/21/18 9:13 AM, Lukáš Doktor wrote:
> Dear Fran,
> 
> I'm sorry for a late response, but with the release we were a bit busier. You are right, the `mux-inject` is not currently passed to remote execution as a long time ago we decided to go the safe way and to use whitelist of arguments passed to remote process. You can find the arguments in `optional_plugins/runner_remote/avocado_runner_remote/__init__.py` in `run_test` around line `429` but basically it's: --mux-yaml, --dry-run, --filter-by-tags-include-empty and --filter-by-tags.
> 
> We discussed several times the possibility of changing the approach to blacklist, but never actually did that. Maybe it's another time we should consider that, what do you think, guys?
> 

My honest feeling is that the remote(-based) runners need nothing short
of a major overhaul.  Changing the approach from a whitelist to a
blacklist can open a Pandora box.

My understanding is that the remote execution of tests should be trimmed
down and be made more similar to how the runner runs individual tests
locally.  While locally we have a simple process being used to "isolate"
tests, other runners should "just" use other isolation models, such as
containers, virtual machines, etc.

Given that this is not minor work, it won't help Fran or other users in
the short term.  So, I'd suggest we try to whitelist (and test) more
options at this time.

Thanks,
- Cleber.

> Regards,
> Lukáš
> 
> 
> Dne 21. 11. 18 v 10:53 Fran Sanchez napsal(a):
>> After looking into the code, apparently there isn't support for
>> variants/multiplexation in the remote runner:
>>
>>     def run_suite(self, test_suite, variants, timeout=0, replay_map=None,
>>                   suite_order="variants-per-test"):
>>         """
>>         Run one or more tests and report with test result.
>>
>>         :param params_list: a list of param dicts.
>>         :param variants: A varianter iterator (unused here)
>>
>> On Mon, 19 Nov 2018 at 14:37, Fran Sanchez <fran.sanchez at five.ai> wrote:
>>
>>> Hello,
>>>
>>> first of all I would like to introduce myself to you. My name is Fran and
>>> I am working for FiveAI as a test engineer. While I was looking for a test
>>> framework that I could use for automation and standardized testing across
>>> multiple teams I came across avocado and since them I have been reading
>>> docs, code and trying to better understand its capabilities.
>>>
>>> One of the feature that I would like to use is the remote Docker plugin,
>>> but I cannot get the params API working correctly. I have tried the next,
>>> which works correctly:
>>> $avocado run --ignore-missing-references=on --mux-inject
>>> /run:sleep_length:2.0 -- sleeptest.py
>>> $cat
>>> /home/francisco/avocado/job-results/latest/jobdata/cmdline
>>>>>> ['/home/francisco/.virtualenvs/avocado27/bin/avocado', 'run',
>>> '--ignore-missing-references=on', '--mux-inject', '/run:sleep_length:2.0',
>>> '--', 'sleeptest.py']
>>> In the log:
>>> 2018-11-19 14:31:11,069 parameters       L0146 DEBUG| PARAMS
>>> (key=sleep_length, path=*, default=1) => '2.0'
>>>
>>> But when I try:
>>> avocado run --ignore-missing-references=on --mux-inject
>>> /run:sleep_length:2.0 --docker alpine-avocado -- sleeptest.py
>>> $cat
>>> /home/francisco/avocado/job-results/latest/jobdata/cmdline
>>>>>> ['/usr/local/bin/avocado', 'run', '--force-job-id',
>>> 'fc8bd8d0ee0bfa9d737501f9f6a21af5854b48ca', '--json', '-', '--archive',
>>> 'sleeptest.py'](
>>> In the log:
>>> 2018-11-19 14:32:50,304 parameters       L0146 DEBUG| PARAMS (key=timeout,
>>> path=*, default=None) => None
>>>
>>> So, it seems that when using the remote Docker plugin the parameters are
>>> not being sent, at least using the --mux-inject argument. Any suggestions?
>>> What would be the best way to be able to send arguments to the remote
>>> Docker?
>>>
>>> Thank you,
>>> Fran
>>>
>>
> 
> 

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