Rename fuel package to fuel_health

This commit is contained in:
Tatyana Leontovich 2013-07-01 13:55:21 +03:00
parent 9178a3ac06
commit caa55c44ce
61 changed files with 152 additions and 187 deletions

View File

@ -1 +0,0 @@
__author__ = 'tleontovich'

View File

@ -1 +0,0 @@
__author__ = 'anaboikina'

View File

@ -5,7 +5,7 @@ import sys
path = os.getcwd()
sys.path.append(path)
from fuel import clients
from fuel_health import clients
def cleanup():

View File

@ -15,36 +15,36 @@
# License for the specific language governing permissions and limitations
# under the License.
from fuel.common import log as logging
from fuel import config
from fuel import exceptions
from fuel.services.compute.json.fixed_ips_client import FixedIPsClientJSON
from fuel.services.compute.json.flavors_client import FlavorsClientJSON
from fuel.services.compute.json.floating_ips_client import \
from fuel_health.common import log as logging
from fuel_health import config
from fuel_health import exceptions
from fuel_health.services.compute.json.fixed_ips_client import FixedIPsClientJSON
from fuel_health.services.compute.json.flavors_client import FlavorsClientJSON
from fuel_health.services.compute.json.floating_ips_client import \
FloatingIPsClientJSON
from fuel.services.compute.json.hosts_client import HostsClientJSON
from fuel.services.compute.json.hypervisor_client import \
from fuel_health.services.compute.json.hosts_client import HostsClientJSON
from fuel_health.services.compute.json.hypervisor_client import \
HypervisorClientJSON
from fuel.services.compute.json.images_client import ImagesClientJSON
from fuel.services.compute.json.interfaces_client import \
from fuel_health.services.compute.json.images_client import ImagesClientJSON
from fuel_health.services.compute.json.interfaces_client import \
InterfacesClientJSON
from fuel.services.compute.json.keypairs_client import KeyPairsClientJSON
from fuel.services.compute.json.limits_client import LimitsClientJSON
from fuel.services.compute.json.quotas_client import QuotasClientJSON
from fuel.services.compute.json.security_groups_client import \
from fuel_health.services.compute.json.keypairs_client import KeyPairsClientJSON
from fuel_health.services.compute.json.limits_client import LimitsClientJSON
from fuel_health.services.compute.json.quotas_client import QuotasClientJSON
from fuel_health.services.compute.json.security_groups_client import \
SecurityGroupsClientJSON
from fuel.services.compute.json.servers_client import ServersClientJSON
from fuel.services.compute.json.services_client import ServicesClientJSON
from fuel.services.compute.json.tenant_usages_client import \
from fuel_health.services.compute.json.servers_client import ServersClientJSON
from fuel_health.services.compute.json.services_client import ServicesClientJSON
from fuel_health.services.compute.json.tenant_usages_client import \
TenantUsagesClientJSON
from fuel.services.identity.json.identity_client import IdentityClientJSON
from fuel.services.identity.json.identity_client import TokenClientJSON
from fuel.services.network.json.network_client import NetworkClient
from fuel_health.services.identity.json.identity_client import IdentityClientJSON
from fuel_health.services.identity.json.identity_client import TokenClientJSON
from fuel_health.services.network.json.network_client import NetworkClient
from fuel.services.volume.json.admin.volume_types_client import \
from fuel_health.services.volume.json.admin.volume_types_client import \
VolumeTypesClientJSON
from fuel.services.volume.json.snapshots_client import SnapshotsClientJSON
from fuel.services.volume.json.volumes_client import VolumesClientJSON
from fuel_health.services.volume.json.snapshots_client import SnapshotsClientJSON
from fuel_health.services.volume.json.volumes_client import VolumesClientJSON
LOG = logging.getLogger(__name__)

View File

@ -20,12 +20,11 @@ import collections
import hashlib
import httplib2
import json
from lxml import etree
import re
import time
from fuel.common import log as logging
from fuel import exceptions
from fuel_health.common import log as logging
from fuel_health import exceptions
# redrive rate limited calls at most twice
MAX_RECURSION_DEPTH = 2

View File

@ -22,7 +22,7 @@ import socket
import time
import warnings
from fuel import exceptions
from fuel_health import exceptions
with warnings.catch_warnings():

