Tests: check unitd availability before start.
This commit is contained in:
@@ -142,7 +142,7 @@ class TestUnit(unittest.TestCase):
|
|||||||
subprocess.check_output(['which', 'openssl'])
|
subprocess.check_output(['which', 'openssl'])
|
||||||
|
|
||||||
output = subprocess.check_output(
|
output = subprocess.check_output(
|
||||||
[self.pardir + '/build/unitd', '--version'],
|
[self.unitd, '--version'],
|
||||||
stderr=subprocess.STDOUT,
|
stderr=subprocess.STDOUT,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -170,6 +170,11 @@ class TestUnit(unittest.TestCase):
|
|||||||
self._stop()
|
self._stop()
|
||||||
|
|
||||||
def _run(self):
|
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-')
|
self.testdir = tempfile.mkdtemp(prefix='unit-test-')
|
||||||
|
|
||||||
os.mkdir(self.testdir + '/state')
|
os.mkdir(self.testdir + '/state')
|
||||||
@@ -179,7 +184,7 @@ class TestUnit(unittest.TestCase):
|
|||||||
def _run_unit():
|
def _run_unit():
|
||||||
subprocess.call(
|
subprocess.call(
|
||||||
[
|
[
|
||||||
self.pardir + '/build/unitd',
|
self.unitd,
|
||||||
'--no-daemon',
|
'--no-daemon',
|
||||||
'--modules', self.pardir + '/build',
|
'--modules', self.pardir + '/build',
|
||||||
'--state', self.testdir + '/state',
|
'--state', self.testdir + '/state',
|
||||||
|
|||||||
Reference in New Issue
Block a user