Do not swallow stdout from storlet daemons
Change-Id: If93917303ca993dba6762cbe2310b09c2919da1d Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
@@ -132,10 +132,10 @@ class StorletDaemonFactory(SBusServer):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
daemon_p = subprocess.Popen(
|
daemon_p = subprocess.Popen(
|
||||||
pargs, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE,
|
pargs, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
|
||||||
close_fds=True, shell=False, env=env)
|
close_fds=True, shell=False, env=env)
|
||||||
logger_p = subprocess.Popen(
|
logger_p = subprocess.Popen(
|
||||||
'logger', stdin=daemon_p.stderr,
|
'logger', stdin=daemon_p.stdout,
|
||||||
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
|
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
|
||||||
close_fds=True, shell=False)
|
close_fds=True, shell=False)
|
||||||
except OSError:
|
except OSError:
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ class TestStorletDaemonFactory(unittest.TestCase):
|
|||||||
def __init__(self, pid):
|
def __init__(self, pid):
|
||||||
self.pid = pid
|
self.pid = pid
|
||||||
self.stderr = mock.MagicMock()
|
self.stderr = mock.MagicMock()
|
||||||
|
self.stdout = mock.MagicMock()
|
||||||
|
|
||||||
with mock.patch(self.os_path_isfile_path) as isfile, \
|
with mock.patch(self.os_path_isfile_path) as isfile, \
|
||||||
mock.patch(self.os_access_path) as access, \
|
mock.patch(self.os_access_path) as access, \
|
||||||
@@ -253,6 +254,7 @@ class TestStorletDaemonFactory(unittest.TestCase):
|
|||||||
def __init__(self, pid):
|
def __init__(self, pid):
|
||||||
self.pid = pid
|
self.pid = pid
|
||||||
self.stderr = mock.MagicMock()
|
self.stderr = mock.MagicMock()
|
||||||
|
self.stdout = mock.MagicMock()
|
||||||
|
|
||||||
with mock.patch(self.os_path_isfile_path) as isfile, \
|
with mock.patch(self.os_path_isfile_path) as isfile, \
|
||||||
mock.patch(self.os_access_path) as access, \
|
mock.patch(self.os_access_path) as access, \
|
||||||
@@ -559,6 +561,7 @@ class TestStorletDaemonFactory(unittest.TestCase):
|
|||||||
def __init__(self, pid):
|
def __init__(self, pid):
|
||||||
self.pid = pid
|
self.pid = pid
|
||||||
self.stderr = mock.MagicMock()
|
self.stderr = mock.MagicMock()
|
||||||
|
self.stdout = mock.MagicMock()
|
||||||
|
|
||||||
with mock.patch(self.os_path_isfile_path) as isfile, \
|
with mock.patch(self.os_path_isfile_path) as isfile, \
|
||||||
mock.patch(self.os_access_path) as access, \
|
mock.patch(self.os_access_path) as access, \
|
||||||
|
|||||||
Reference in New Issue
Block a user