View File

@ -20,7 +20,7 @@ import random
import re
import urllib
from fuel import exceptions
from fuel_health import exceptions
def rand_name(name='ost1_test-'):

View File

@ -20,8 +20,8 @@ import sys
from oslo.config import cfg
from fuel.common import log as logging
from fuel.common.utils.misc import singleton
from fuel_health.common import log as logging
from fuel_health.common.utils.misc import singleton
LOG = logging.getLogger(__name__)

View File

@ -20,7 +20,7 @@ import testtools
class FuelException(Exception):
"""
Base Tempest Exception
Base Exception
To correctly use this class, inherit from it and define
a 'message' property. That message will get printf'd

View File

@ -15,22 +15,22 @@
# License for the specific language governing permissions and limitations
# under the License.
from fuel.common import log as logging
import fuel.config
from fuel import exceptions
from fuel_health.common import log as logging
import fuel_health.config
from fuel_health import exceptions
# REST Fuzz testing client libs
from fuel.services.compute.json import flavors_client
from fuel.services.compute.json import floating_ips_client
from fuel.services.compute.json import hypervisor_client
from fuel.services.compute.json import images_client
from fuel.services.compute.json import keypairs_client
from fuel.services.compute.json import limits_client
from fuel.services.compute.json import quotas_client
from fuel.services.compute.json import security_groups_client
from fuel.services.compute.json import servers_client
from fuel.services.network.json import network_client
from fuel.services.volume.json import snapshots_client
from fuel.services.volume.json import volumes_client
from fuel_health.services.compute.json import flavors_client
from fuel_health.services.compute.json import floating_ips_client
from fuel_health.services.compute.json import hypervisor_client
from fuel_health.services.compute.json import images_client
from fuel_health.services.compute.json import keypairs_client
from fuel_health.services.compute.json import limits_client
from fuel_health.services.compute.json import quotas_client
from fuel_health.services.compute.json import security_groups_client
from fuel_health.services.compute.json import servers_client
from fuel_health.services.network.json import network_client
from fuel_health.services.volume.json import snapshots_client
from fuel_health.services.volume.json import volumes_client
NetworkClient = network_client.NetworkClient
ImagesClient = images_client.ImagesClientJSON
@ -58,7 +58,7 @@ class Manager(object):
"""
def __init__(self):
self.config = fuel.config.TempestConfig()
self.config = fuel_health.config.FuelConfig()
self.client_attr_names = []
@ -66,7 +66,7 @@ class FuzzClientManager(Manager):
"""
Manager class that indicates the client provided by the manager
is a fuzz-testing client that Tempest contains. These fuzz-testing
is a fuzz-testing client that test contains. These fuzz-testing
clients are used to be able to throw random or invalid data at
an endpoint and check for appropriate error messages returned
from the endpoint.
@ -77,7 +77,7 @@ class FuzzClientManager(Manager):
class ComputeFuzzClientManager(FuzzClientManager):
"""
Manager that uses the Tempest REST client that can send
Manager that uses the REST client that can send
random or invalid data at the OpenStack Compute API
"""
@ -139,7 +139,7 @@ class ComputeFuzzClientAltManager(Manager):
"""
def __init__(self):
conf = fuel.config.TempestConfig()
conf = fuel_health.config.FuelConfig()
super(ComputeFuzzClientAltManager, self).__init__(
conf.identity.alt_username,
conf.identity.alt_password,
@ -154,7 +154,7 @@ class ComputeFuzzClientAdminManager(Manager):
"""
def __init__(self):
conf = fuel.config.TempestConfig()
conf = fuel_health.config.FuelConfig()
super(ComputeFuzzClientAdminManager, self).__init__(
conf.compute_admin.username,
conf.compute_admin.password,

View File

@ -17,7 +17,7 @@
import json
from fuel.common.rest_client import RestClient
from fuel_health.common.rest_client import RestClient
class FixedIPsClientJSON(RestClient):

View File

@ -18,7 +18,7 @@
import json
import urllib
from fuel.common.rest_client import RestClient
from fuel_health.common.rest_client import RestClient
class FlavorsClientJSON(RestClient):

View File

@ -18,8 +18,8 @@
import json
import urllib
from fuel.common.rest_client import RestClient
from fuel import exceptions
from fuel_health.common.rest_client import RestClient
from fuel_health import exceptions
class FloatingIPsClientJSON(RestClient):

View File

@ -1,6 +1,6 @@
import json
from fuel.common.rest_client import RestClient
from fuel_health.common.rest_client import RestClient
class HostsClientJSON(RestClient):

View File

@ -17,7 +17,7 @@
import json
from fuel.common.rest_client import RestClient
from fuel_health.common.rest_client import RestClient
class HypervisorClientJSON(RestClient):

View File

@ -20,8 +20,8 @@ import json
import time
import urllib
from fuel.common.rest_client import RestClient
from fuel import exceptions
from fuel_health.common.rest_client import RestClient
from fuel_health import exceptions
class ImagesClientJSON(RestClient):

View File

@ -16,8 +16,8 @@
import json
import time
from fuel.common.rest_client import RestClient
from fuel import exceptions
from fuel_health.common.rest_client import RestClient
from fuel_health import exceptions
class InterfacesClientJSON(RestClient):

View File

@ -17,7 +17,7 @@
import json
from fuel.common.rest_client import RestClient
from fuel_health.common.rest_client import RestClient
class KeyPairsClientJSON(RestClient):

View File

@ -16,7 +16,7 @@
# under the License.
import json
from fuel.common.rest_client import RestClient
from fuel_health.common.rest_client import RestClient
class LimitsClientJSON(RestClient):

View File

@ -17,7 +17,7 @@
import json
from fuel.common.rest_client import RestClient
from fuel_health.common.rest_client import RestClient
class QuotasClientJSON(RestClient):

View File

@ -18,8 +18,8 @@
import json
import urllib
from fuel.common.rest_client import RestClient
from fuel import exceptions
from fuel_health.common.rest_client import RestClient
from fuel_health import exceptions
class SecurityGroupsClientJSON(RestClient):

View File

@ -20,8 +20,8 @@ import json
import time
import urllib
from fuel.common.rest_client import RestClient
from fuel import exceptions
from fuel_health.common.rest_client import RestClient
from fuel_health import exceptions
class ServersClientJSON(RestClient):

View File

@ -17,7 +17,7 @@
import json
from fuel.common.rest_client import RestClient
from fuel_health.common.rest_client import RestClient
class ServicesClientJSON(RestClient):

View File

@ -18,7 +18,7 @@
import json
import urllib
from fuel.common.rest_client import RestClient
from fuel_health.common.rest_client import RestClient
class TenantUsagesClientJSON(RestClient):

View File

@ -1,8 +1,8 @@
import httplib2
import json
from fuel.common.rest_client import RestClient
from fuel import exceptions
from fuel_health.common.rest_client import RestClient
from fuel_health import exceptions
class IdentityClientJSON(RestClient):

View File

@ -1,5 +1,5 @@
import json
from fuel.common.rest_client import RestClient
from fuel_health.common.rest_client import RestClient
class NetworkClient(RestClient):

View File

@ -18,7 +18,7 @@
import json
import urllib
from fuel.common.rest_client import RestClient
from fuel_health.common.rest_client import RestClient
class VolumeTypesClientJSON(RestClient):

View File

@ -16,9 +16,9 @@ import json
import time
import urllib
from fuel.common import log as logging
from fuel.common.rest_client import RestClient
from fuel import exceptions
from fuel_health.common import log as logging
from fuel_health.common.rest_client import RestClient
from fuel_health import exceptions
LOG = logging.getLogger(__name__)

View File

@ -19,8 +19,8 @@ import json
import time
import urllib
from fuel.common.rest_client import RestClient
from fuel import exceptions
from fuel_health.common.rest_client import RestClient
from fuel_health import exceptions
class VolumesClientJSON(RestClient):

View File

@ -22,10 +22,10 @@ import nose.plugins.attrib
import testresources
import testtools
from fuel import config
from fuel import manager
from fuel.common import log as logging
from fuel.common.test_mixins import FuelTestAssertMixin
from fuel_health import config
from fuel_health import manager
from fuel_health.common import log as logging
from fuel_health.common.test_mixins import FuelTestAssertMixin
LOG = logging.getLogger(__name__)

View File

View File

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from fuel import clients
from fuel.common import log as logging
from fuel import config
from fuel.exceptions import InvalidConfiguration
from fuel_health import clients
from fuel_health.common import log as logging
from fuel_health import config
from fuel_health.exceptions import InvalidConfiguration
LOG = logging.getLogger(__name__)

View File

@ -17,18 +17,18 @@
import netaddr
import time
from fuel import clients
from fuel import exceptions
from fuel.common import log as logging
from fuel.common.utils.data_utils import rand_name
import fuel.test
from fuel.tests import sanity
from fuel_health import clients
from fuel_health import exceptions
from fuel_health.common import log as logging
from fuel_health.common.utils.data_utils import rand_name
import fuel_health.test
from fuel_health.tests import sanity
LOG = logging.getLogger(__name__)
class BaseComputeTest(fuel.test.BaseTestCase):
class BaseComputeTest(fuel_health.test.BaseTestCase):
"""Base test case class for all Compute API tests."""
conclusion = sanity.generic_setup_package()
@ -100,7 +100,7 @@ class BaseComputeTest(fuel.test.BaseTestCase):
while True:
try:
rand_name_root = rand_name(cls.__name__)
rand_name_root = rand_name('ost1_test-' + cls.__name__)
if cls.isolated_creds:
# Main user already created. Create the alt one...
rand_name_root += '-alt'
@ -118,7 +118,7 @@ class BaseComputeTest(fuel.test.BaseTestCase):
while True:
try:
rand_name_root = rand_name(cls.__name__)
rand_name_root = rand_name('ost1_test-' + cls.__name__)
if cls.isolated_creds:
# Main user already created. Create the alt one...
rand_name_root += '-alt'
@ -205,7 +205,7 @@ class BaseComputeAdminTest(BaseComputeTest):
cls.os_adm = clients.ComputeAdminManager(interface=cls._interface)
class BaseIdentityAdminTest(fuel.test.BaseTestCase):
class BaseIdentityAdminTest(fuel_health.test.BaseTestCase):
@classmethod
def setUpClass(cls):
@ -265,7 +265,7 @@ class DataGenerator(object):
def setup_test_user(self):
"""Set up a test user."""
self.setup_test_tenant()
self.test_user = rand_name('test_user_')
self.test_user = rand_name('ost1_test-user_')
self.test_password = rand_name('pass_')
self.test_email = self.test_user + '@testmail.tm'
resp, self.user = self.client.create_user(self.test_user,
@ -276,7 +276,7 @@ class DataGenerator(object):
def setup_test_tenant(self):
"""Set up a test tenant."""
self.test_tenant = rand_name('test_tenant_')
self.test_tenant = rand_name('ost1_test-tenant_')
self.test_description = rand_name('desc_')
resp, self.tenant = self.client.create_tenant(
name=self.test_tenant,
@ -285,7 +285,7 @@ class DataGenerator(object):
def setup_test_role(self):
"""Set up a test role."""
self.test_role = rand_name('role')
self.test_role = rand_name('ost1_test-role')
resp, self.role = self.client.create_role(self.test_role)
self.roles.append(self.role)
@ -298,7 +298,7 @@ class DataGenerator(object):
self.client.delete_role(role['id'])
class BaseNetworkTest(fuel.test.BaseTestCase):
class BaseNetworkTest(fuel_health.test.BaseTestCase):
@classmethod
def setUpClass(cls):
@ -320,7 +320,7 @@ class BaseNetworkTest(fuel.test.BaseTestCase):
@classmethod
def create_network(cls, network_name=None):
"""Wrapper utility that returns a test network."""
network_name = network_name or rand_name('test-network-')
network_name = network_name or rand_name('ost1_test-network-')
resp, body = cls.client.create_network(network_name)
network = body['network']

View File

@ -1,5 +1,5 @@
from fuel.test import attr
from fuel.tests.sanity import base
from fuel_health.test import attr
from fuel_health.tests.sanity import base
class SanityComputeTest(base.BaseComputeTest):
@ -105,7 +105,7 @@ class SanityComputeTest(base.BaseComputeTest):
3. Check response contains absolute limits in "limits" section.
"""
resp, body = self.limits_client.get_absolute_limits()
self.verify_response_status(resp.status, 'Cinder')
self.verify_response_status(resp.status, 'Compute')
self.verify_response_body(body["limits"], u'absolute',
'Limits are unavailable. '
'Looks like something broken in Cinder.')
'Looks like something broken in Compute.')

