提交 7aa03342 编写于 作者: L Lukáš Doktor

selftests: Add /bin/read selftest

Recently I fixed a bug where test which asks for input hangs for
infinity but I forgot to add unittest for it. Let's add it now.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 d742823d
......@@ -488,6 +488,18 @@ class RunnerOperationTest(unittest.TestCase):
self.assertIn('1-%s:MyTest.test_my_name -> TestError' % test,
result.stdout)
@unittest.skipIf(missing_binary("read"),
"read binary not available.")
def test_read(self):
cmd = utils_path.find_command("read")
os.chdir(basedir)
result = process.run("./scripts/avocado run %s" % cmd, timeout=10,
ignore_status=True)
self.assertLess(result.duration, 8, "Duration longer than expected."
"\n%s" % result)
self.assertEqual(result.exit_status, 1, "Expected exit status is 1\n%s"
% result)
def tearDown(self):
shutil.rmtree(self.tmpdir)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册