read data from stdout instead of stderr

As oslo.log upgrades to 3.17.0, the `use_stderr` now defaults to False.

Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>

Change-Id: I648bf6b8f216d18ba7bc1f243615adde3f069c16
This commit is contained in:
dongwenjuan 2016-10-20 07:20:29 +01:00
parent d3567a56bb
commit 3f4f637ec2

View File

@ -47,11 +47,12 @@ class BinTestCase(base.BaseTestCase):
subp = subprocess.Popen(['aodh-expirer',
'-d',
"--config-file=%s" % self.tempfile],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
__, err = subp.communicate()
out, __ = subp.communicate()
self.assertEqual(0, subp.poll())
self.assertIn(b"Nothing to clean, database alarm history "
b"time to live is disabled", err)
b"time to live is disabled", out)
def test_run_expirer_ttl_enabled(self):
content = ("[database]\n"
@ -65,13 +66,14 @@ class BinTestCase(base.BaseTestCase):
subp = subprocess.Popen(['aodh-expirer',
'-d',
"--config-file=%s" % self.tempfile],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
__, err = subp.communicate()
out, __ = subp.communicate()
self.assertEqual(0, subp.poll())
msg = "Dropping alarm history data with TTL 1"
if six.PY3:
msg = msg.encode('utf-8')
self.assertIn(msg, err)
self.assertIn(msg, out)
class BinEvaluatorTestCase(base.BaseTestCase):