Tests: unitd stderr output redirected to unit.log.
A part of the debug log was printed to stderr before the log file was opened. Now, this output is redirected to the same log file.
This commit is contained in:
@@ -209,19 +209,19 @@ class TestUnit(unittest.TestCase):
|
|||||||
|
|
||||||
os.mkdir(self.testdir + '/state')
|
os.mkdir(self.testdir + '/state')
|
||||||
|
|
||||||
print()
|
with open(self.testdir + '/unit.log', 'w') as log:
|
||||||
|
self._p = subprocess.Popen(
|
||||||
self._p = subprocess.Popen(
|
[
|
||||||
[
|
self.unitd,
|
||||||
self.unitd,
|
'--no-daemon',
|
||||||
'--no-daemon',
|
'--modules', self.pardir + '/build',
|
||||||
'--modules', self.pardir + '/build',
|
'--state', self.testdir + '/state',
|
||||||
'--state', self.testdir + '/state',
|
'--pid', self.testdir + '/unit.pid',
|
||||||
'--pid', self.testdir + '/unit.pid',
|
'--log', self.testdir + '/unit.log',
|
||||||
'--log', self.testdir + '/unit.log',
|
'--control', 'unix:' + self.testdir + '/control.unit.sock',
|
||||||
'--control', 'unix:' + self.testdir + '/control.unit.sock',
|
],
|
||||||
]
|
stderr=log,
|
||||||
)
|
)
|
||||||
|
|
||||||
if not self.waitforfiles(self.testdir + '/control.unit.sock'):
|
if not self.waitforfiles(self.testdir + '/control.unit.sock'):
|
||||||
exit("Could not start unit")
|
exit("Could not start unit")
|
||||||
|
|||||||
Reference in New Issue
Block a user