View File

@ -1,5 +1,5 @@
from fuel.tests.sanity import base
from fuel.test import attr
from fuel_health.tests.sanity import base
from fuel_health.test import attr
class ServicesTestJSON(base.BaseIdentityAdminTest):

View File

@ -1,6 +1,6 @@
from fuel.common.ssh import Client as SSHClient
from fuel.test import attr
from fuel.tests.sanity import base
from fuel_health.common.ssh import Client as SSHClient
from fuel_health.test import attr
from fuel_health.tests.sanity import base
class SanityInfrastructureTest(base.BaseComputeAdminTest):

View File

@ -1,5 +1,5 @@
from fuel.test import attr
from fuel.tests.sanity import base
from fuel_health.test import attr
from fuel_health.tests.sanity import base
class NetworksTest(base.BaseNetworkTest):

View File

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from fuel import clients
from fuel.common import log as logging
from fuel import config
from fuel.exceptions import InvalidConfiguration
from fuel_health import clients
from fuel_health.common import log as logging
from fuel_health import config
from fuel_health.exceptions import InvalidConfiguration
LOG = logging.getLogger(__name__)

View File

@ -1,19 +1,18 @@
import netaddr
import time
from fuel import clients
from fuel import exceptions
from fuel import clients
import fuel.test
from fuel.common import log as logging
from fuel.common.utils.data_utils import rand_name
from fuel.tests import smoke
from fuel_health import clients
from fuel_health import exceptions
from fuel_health.common import log as logging
from fuel_health.common.utils.data_utils import rand_name
import fuel_health.test
from fuel_health.tests import smoke
LOG = logging.getLogger(__name__)
class BaseComputeTest(fuel.test.BaseTestCase):
class BaseComputeTest(fuel_health.test.BaseTestCase):
"""Base test case class for all Compute API tests."""
conclusion = smoke.generic_setup_package()
@ -57,41 +56,10 @@ class BaseComputeTest(fuel.test.BaseTestCase):
if os.config.network.quantum_available:
cls.network_client = os.config.network
# TODO: Deal with exception:
# {"forbidden": {"message": "Policy doesn't allow
# compute_extension:flavormanage to be performed.", "code": 403}}
# cls.test_flavor = cls.create_test_flavor()
# # TODO: Resolve issue with paths (doesn`t work so far):
# path = fuel.test.__file__
# path = path[:path.find("fuel")]
# etc_path = path + "etc/"
# cls.test_image = os.images_client.create_image_by_file(
# name='test_image',
# container_format='bare',
# disk_format='vdi',
# is_public=True,
# location=etc_path+'ostf_test_image.vdi')
cls.servers = []
cls.servers_client_v3_auth = os.servers_client_v3_auth
@classmethod
def create_test_flavor(cls):
os = clients.AdminManager(interface=cls._interface)
admin_username = cls.config.compute_admin.username
admin_password = cls.config.compute_admin.password
admin_tenant = cls.config.compute_admin.tenant_name
token_client = os.token_client
token_client.auth(admin_username, admin_password, admin_tenant)
cls.flavors_client.create_flavor(name='test_flavor',
ram=256,
vcpus=4,
disk=4,
flavor_id=111111)
@classmethod
def _get_identity_admin_client(cls):
"""
@ -192,7 +160,7 @@ class BaseComputeTest(fuel.test.BaseTestCase):
@classmethod
def create_server(cls, **kwargs):
"""Wrapper utility that returns a test server."""
name = rand_name(cls.__name__ + "-instance")
name = rand_name("ost1_test-" + cls.__name__ + "-instance")
if 'name' in kwargs:
name = kwargs.pop('name')
flavor = kwargs.get('flavor', cls.flavor_ref)
@ -256,7 +224,7 @@ class BaseComputeAdminTest(BaseComputeTest):
cls.os_adm = clients.ComputeAdminManager(interface=cls._interface)
class BaseIdentityAdminTest(fuel.test.BaseTestCase):
class BaseIdentityAdminTest(fuel_health.test.BaseTestCase):
@classmethod
def setUpClass(cls):
@ -316,8 +284,8 @@ class DataGenerator(object):
def setup_test_user(self):
"""Set up a test user."""
self.setup_test_tenant()
self.test_user = rand_name('test_user_')
self.test_password = rand_name('pass_')
self.test_user = rand_name('ost1_test-user-')
self.test_password = rand_name('ist1_test-pass_')
self.test_email = self.test_user + '@testmail.tm'
resp, self.user = self.client.create_user(self.test_user,
self.test_password,
@ -327,7 +295,7 @@ class DataGenerator(object):
def setup_test_tenant(self):
"""Set up a test tenant."""
self.test_tenant = rand_name('test_tenant_')
self.test_tenant = rand_name('ost1_test-test-tenant_')
self.test_description = rand_name('desc_')
resp, self.tenant = self.client.create_tenant(
name=self.test_tenant,
@ -336,7 +304,7 @@ class DataGenerator(object):
def setup_test_role(self):
"""Set up a test role."""
self.test_role = rand_name('role')
self.test_role = rand_name('ost1_test-role')
resp, self.role = self.client.create_role(self.test_role)
self.roles.append(self.role)
@ -349,7 +317,7 @@ class DataGenerator(object):
self.client.delete_role(role['id'])
class BaseNetworkTest(fuel.test.BaseTestCase):
class BaseNetworkTest(fuel_health.test.BaseTestCase):
@classmethod
def setUpClass(cls):
@ -371,7 +339,7 @@ class BaseNetworkTest(fuel.test.BaseTestCase):
@classmethod
def create_network(cls, network_name=None):
"""Wrapper utility that returns a test network."""
network_name = network_name or rand_name('test-network-')
network_name = network_name or rand_name('ost1_test-test-network-')
resp, body = cls.client.create_network(network_name)
network = body['network']

View File

@ -1,7 +1,7 @@
from fuel.common.utils import data_utils
from fuel.test import attr
from fuel.tests.smoke import base
from fuel_health.common.utils import data_utils
from fuel_health.test import attr
from fuel_health.tests.smoke import base
""" Test module contains tests for flavor creation/deletion. """

View File

@ -1,6 +1,6 @@
from fuel.common.utils import data_utils
from fuel.test import attr
from fuel.tests.smoke import base
from fuel_health.common.utils import data_utils
from fuel_health.test import attr
from fuel_health.tests.smoke import base
class KeyPairsTestJSON(base.BaseComputeTest):

View File

@ -1,8 +1,8 @@
import netaddr
from fuel.common.utils import data_utils
from fuel.test import attr
from fuel.tests.smoke import base
from fuel_health.common.utils import data_utils
from fuel_health.test import attr
from fuel_health.tests.smoke import base
"""

