selftests: Add additional stdout/stderr checks

More checks to make sure we are not outputting errors to
the wrong loggers.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 19fdee9d
......@@ -170,12 +170,14 @@ class RunnerOperationTest(unittest.TestCase):
expected_rc = 2
self.assertEqual(result.exit_status, expected_rc)
self.assertIn('File not found', result.stderr)
self.assertNotIn('File not found', result.stdout)
def test_invalid_unique_id(self):
cmd_line = './scripts/avocado run --sysinfo=off --force-job-id foobar skiptest'
result = process.run(cmd_line, ignore_status=True)
self.assertNotEqual(0, result.exit_status)
self.assertIn('needs to be a 40 digit hex', result.stderr)
self.assertNotIn('needs to be a 40 digit hex', result.stdout)
def test_valid_unique_id(self):
cmd_line = './scripts/avocado run --sysinfo=off --force-job-id 975de258ac05ce5e490648dec4753657b7ccc7d1 skiptest'
......
......@@ -78,6 +78,7 @@ class LoaderTestFunctional(unittest.TestCase):
"Avocado did not return rc %d:\n%s" %
(expected_rc, result))
self.assertIn('is not an avocado test', result.stderr)
self.assertNotIn('is not an avocado test', result.stdout)
simple_test.remove()
def test_pass(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册