Fix the gate failure because of several issues

1. Fix expecting content-type headers in gabbit tests, the headers don't
contain the  charset anymore, just remove it.

2. Use 'endpoint_type' instead of 'interface' while init  novaclient,
because novaclient has deprecated the name 'interface', see[1].

3. Don't use novaclient.HTTPClient, since the 'HTTPCLient' has been
deprecated in novaclient, see[2].

[1] https://review.openstack.org/#/c/406299/
[2] https://review.openstack.org/#/c/408728/

Closes-Bug: #1652414
Change-Id: I33f2dd9303b93391ff40d77cf93e6e285c983287
Co-Authored-By: Hanxi Liu <hanxi.liu@easystack.cn>
Co-Authored-By: liusheng <liusheng@huawei.com>
This commit is contained in:
Julien Danjou 2016-12-22 13:06:48 +01:00 committed by liusheng
parent e361f34d5e
commit c0e42f00af
8 changed files with 31 additions and 38 deletions

View File

@ -72,7 +72,7 @@ class Client(object):
# nova adapter options
region_name=creds.region_name,
interface=creds.interface,
endpoint_type=creds.interface,
service_type=conf.service_types.nova,
logger=logger)

View File

@ -14,7 +14,7 @@ tests:
X-User-Id: user1
X-Project-Id: project1
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_strings:
- "[]"
@ -68,7 +68,7 @@ tests:
X-User-Id: user1
X-Project-Id: project1
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_strings:
- "[]"
@ -77,7 +77,7 @@ tests:
- name: get events that match query via request data
url: /v2/events
request_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
X-Roles: admin
X-User-Id: user1
X-Project-Id: project1
@ -88,7 +88,7 @@ tests:
type: string
value: cookies_chocolate.chip
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_strings:
- "[]"
@ -101,7 +101,7 @@ tests:
X-User-Id: user1
X-Project-Id: project1
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_strings:
- "[]"
@ -110,7 +110,7 @@ tests:
- name: get events that match bad query via request data
url: /v2/events
request_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
X-Roles: admin
X-User-Id: user1
X-Project-Id: project1
@ -121,7 +121,7 @@ tests:
type: string
value: cookies_chocolate.chip
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_strings:
- "[]"
@ -130,7 +130,7 @@ tests:
- name: get events that match bad query via request data malformed list
url: /v2/events
request_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
X-Roles: admin
X-User-Id: user1
X-Project-Id: project1
@ -172,7 +172,7 @@ tests:
X-User-Id: user1
X-Project-Id: project1
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_strings:
- "[]"
@ -193,7 +193,7 @@ tests:
X-User-Id: user1
X-Project-Id: project1
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_strings:
- "[]"
@ -205,6 +205,6 @@ tests:
X-User-Id: user1
X-Project-Id: project1
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_strings:
- "[]"

View File

@ -13,7 +13,7 @@ tests:
X-User-Id: user1
X-Project-Id: project1
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_json_paths:
$.[0].event_type: cookies_chocolate.chip
$.[0].traits.[0].value: chocolate.chip
@ -46,7 +46,7 @@ tests:
X-User-Id: user1
X-Project-Id: project1
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_json_paths:
$.[0].event_type: cookies_chocolate.chip
$.[0].traits.[0].value: chocolate.chip
@ -56,7 +56,7 @@ tests:
- name: get events that match query via data
url: /v2/events
request_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
X-Roles: admin
X-User-Id: user1
X-Project-Id: project1
@ -67,7 +67,7 @@ tests:
type: string
value: cookies_chocolate.chip
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_json_paths:
$.[0].event_type: cookies_chocolate.chip
$.[0].traits.[0].value: chocolate.chip
@ -81,7 +81,7 @@ tests:
X-User-Id: user1
X-Project-Id: project1
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_strings:
- "[]"
@ -90,7 +90,7 @@ tests:
- name: get events that match bad query via data
url: /v2/events
request_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
X-Roles: admin
X-User-Id: user1
X-Project-Id: project1
@ -101,7 +101,7 @@ tests:
type: string
value: cookies_chocolate.chip
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_strings:
- "[]"
@ -110,7 +110,7 @@ tests:
- name: get events that match bad query via data list
url: /v2/events
request_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
X-Roles: admin
X-User-Id: user1
X-Project-Id: project1
@ -129,7 +129,7 @@ tests:
X-User-Id: user1
X-Project-Id: project1
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_json_paths:
$.event_type: cookies_chocolate.chip
$.traits.[0].value: chocolate.chip
@ -152,7 +152,7 @@ tests:
X-User-Id: user1
X-Project-Id: project1
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_strings:
- cookies_chocolate.chip
- cookies_peanut.butter
@ -184,7 +184,7 @@ tests:
X-User-Id: user1
X-Project-Id: project1
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_json_paths:
$.[0].type: string
$.[1].name: ate
@ -197,7 +197,7 @@ tests:
X-User-Id: user1
X-Project-Id: project1
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_strings:
- "[]"
@ -210,7 +210,7 @@ tests:
X-User-Id: user1
X-Project-Id: project1
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_json_paths:
$.[0].name: ate
$.[0].value: '0'
@ -224,7 +224,7 @@ tests:
X-User-Id: user1
X-Project-Id: project1
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_strings:
- "[]"
@ -237,6 +237,6 @@ tests:
X-User-Id: user1
X-Project-Id: project1
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
response_strings:
- "[]"

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

@ -33,7 +33,7 @@ tests:
$.[0].counter_name: apples
status: 201
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
# When POSTing a sample perhaps we should get back a location header
# with the URI of the posted sample

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

@ -34,7 +34,7 @@ tests:
$.[0].counter_name: apples
status: 201
response_headers:
content-type: application/json; charset=UTF-8
content-type: application/json
- name: get resources
desc: get the resources that exist because of the sample

View File

@ -18,12 +18,10 @@ import shutil
from keystoneauth1 import exceptions as ka_exceptions
import mock
from novaclient import client as novaclient
from oslo_config import fixture as fixture_config
from oslo_utils import fileutils
from oslotest import base
from oslotest import mockpatch
import requests
import six
from stevedore import extension
import yaml
@ -325,11 +323,6 @@ class TestRunTasks(agentbase.BaseAgentManagerTestCase):
@mock.patch('ceilometer.agent.manager.LOG')
@mock.patch('ceilometer.nova_client.LOG')
def test_hardware_discover_fail_minimize_logs(self, novalog, baselog):
self.useFixture(mockpatch.PatchObject(
novaclient.HTTPClient,
'authenticate',
side_effect=requests.ConnectionError))
class PollsterHardware(agentbase.TestPollster):
discovery = 'tripleo_overcloud_nodes'