avocado.job.py: Change test name resolution

So avocado can correctly find data files for a test that
is referenced by its alias.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 9929dfe5
......@@ -79,9 +79,11 @@ class TestRunner(object):
module_name = os.path.basename(test_path).split('.')[0]
if not os.path.exists(test_path):
# Try to resolve test ID (keep compatibility)
test_path = os.path.join(data_dir.get_test_dir(), '%s.py' % t_id)
rel_path = '%s.py' % t_id
test_path = os.path.join(data_dir.get_test_dir(), rel_path)
if os.path.exists(test_path):
path_analyzer = path.PathInspector(test_path)
t_id = rel_path
else:
test_class = test.MissingTest
test_instance = test_class(name=t_id,
......
......@@ -84,9 +84,9 @@ class RunnerOperationTest(unittest.TestCase):
"Avocado did not return rc %d:\n%s" % (expected_rc, result))
self.assertIn("TestError: Failing during cleanup. Yay!", output,
"Cleanup exception not printed to log output")
self.assertIn("FAIL doublefail -> TestFail: This test is supposed to fail",
self.assertIn("TestFail: This test is supposed to fail",
output,
"Test did not fail with action exception")
"Test did not fail with action exception:\n%s" % output)
def test_runner_timeout(self):
os.chdir(basedir)
......@@ -99,9 +99,9 @@ class RunnerOperationTest(unittest.TestCase):
"Avocado crashed (rc %d):\n%s" % (unexpected_rc, result))
self.assertEqual(result.exit_status, expected_rc,
"Avocado did not return rc %d:\n%s" % (expected_rc, result))
self.assertIn("ERROR timeouttest -> TestTimeoutError: Timeout reached waiting for timeouttest to end",
self.assertIn("TestTimeoutError: Timeout reached waiting for",
output,
"Test did not fail with timeout exception")
"Test did not fail with timeout exception:\n%s" % output)
def test_runner_abort(self):
os.chdir(basedir)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册