提交 af2c55aa 编写于 作者: L Lucas Meneghel Rodrigues

Merge pull request #288 from ldoktor/envtest

avocado.test: Support params passing to DropinTests [v2]
......@@ -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)
......
......@@ -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)
......
......@@ -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
=======
......
......@@ -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 \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册