diff options
author | Jesse Jaggars <jjaggars@redhat.com> | 2012-03-20 13:37:34 -0500 |
---|---|---|
committer | Jesse Jaggars <jjaggars@redhat.com> | 2012-03-20 13:37:34 -0500 |
commit | 2300c2e0d61ad6a241e82ffbcfcb72822f1f70ee (patch) | |
tree | b0732216bcd649c20b7a8cd5e448709255ba4b04 /tests | |
parent | 8e1e383fe952c661f1e3feda68b31f82268e65e3 (diff) | |
download | sos-2300c2e0d61ad6a241e82ffbcfcb72822f1f70ee.tar.gz |
using /usr/bin/timeout if it's there
Diffstat (limited to 'tests')
-rw-r--r-- | tests/utilities_tests.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/utilities_tests.py b/tests/utilities_tests.py index 24bc950b..fd9699fe 100644 --- a/tests/utilities_tests.py +++ b/tests/utilities_tests.py @@ -2,7 +2,7 @@ import os.path import unittest from StringIO import StringIO -from sos.utilities import grep, DirTree, checksum, get_hash_name, is_executable, sosGetCommandOutput, find, tail +from sos.utilities import grep, DirTree, checksum, get_hash_name, is_executable, sosGetCommandOutput, find, tail, shell_out import sos TEST_DIR = os.path.dirname(__file__) @@ -71,6 +71,9 @@ class ExecutableTest(unittest.TestCase): path = os.path.join(TEST_DIR, 'test_exe.py') self.assertTrue(is_executable(path)) + def test_exe_file_abs_path(self): + self.assertTrue(is_executable("/usr/bin/timeout")) + def test_output(self): path = os.path.join(TEST_DIR, 'test_exe.py') ret, out, junk = sosGetCommandOutput(path) @@ -83,6 +86,10 @@ class ExecutableTest(unittest.TestCase): self.assertEquals(ret, 127) self.assertEquals(out, "") + def test_shell_out(self): + path = os.path.join(TEST_DIR, 'test_exe.py') + self.assertEquals("executed", shell_out(path)) + class FindTest(unittest.TestCase): |