Upgrade Watcher Tempest tests for multinode
Change-Id: I4b84ba9814227776232c8ab883cdaaf411930ee6
This commit is contained in:
@@ -123,6 +123,8 @@ function create_watcher_conf {
|
|||||||
iniset $WATCHER_CONF oslo_messaging_rabbit rabbit_password $RABBIT_PASSWORD
|
iniset $WATCHER_CONF oslo_messaging_rabbit rabbit_password $RABBIT_PASSWORD
|
||||||
iniset $WATCHER_CONF oslo_messaging_rabbit rabbit_host $RABBIT_HOST
|
iniset $WATCHER_CONF oslo_messaging_rabbit rabbit_host $RABBIT_HOST
|
||||||
|
|
||||||
|
iniset $WATCHER_CONF watcher_goals goals "DUMMY:dummy,BASIC_CONSOLIDATION:basic"
|
||||||
|
|
||||||
configure_auth_token_middleware $WATCHER_CONF watcher $WATCHER_AUTH_CACHE_DIR
|
configure_auth_token_middleware $WATCHER_CONF watcher $WATCHER_AUTH_CACHE_DIR
|
||||||
configure_auth_token_middleware $WATCHER_CONF watcher $WATCHER_AUTH_CACHE_DIR "watcher_clients_auth"
|
configure_auth_token_middleware $WATCHER_CONF watcher $WATCHER_AUTH_CACHE_DIR "watcher_clients_auth"
|
||||||
|
|
||||||
|
|||||||
@@ -29,17 +29,14 @@ CONF = config.CONF
|
|||||||
@six.add_metaclass(abc.ABCMeta)
|
@six.add_metaclass(abc.ABCMeta)
|
||||||
class BaseManager(clients.Manager):
|
class BaseManager(clients.Manager):
|
||||||
|
|
||||||
def __init__(self, credentials, service=None, api_microversions=None):
|
def __init__(self, credentials):
|
||||||
super(BaseManager, self).__init__(
|
super(BaseManager, self).__init__(credentials)
|
||||||
credentials, service, api_microversions)
|
|
||||||
self.io_client = ioc.InfraOptimClientJSON(
|
self.io_client = ioc.InfraOptimClientJSON(
|
||||||
self.auth_provider, 'infra-optim', CONF.identity.region)
|
self.auth_provider, 'infra-optim', CONF.identity.region)
|
||||||
|
|
||||||
|
|
||||||
class AdminManager(BaseManager):
|
class AdminManager(BaseManager):
|
||||||
def __init__(self, service=None, api_microversions=None):
|
def __init__(self):
|
||||||
super(AdminManager, self).__init__(
|
super(AdminManager, self).__init__(
|
||||||
creds_factory.get_configured_credentials('identity_admin'),
|
creds_factory.get_configured_credentials('identity_admin'),
|
||||||
service,
|
|
||||||
api_microversions
|
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import functools
|
|||||||
import six
|
import six
|
||||||
import six.moves.urllib.parse as urlparse
|
import six.moves.urllib.parse as urlparse
|
||||||
|
|
||||||
from tempest.common import service_client
|
from tempest.lib.common import rest_client
|
||||||
|
|
||||||
|
|
||||||
def handle_errors(f):
|
def handle_errors(f):
|
||||||
@@ -44,7 +44,7 @@ def handle_errors(f):
|
|||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
@six.add_metaclass(abc.ABCMeta)
|
||||||
class BaseInfraOptimClient(service_client.ServiceClient):
|
class BaseInfraOptimClient(rest_client.RestClient):
|
||||||
"""Base Tempest REST client for Watcher API."""
|
"""Base Tempest REST client for Watcher API."""
|
||||||
|
|
||||||
URI_PREFIX = ''
|
URI_PREFIX = ''
|
||||||
@@ -116,7 +116,7 @@ class BaseInfraOptimClient(service_client.ServiceClient):
|
|||||||
uri += "?%s" % urlparse.urlencode(kwargs)
|
uri += "?%s" % urlparse.urlencode(kwargs)
|
||||||
|
|
||||||
resp, body = self.get(uri)
|
resp, body = self.get(uri)
|
||||||
self.expected_success(200, resp['status'])
|
self.expected_success(200, int(resp['status']))
|
||||||
|
|
||||||
return resp, self.deserialize(body)
|
return resp, self.deserialize(body)
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ class BaseInfraOptimClient(service_client.ServiceClient):
|
|||||||
else:
|
else:
|
||||||
uri = self._get_uri(resource, uuid=uuid, permanent=permanent)
|
uri = self._get_uri(resource, uuid=uuid, permanent=permanent)
|
||||||
resp, body = self.get(uri)
|
resp, body = self.get(uri)
|
||||||
self.expected_success(200, resp['status'])
|
self.expected_success(200, int(resp['status']))
|
||||||
|
|
||||||
return resp, self.deserialize(body)
|
return resp, self.deserialize(body)
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ class BaseInfraOptimClient(service_client.ServiceClient):
|
|||||||
uri = self._get_uri(resource)
|
uri = self._get_uri(resource)
|
||||||
|
|
||||||
resp, body = self.post(uri, body=body)
|
resp, body = self.post(uri, body=body)
|
||||||
self.expected_success(201, resp['status'])
|
self.expected_success(201, int(resp['status']))
|
||||||
|
|
||||||
return resp, self.deserialize(body)
|
return resp, self.deserialize(body)
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ class BaseInfraOptimClient(service_client.ServiceClient):
|
|||||||
uri = self._get_uri(resource, uuid)
|
uri = self._get_uri(resource, uuid)
|
||||||
|
|
||||||
resp, body = self.delete(uri)
|
resp, body = self.delete(uri)
|
||||||
self.expected_success(204, resp['status'])
|
self.expected_success(204, int(resp['status']))
|
||||||
return resp, body
|
return resp, body
|
||||||
|
|
||||||
def _patch_request(self, resource, uuid, patch_object):
|
def _patch_request(self, resource, uuid, patch_object):
|
||||||
@@ -181,7 +181,7 @@ class BaseInfraOptimClient(service_client.ServiceClient):
|
|||||||
patch_body = self.serialize(patch_object)
|
patch_body = self.serialize(patch_object)
|
||||||
|
|
||||||
resp, body = self.patch(uri, body=patch_body)
|
resp, body = self.patch(uri, body=patch_body)
|
||||||
self.expected_success(200, resp['status'])
|
self.expected_success(200, int(resp['status']))
|
||||||
return resp, self.deserialize(body)
|
return resp, self.deserialize(body)
|
||||||
|
|
||||||
@handle_errors
|
@handle_errors
|
||||||
@@ -207,5 +207,5 @@ class BaseInfraOptimClient(service_client.ServiceClient):
|
|||||||
put_body = self.serialize(put_object)
|
put_body = self.serialize(put_object)
|
||||||
|
|
||||||
resp, body = self.put(uri, body=put_body)
|
resp, body = self.put(uri, body=put_body)
|
||||||
self.expected_success(202, resp['status'])
|
self.expected_success(202, int(resp['status']))
|
||||||
return resp, body
|
return resp, body
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
import functools
|
import functools
|
||||||
|
|
||||||
|
from tempest.lib import exceptions
|
||||||
from tempest import test
|
from tempest import test
|
||||||
from tempest_lib import exceptions as lib_exc
|
|
||||||
|
|
||||||
from watcher_tempest_plugin.tests.api.admin import base
|
from watcher_tempest_plugin.tests.api.admin import base
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ class TestCreateDeleteExecuteActionPlan(base.BaseInfraOptimTest):
|
|||||||
|
|
||||||
self.client.delete_action_plan(action_plan['uuid'])
|
self.client.delete_action_plan(action_plan['uuid'])
|
||||||
|
|
||||||
self.assertRaises(lib_exc.NotFound, self.client.show_action_plan,
|
self.assertRaises(exceptions.NotFound, self.client.show_action_plan,
|
||||||
action_plan['uuid'])
|
action_plan['uuid'])
|
||||||
|
|
||||||
@test.attr(type='smoke')
|
@test.attr(type='smoke')
|
||||||
|
|||||||
@@ -16,9 +16,9 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from tempest.lib import decorators
|
||||||
|
from tempest.lib import exceptions
|
||||||
from tempest import test
|
from tempest import test
|
||||||
from tempest_lib import decorators
|
|
||||||
from tempest_lib import exceptions as lib_exc
|
|
||||||
|
|
||||||
from watcher_tempest_plugin.tests.api.admin import base
|
from watcher_tempest_plugin.tests.api.admin import base
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ class TestCreateUpdateDeleteAudit(base.BaseInfraOptimTest):
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
lib_exc.BadRequest, self.create_audit, **audit_params)
|
exceptions.BadRequest, self.create_audit, **audit_params)
|
||||||
|
|
||||||
@decorators.skip_because(bug="1532843")
|
@decorators.skip_because(bug="1532843")
|
||||||
@test.attr(type='smoke')
|
@test.attr(type='smoke')
|
||||||
@@ -83,7 +83,7 @@ class TestCreateUpdateDeleteAudit(base.BaseInfraOptimTest):
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
lib_exc.BadRequest, self.create_audit, **audit_params)
|
exceptions.BadRequest, self.create_audit, **audit_params)
|
||||||
|
|
||||||
@decorators.skip_because(bug="1533210")
|
@decorators.skip_because(bug="1533210")
|
||||||
@test.attr(type='smoke')
|
@test.attr(type='smoke')
|
||||||
@@ -113,7 +113,8 @@ class TestCreateUpdateDeleteAudit(base.BaseInfraOptimTest):
|
|||||||
|
|
||||||
self.delete_audit(audit_uuid)
|
self.delete_audit(audit_uuid)
|
||||||
|
|
||||||
self.assertRaises(lib_exc.NotFound, self.client.show_audit, audit_uuid)
|
self.assertRaises(
|
||||||
|
exceptions.NotFound, self.client.show_audit, audit_uuid)
|
||||||
|
|
||||||
|
|
||||||
class TestShowListAudit(base.BaseInfraOptimTest):
|
class TestShowListAudit(base.BaseInfraOptimTest):
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
from tempest.lib import exceptions
|
||||||
from tempest import test
|
from tempest import test
|
||||||
from tempest_lib import exceptions as lib_exc
|
|
||||||
|
|
||||||
from watcher_tempest_plugin.tests.api.admin import base
|
from watcher_tempest_plugin.tests.api.admin import base
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ class TestCreateDeleteAuditTemplate(base.BaseInfraOptimTest):
|
|||||||
|
|
||||||
self.delete_audit_template(audit_uuid)
|
self.delete_audit_template(audit_uuid)
|
||||||
|
|
||||||
self.assertRaises(lib_exc.NotFound, self.client.show_audit_template,
|
self.assertRaises(exceptions.NotFound, self.client.show_audit_template,
|
||||||
audit_uuid)
|
audit_uuid)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user