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>

also pull in release note fix: I49ef946aa53075c2c022619d0dfad18a3ce7b39e
(cherry picked from commit 2858989f2b)

also pull in requirements fix for oslo.db
I31abf319a43346b18b29f6217ca1d7764ef48db8
(cherry picked from commit ba56a0fadf)

also pull in Fix expecting content-type headers:
I0583a8cedfecb9353d23978269f8a6f1fee171a4
(cherry picked from commit dc681f4c13)

Change-Id: I648bf6b8f216d18ba7bc1f243615adde3f069c16
(cherry picked from commit 3f4f637ec2
This commit is contained in:
Ilya Tyaptin 2016-12-15 15:26:48 +04:00 committed by gord chung
parent aa2c31369b
commit 5dd569dd61
6 changed files with 15 additions and 9 deletions

View File

@ -43,7 +43,7 @@ tests:
status: 201
response_headers:
location: /$SCHEME://$NETLOC/v2/alarms/
content-type: application/json; charset=UTF-8
content-type: application/json
response_json_paths:
$.severity: low
$.threshold_rule.threshold: 300.0
@ -59,7 +59,7 @@ tests:
$.threshold_rule.threshold: 300.0
$.threshold_rule.comparison_operator: eq
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
- name: updateAlarm
desc: Updates a specified alarm.
@ -112,7 +112,7 @@ tests:
url: /v2/alarms/$RESPONSE['$[0].alarm_id']/state
method: GET
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_json_paths:
$: alarm

View File

@ -10,7 +10,7 @@ tests:
- name: quick root check
url: /
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_strings:
- '"base": "application/json"'
response_json_paths:

View File

@ -52,11 +52,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 = ("[DEFAULT]\n"
@ -72,13 +73,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 BinApiTestCase(base.BaseTestCase):

View File

@ -272,3 +272,6 @@ texinfo_documents = [
# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False
# -- Options for Internationalization output ------------------------------
locale_dirs = ['locale/']

View File

@ -9,7 +9,7 @@ keystonemiddleware>=2.2.0
gnocchiclient>=2.1.0 # Apache-2.0
lxml>=2.3
oslo.context>=0.2.0 # Apache-2.0
oslo.db>=1.12.0 # Apache-2.0
oslo.db>=1.12.0,!=4.13.1,!=4.13.2,!=4.15.0 # Apache-2.0
oslo.config>=2.6.0 # Apache-2.0
oslo.i18n>=1.5.0 # Apache-2.0
oslo.log>=1.2.0 # Apache-2.0

View File

@ -60,6 +60,7 @@ test =
fixtures>=1.3.1
mock>=1.0
testrepository>=0.0.18
testresources>=0.2.4 # Apache-2.0/BSD
testtools>=1.4.0
gabbi>=0.12.0 # Apache-2.0
# Provides subunit-trace