提交 cbfd2bd3 编写于 作者: C Cleber Rosa

Limit SimpleTest to "file" and "variant" data file sources

Simple tests are defined as an executable that can either return 0
for success, or non-zero for failures.  This means that it doesn't
support multiple tests on a single file.  But, it can be run with
variants.  This means that the possible sources for data files
are "variants" and "file".
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 53445a82
...@@ -1021,12 +1021,17 @@ class SimpleTest(Test): ...@@ -1021,12 +1021,17 @@ class SimpleTest(Test):
Run an arbitrary command that returns either 0 (PASS) or !=0 (FAIL). Run an arbitrary command that returns either 0 (PASS) or !=0 (FAIL).
""" """
DATA_SOURCES = ["variant", "file"]
re_avocado_log = re.compile(r'^\d\d:\d\d:\d\d DEBUG\| \[stdout\]' re_avocado_log = re.compile(r'^\d\d:\d\d:\d\d DEBUG\| \[stdout\]'
r' \d\d:\d\d:\d\d WARN \|') r' \d\d:\d\d:\d\d WARN \|')
def __init__(self, name, params=None, base_logdir=None, job=None): def __init__(self, name, params=None, base_logdir=None, job=None):
super(SimpleTest, self).__init__(name=name, params=params, super(SimpleTest, self).__init__(name=name, params=params,
base_logdir=base_logdir, job=job) base_logdir=base_logdir, job=job)
self._data_sources_mapping = {"variant": [lambda: self.datadir,
lambda: self.name.variant],
"file": [lambda: self.datadir]}
self._command = None self._command = None
if self.filename is not None: if self.filename is not None:
self._command = pipes.quote(self.filename) self._command = pipes.quote(self.filename)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册