diff --git a/avocado/job.py b/avocado/job.py index d00015b189a6f21984583cbe812158f89fe8f106..262ad8da6039139e92b0df9317938814573d7f70 100644 --- a/avocado/job.py +++ b/avocado/job.py @@ -120,7 +120,7 @@ class TestRunner(object): else: test_class = test.DropinTest - test_instance = test_class(path=test_path, + test_instance = test_class(params=params, path=test_path, base_logdir=self.job.logdir, job=self.job) diff --git a/avocado/test.py b/avocado/test.py index b343cc0ba373ff0918d99710df006fca08fd011f..817950a847a1b519ab5e132f2f6731d5c66589e6 100644 --- a/avocado/test.py +++ b/avocado/test.py @@ -572,7 +572,9 @@ class DropinTest(Test): Run the executable, and log its detailed execution. """ try: - result = process.run(self.path, verbose=True) + test_params = {str(key): str(val) + for key, val in self.params.iteritems()} + result = process.run(self.path, verbose=True, env=test_params) self._log_detailed_cmd_info(result) except exceptions.CmdError, details: self._log_detailed_cmd_info(details.result) diff --git a/docs/source/WritingTests.rst b/docs/source/WritingTests.rst index 5e6b2c98dfe2cf8cfb8a6152d9c0d5abbf05de4b..03ed12126f2916075517c0ca64b3bca55c2a688e 100644 --- a/docs/source/WritingTests.rst +++ b/docs/source/WritingTests.rst @@ -646,9 +646,10 @@ This accomplishes a similar effect to the multiplex setup defined in there. Environment Variables for Dropin Tests ====================================== -Avocado exports some environment variables to the running test. Those variables are interesting -to drop-in tests, because they can not make use of Avocado API directly with Python, -like the native tests can do. +Avocado exports avocado variables and multiplexed variables as BASH environment +to the running test. Those variables are interesting to drop-in tests, because +they can not make use of Avocado API directly with Python, like the native +tests can do and also they can modify the test parameters. Here are the current variables that Avocado exports to the tests: @@ -673,6 +674,8 @@ Here are the current variables that Avocado exports to the tests: +-------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------+ | AVOCADO_TEST_SYSINFODIR | The system information directory | $HOME/logs/job-results/job-2014-09-16T14.38-ac332e6/test-results/home.rmoura.my_test.sh.1/sysinfo | +-------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------+ +| * | All variables from --multiplex-file | TIMEOUT=60; IO_WORKERS=10; VM_BYTES=512M; ... | ++-------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------+ Wrap Up ======= diff --git a/examples/tests/env_variables.sh b/examples/tests/env_variables.sh index 79ef034bd5abf92640df60a15eff9c86b4ad168c..8326aa84aa70240c7dfa78a319fd601b00cf4fed 100755 --- a/examples/tests/env_variables.sh +++ b/examples/tests/env_variables.sh @@ -10,6 +10,7 @@ echo "Avocado Test logdir: $AVOCADO_TEST_LOGDIR" echo "Avocado Test logfile: $AVOCADO_TEST_LOGFILE" echo "Avocado Test outputdir: $AVOCADO_TEST_OUTPUTDIR" echo "Avocado Test sysinfodir: $AVOCADO_TEST_SYSINFODIR" +echo "Custom variable: $CUSTOM_VARIABLE" test -d "$AVOCADO_TEST_BASEDIR" -a \ -d "$AVOCADO_TEST_WORKDIR" -a \