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

Amador Pahim apahim at redhat.com
Fri Jun 10 09:20:23 UTC 2016


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


Best Regards,
-- 
Amador Pahim

_______________________________________________
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