View File

@ -1,7 +1,7 @@
from fuel.common.utils import data_utils
from fuel.test import attr
from fuel.tests.smoke import base
from fuel_health.common.utils import data_utils
from fuel_health.test import attr
from fuel_health.tests.smoke import base
class SecurityGroupsTest(base.BaseComputeTest):

View File

@ -1,8 +1,8 @@
import requests
from fuel.common.utils import data_utils
from fuel.test import attr
from fuel.tests.smoke import base
from fuel_health.common.utils import data_utils
from fuel_health.test import attr
from fuel_health.tests.smoke import base
class TestUserTenantRole(base.BaseIdentityAdminTest):
@ -52,16 +52,16 @@ class TestUserTenantRole(base.BaseIdentityAdminTest):
client.get(url) # sets cookie
if len(client.cookies) == 0:
login_data = dict(username=user['name'],
password=self.alt_password,
next='/')
password=self.alt_password,
next='/')
resp = client.post(url, data=login_data, headers=dict(Referer=url))
self.assertEqual(resp.status_code, 200)
else:
csrftoken = client.cookies['csrftoken']
login_data = dict(username=user['name'],
password=self.alt_password,
csrfmiddlewaretoken=csrftoken,
next='/')
password=self.alt_password,
csrfmiddlewaretoken=csrftoken,
next='/')
resp = client.post(url, data=login_data, headers=dict(Referer=url))
self.assertEqual(resp.status_code, 200)