From 7aa03342d8a1a5398b976ab8afdab3387e21140c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= Date: Sun, 9 Oct 2016 19:54:49 +0200 Subject: [PATCH] selftests: Add /bin/read selftest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Lukáš Doktor --- selftests/functional/test_basic.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/selftests/functional/test_basic.py b/selftests/functional/test_basic.py index 09375d9f..a97946ca 100644 --- a/selftests/functional/test_basic.py +++ b/selftests/functional/test_basic.py @@ -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) -- GitLab