diff options
author | Andrey Zelenkov <zelenkov@nginx.com> | 2019-04-09 20:59:41 +0300 |
---|---|---|
committer | Andrey Zelenkov <zelenkov@nginx.com> | 2019-04-09 20:59:41 +0300 |
commit | ac7e65a722d38786c63716c026ab588e3d205a25 (patch) | |
tree | 485be285674869cf6c4c4bb0daf4aa60fc5a7412 /test/unit | |
parent | dfb625789b28fc35acded446aece0f962b5ab2bb (diff) | |
download | unit-ac7e65a722d38786c63716c026ab588e3d205a25.tar.gz unit-ac7e65a722d38786c63716c026ab588e3d205a25.tar.bz2 |
Tests: check unitd availability before start.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/main.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/unit/main.py b/test/unit/main.py index 2ab0626b..bd91026f 100644 --- a/test/unit/main.py +++ b/test/unit/main.py @@ -142,7 +142,7 @@ class TestUnit(unittest.TestCase): subprocess.check_output(['which', 'openssl']) output = subprocess.check_output( - [self.pardir + '/build/unitd', '--version'], + [self.unitd, '--version'], stderr=subprocess.STDOUT, ) @@ -170,6 +170,11 @@ class TestUnit(unittest.TestCase): self._stop() def _run(self): + self.unitd = self.pardir + '/build/unitd' + + if not os.path.isfile(self.unitd): + exit("Could not find unit") + self.testdir = tempfile.mkdtemp(prefix='unit-test-') os.mkdir(self.testdir + '/state') @@ -179,7 +184,7 @@ class TestUnit(unittest.TestCase): def _run_unit(): subprocess.call( [ - self.pardir + '/build/unitd', + self.unitd, '--no-daemon', '--modules', self.pardir + '/build', '--state', self.testdir + '/state', |