Merge "Add a check for compute api versions to verify_tempest_config"
This commit is contained in:
commit
29269a641e
@ -14,13 +14,17 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
import sys
|
||||
|
||||
import httplib2
|
||||
|
||||
from tempest import clients
|
||||
from tempest import config
|
||||
|
||||
|
||||
CONF = config.CONF
|
||||
RAW_HTTP = httplib2.Http()
|
||||
|
||||
|
||||
def verify_glance_api_versions(os):
|
||||
@ -35,6 +39,19 @@ def verify_glance_api_versions(os):
|
||||
not CONF.image_feature_enabled.api_v2))
|
||||
|
||||
|
||||
def verify_nova_api_versions(os):
|
||||
# Check nova api versions
|
||||
os.servers_client._set_auth()
|
||||
v2_endpoint = os.servers_client.base_url
|
||||
endpoint = 'http://' + v2_endpoint.split('/')[2]
|
||||
__, body = RAW_HTTP.request(endpoint, 'GET')
|
||||
body = json.loads(body)
|
||||
versions = map(lambda x: x['id'], body['versions'])
|
||||
if CONF.compute_feature_enabled.api_v3 != ('v3.0' in versions):
|
||||
print('Config option compute api_v3 should be change to: %s' % (
|
||||
not CONF.compute_feature_enabled.api_v3))
|
||||
|
||||
|
||||
def get_extension_client(os, service):
|
||||
extensions_client = {
|
||||
'nova': os.extensions_client,
|
||||
@ -117,6 +134,7 @@ def main(argv):
|
||||
for service in ['nova', 'nova_v3', 'cinder', 'neutron']:
|
||||
results = verify_extensions(os, service, results)
|
||||
verify_glance_api_versions(os)
|
||||
verify_nova_api_versions(os)
|
||||
display_results(results)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user