diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2014-10-20 15:37:48 -0500 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2014-10-20 15:37:48 -0500 |
commit | 56d2b72b6f8b2e1a27a16dbfdab10f0b83816ceb (patch) | |
tree | 8b556c58cc39a8dafc2b374b3ee0bbbd57af98d9 /testsuite/Testsrc/Testlib/TestClient | |
parent | 541c6cd3a549942b9729ae144402ce65364e8921 (diff) | |
download | bcfg2-56d2b72b6f8b2e1a27a16dbfdab10f0b83816ceb.tar.gz bcfg2-56d2b72b6f8b2e1a27a16dbfdab10f0b83816ceb.tar.bz2 bcfg2-56d2b72b6f8b2e1a27a16dbfdab10f0b83816ceb.zip |
Fixed client tool tests on systems without /bin/true
Diffstat (limited to 'testsuite/Testsrc/Testlib/TestClient')
-rw-r--r-- | testsuite/Testsrc/Testlib/TestClient/TestTools/Test_init.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/testsuite/Testsrc/Testlib/TestClient/TestTools/Test_init.py b/testsuite/Testsrc/Testlib/TestClient/TestTools/Test_init.py index 0c059b5f3..0e9e3a141 100644 --- a/testsuite/Testsrc/Testlib/TestClient/TestTools/Test_init.py +++ b/testsuite/Testsrc/Testlib/TestClient/TestTools/Test_init.py @@ -17,6 +17,14 @@ while path != "/": path = os.path.dirname(path) from common import * +# try to find true +if os.path.exists("/bin/true"): + TRUE = "/bin/true" +elif os.path.exists("/usr/bin/true"): + TRUE = "/usr/bin/true" +else: + TRUE = None + class TestTool(Bcfg2TestCase): test_obj = Tool @@ -69,10 +77,11 @@ class TestTool(Bcfg2TestCase): ["/test"] + [e.get("name") for e in important]) t.getSupportedEntries.assert_called_with() + @skipIf(TRUE is None, "/bin/true or equivalent not found") def test__check_execs(self): t = self.get_obj() if t.__execs__ == []: - t.__execs__.append("/bin/true") + t.__execs__.append(TRUE) @patch("os.stat") def inner(mock_stat): |