From ecc0b0770cf34e00ac99cb2c17bb3014066fc747 Mon Sep 17 00:00:00 2001 From: Jeroen Hoekx Date: Tue, 15 May 2012 14:26:43 +0200 Subject: [PATCH] If /usr/share/dict/words does not exist, use cracklib-small to test large output. --- test/TestRunner.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/TestRunner.py b/test/TestRunner.py index be59be3b11b..e97e9d6ce4c 100644 --- a/test/TestRunner.py +++ b/test/TestRunner.py @@ -164,8 +164,13 @@ class TestRunner(unittest.TestCase): assert result['rc'] == 0 def test_large_output(self): + large_path = "/usr/share/dict/words" + if not os.path.exists(large_path): + large_path = "/usr/share/dict/cracklib-small" + if not os.path.exists(large_path): + raise SkipTest # Ensure reading a large amount of output from a command doesn't hang. - result = self._run('command', [ "/bin/cat", "/usr/share/dict/words" ]) + result = self._run('command', [ "/bin/cat", large_path ]) assert "failed" not in result assert "msg" not in result assert result['rc'] == 0