From cbfd2bd36cc85fd73e7714442bdbfeba35cb8d10 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Fri, 13 Oct 2017 00:09:28 -0400 Subject: [PATCH] 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: Cleber Rosa --- avocado/core/test.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/avocado/core/test.py b/avocado/core/test.py index 81b78bcd..02ca4a9f 100644 --- a/avocado/core/test.py +++ b/avocado/core/test.py @@ -1021,12 +1021,17 @@ class SimpleTest(Test): 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\]' r' \d\d:\d\d:\d\d WARN \|') def __init__(self, name, params=None, base_logdir=None, job=None): super(SimpleTest, self).__init__(name=name, params=params, 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 if self.filename is not None: self._command = pipes.quote(self.filename) -- GitLab