[Avocado-devel] [RFC] Environment Variables - V2

Lukáš Doktor ldoktor at redhat.com
Wed Jun 15 09:20:28 UTC 2016


Dne 10.6.2016 v 11:20 Amador Pahim napsal(a):
> Hi
>
> After some discussion about the V1, this is the V2 of the RFC on
> Environment Variables.
>
> The original request is here:
> https://trello.com/c/Ddcly0oG/312-mechanism-to-provide-environment-variables-to-tests-run-on-a-virtual-machine-remote
>
>
> Motivation
> ==========
> When Avocado is executed locally, it has access to the local environment
> variables, including that ones set by the user. For remote executions,
> like using remote or vm plugins, the local environment variables are not
> reflected on the remote environment. The motivation of this RFC is to
> provide the standard Unix interface of environment variables for when
> tests are run remotely.
>
> Use case
> ========
> - User defines an environment variable locally:
>
>  $ export FOOVAR=myfoovar
>
> - User runs avocado using a remote plugin, pointing the local
> environment variable(s) he wants to keep the in the remote environment:
>
>  $ avocado --env-keep FOOVAR run passtest.py --remote-hostname host01
>
> - The environment variable defined locally will be present on host01
> environment.
>
> Alternative flow:
>
>  - Instead of pointing in the command line the local environment
> variable(s) he wants to keep the in the remote environment, uses can set
> it in avocado.conf so it will affect every Avocado execution.
>
> Proposal
> ========
> - To create an Avocado command line option to set environment variables
> that will be available in remote environment:
>
>  $ avocado --env-keep FOOVAR run passtest.py --remote-hostname host01
>
> - Create an option in config file with a list of environment variable
> names to copy from Avocado local environment to the remote environment
> (similar to env_keep in the /etc/sudoers file):
>
>  [remoter.behavior]
>  env_keep = ['FOO', 'FOO1', 'FOO2']
I don't think the config file would be necessary, but apart from that I 
agree with this. Maybe in the future we might need `--env-unset` as some 
ugly software checks for value presence even when the value is null.

Lukáš

>
>
> Best Regards,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/avocado-devel/attachments/20160615/a4f3bb6a/attachment.sig>


More information about the Avocado-devel mailing list