diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2015-01-25 14:20:10 +0000 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2015-07-07 21:01:09 +0100 |
commit | 4a0a3f9607006d402713320fc31780fb54556e6a (patch) | |
tree | d4d311f148584d3a0ab670dc455ab30c1afb91b3 /tests/utilities_tests.py | |
parent | c4957d8aa4ea35f879639726267043f6bb46cc7c (diff) | |
download | sos-4a0a3f9607006d402713320fc31780fb54556e6a.tar.gz |
[utilities] add chroot support to sos_get_command_output()
Allow callers of sos_get_command_output() to specify a path to
chroot into before executing command.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Diffstat (limited to 'tests/utilities_tests.py')
-rw-r--r-- | tests/utilities_tests.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/utilities_tests.py b/tests/utilities_tests.py index 607056e7..9327b1f9 100644 --- a/tests/utilities_tests.py +++ b/tests/utilities_tests.py @@ -68,6 +68,11 @@ class ExecutableTest(unittest.TestCase): self.assertEquals(result['status'], 127) self.assertEquals(result['output'], "") + def test_output_chdir(self): + result = sos_get_command_output("/usr/bin/pwd", chdir=TEST_DIR) + self.assertEquals(result['status'], 0) + self.assertEquals(result['output'].strip(), TEST_DIR) + def test_shell_out(self): path = os.path.join(TEST_DIR, 'test_exe.py') self.assertEquals("executed\n", shell_out(path)) |