summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-11-17 14:54:46 -0700
committerspisarski <s.pisarski@cablelabs.com>2017-11-20 10:36:28 -0700
commit1d7f4a18cf4a070570beccbb46303f5822840c41 (patch)
treea17c6b16bfc508a34b3c5a6e5bca2843efdb4ac2
parent3c387ae1c18c4a80a752c3e5a2409f4a602b9e20 (diff)
Refactoring of VolumeSettings to extend VolumeConfig
VolumeSettings and cinder_utils have a runtime cyclical dependency. This patch reduces this dependency and deprecates the VolumeSettings class. JIRA: SNAPS-227 Change-Id: I3f93702ff836af365c811d44bfd0e59b76c3f1f5 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
-rw-r--r--docs/how-to-use/LibraryUsage.rst7
-rw-r--r--docs/how-to-use/UnitTests.rst14
-rw-r--r--examples/launch.py7
-rw-r--r--snaps/config/tests/volume_tests.py91
-rw-r--r--snaps/config/volume.py55
-rw-r--r--snaps/openstack/create_stack.py2
-rw-r--r--snaps/openstack/create_volume.py46
-rw-r--r--snaps/openstack/tests/create_instance_tests.py7
-rw-r--r--snaps/openstack/tests/create_volume_tests.py27
-rw-r--r--snaps/openstack/utils/settings_utils.py10
-rw-r--r--snaps/openstack/utils/tests/cinder_utils_tests.py7
-rw-r--r--snaps/openstack/utils/tests/nova_utils_tests.py5
-rw-r--r--snaps/openstack/utils/tests/settings_utils_tests.py2
-rw-r--r--snaps/test_suite_builder.py3
14 files changed, 209 insertions, 74 deletions
diff --git a/docs/how-to-use/LibraryUsage.rst b/docs/how-to-use/LibraryUsage.rst
index 8e2a330..fc22a3d 100644
--- a/docs/how-to-use/LibraryUsage.rst
+++ b/docs/how-to-use/LibraryUsage.rst
@@ -479,7 +479,7 @@ Create Volume
- Volume - snaps.openstack.create\_volume.OpenStackVolume
- - snaps.openstack.create\_volume.VolumeSettings
+ - snaps.config.volume.VolumeConfig
- name - the volume type's name (required)
- description - the volume type's description (optional)
@@ -493,9 +493,10 @@ Create Volume
.. code:: python
- from snaps.openstack.create\_volume import VolumeSettings, OpenStackVolume
+ from snaps.config.volume import VolumeConfig
+ from snaps.openstack.create\_volume import OpenStackVolume
- vol_settings = VolumeSettings(name='stack-name')
+ vol_settings = VolumeConfig(name='stack-name')
vol_creator = OpenStackVolume(os_creds, vol_settings)
vol_creator.create()
diff --git a/docs/how-to-use/UnitTests.rst b/docs/how-to-use/UnitTests.rst
index 74404fa..044503e 100644
--- a/docs/how-to-use/UnitTests.rst
+++ b/docs/how-to-use/UnitTests.rst
@@ -264,11 +264,17 @@ OutputDomainObjectTests
Ensures that all required members are included when constructing a
Output domain object (for Heat)
+VolumeConfigUnitTests
+---------------------
+
+Ensures that all required members are included when constructing a
+VolumeConfig object
+
VolumeSettingsUnitTests
-----------------------
Ensures that all required members are included when constructing a
-VolumeSettings object
+deprecated VolumeSettings object
VolumeDomainObjectTests
-----------------------
@@ -351,11 +357,11 @@ VmInst domain object
SettingsUtilsUnitTests
----------------------
-Ensures that the settings_utils.py#create_volume_settings() function properly
+Ensures that the settings_utils.py#create_volume_config() function properly
maps a snaps.domain.Volume object correctly to a
-snaps.openstack.create_volume.VolumeSettings object as well as a
+snaps.config.volume.VolumeConfig object as well as a
snaps.domain.VolumeType object to a
-snaps.openstack.create_volume.VolumeSettings object
+snaps.config.volume.VolumeConfig object
Ensures that the settings_utils.py#create_flavor_config() function properly
diff --git a/examples/launch.py b/examples/launch.py
index 35ebaf7..b0311e6 100644
--- a/examples/launch.py
+++ b/examples/launch.py
@@ -26,7 +26,6 @@ import os
import yaml
from snaps import file_utils
-from snaps.config.volume_type import VolumeTypeConfig
from snaps.config.flavor import FlavorConfig
from snaps.config.image import ImageConfig
from snaps.config.keypair import KeypairConfig
@@ -34,6 +33,8 @@ from snaps.config.project import ProjectConfig
from snaps.config.qos import QoSConfig
from snaps.config.router import RouterConfig
from snaps.config.user import UserConfig
+from snaps.config.volume import VolumeConfig
+from snaps.config.volume_type import VolumeTypeConfig
from snaps.openstack.create_flavor import OpenStackFlavor
from snaps.openstack.create_image import OpenStackImage
from snaps.openstack.create_instance import VmInstanceSettings
@@ -46,7 +47,7 @@ from snaps.openstack.create_router import OpenStackRouter
from snaps.openstack.create_security_group import (
OpenStackSecurityGroup, SecurityGroupSettings)
from snaps.openstack.create_user import OpenStackUser
-from snaps.openstack.create_volume import OpenStackVolume, VolumeSettings
+from snaps.openstack.create_volume import OpenStackVolume
from snaps.openstack.create_volume_type import OpenStackVolumeType
from snaps.openstack.os_credentials import OSCreds, ProxySettings
from snaps.openstack.utils import deploy_utils
@@ -660,7 +661,7 @@ def main(arguments):
# Create volume types
vol_dict = __create_instances(
- os_creds_dict, OpenStackVolume, VolumeSettings,
+ os_creds_dict, OpenStackVolume, VolumeConfig,
os_config.get('volumes'), 'volume', clean, users_dict)
creators.append(vol_dict)
diff --git a/snaps/config/tests/volume_tests.py b/snaps/config/tests/volume_tests.py
new file mode 100644
index 0000000..b4b54bd
--- /dev/null
+++ b/snaps/config/tests/volume_tests.py
@@ -0,0 +1,91 @@
+# Copyright (c) 2017 Cable Television Laboratories, Inc. ("CableLabs")
+# and others. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import unittest
+
+from snaps.config.volume import VolumeConfigError, VolumeConfig
+
+
+class VolumeConfigUnitTests(unittest.TestCase):
+ """
+ Tests the construction of the VolumeConfig class
+ """
+
+ def test_no_params(self):
+ with self.assertRaises(VolumeConfigError):
+ VolumeConfig()
+
+ def test_empty_config(self):
+ with self.assertRaises(VolumeConfigError):
+ VolumeConfig(**dict())
+
+ def test_name_only(self):
+ settings = VolumeConfig(name='foo')
+ self.assertEqual('foo', settings.name)
+ self.assertIsNone(settings.description)
+ self.assertEquals(1, settings.size)
+ self.assertIsNone(settings.image_name)
+ self.assertIsNone(settings.type_name)
+ self.assertIsNone(settings.availability_zone)
+ self.assertFalse(settings.multi_attach)
+
+ def test_config_with_name_only(self):
+ settings = VolumeConfig(**{'name': 'foo'})
+ self.assertEqual('foo', settings.name)
+ self.assertIsNone(settings.description)
+ self.assertEquals(1, settings.size)
+ self.assertIsNone(settings.image_name)
+ self.assertIsNone(settings.type_name)
+ self.assertIsNone(settings.availability_zone)
+ self.assertFalse(settings.multi_attach)
+
+ def test_all_strings(self):
+ settings = VolumeConfig(
+ name='foo', description='desc', size='2', image_name='image',
+ type_name='type', availability_zone='zone1', multi_attach='true')
+
+ self.assertEqual('foo', settings.name)
+ self.assertEqual('desc', settings.description)
+ self.assertEqual(2, settings.size)
+ self.assertEqual('image', settings.image_name)
+ self.assertEqual('type', settings.type_name)
+ self.assertEqual('zone1', settings.availability_zone)
+ self.assertTrue(settings.multi_attach)
+
+ def test_all_correct_type(self):
+ settings = VolumeConfig(
+ name='foo', description='desc', size=2, image_name='image',
+ type_name='bar', availability_zone='zone1', multi_attach=True)
+
+ self.assertEqual('foo', settings.name)
+ self.assertEqual('desc', settings.description)
+ self.assertEqual(2, settings.size)
+ self.assertEqual('image', settings.image_name)
+ self.assertEqual('bar', settings.type_name)
+ self.assertEqual('zone1', settings.availability_zone)
+ self.assertTrue(settings.multi_attach)
+
+ def test_config_all(self):
+ settings = VolumeConfig(
+ **{'name': 'foo', 'description': 'desc', 'size': '2',
+ 'image_name': 'foo', 'type_name': 'bar',
+ 'availability_zone': 'zone1', 'multi_attach': 'true'})
+
+ self.assertEqual('foo', settings.name)
+ self.assertEqual('desc', settings.description)
+ self.assertEqual(2, settings.size)
+ self.assertEqual('foo', settings.image_name)
+ self.assertEqual('bar', settings.type_name)
+ self.assertEqual('zone1', settings.availability_zone)
+ self.assertTrue(settings.multi_attach)
diff --git a/snaps/config/volume.py b/snaps/config/volume.py
new file mode 100644
index 0000000..20ca985
--- /dev/null
+++ b/snaps/config/volume.py
@@ -0,0 +1,55 @@
+# Copyright (c) 2017 Cable Television Laboratories, Inc. ("CableLabs")
+# and others. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+class VolumeConfig(object):
+ def __init__(self, **kwargs):
+ """
+ Constructor
+ :param name: the volume's name (required)
+ :param description: the volume's name (optional)
+ :param size: the volume's size in GB (default 1)
+ :param image_name: when a glance image is used for the image source
+ (optional)
+ :param type_name: the associated volume's type name (optional)
+ :param availability_zone: the name of the compute server on which to
+ deploy the volume (optional)
+ :param multi_attach: when true, volume can be attached to more than one
+ server (default False)
+ """
+
+ self.name = kwargs.get('name')
+ self.description = kwargs.get('description')
+ self.size = int(kwargs.get('size', 1))
+ self.image_name = kwargs.get('image_name')
+ self.type_name = kwargs.get('type_name')
+ self.availability_zone = kwargs.get('availability_zone')
+
+ if kwargs.get('availability_zone'):
+ self.multi_attach = bool(kwargs.get('availability_zone'))
+ else:
+ self.multi_attach = False
+
+ if not self.name:
+ raise VolumeConfigError("The attribute name is required")
+
+
+class VolumeConfigError(Exception):
+ """
+ Exception to be thrown when an volume settings are incorrect
+ """
+
+ def __init__(self, message):
+ Exception.__init__(self, message)
diff --git a/snaps/openstack/create_stack.py b/snaps/openstack/create_stack.py
index 25fe686..cd65a27 100644
--- a/snaps/openstack/create_stack.py
+++ b/snaps/openstack/create_stack.py
@@ -322,7 +322,7 @@ class OpenStackHeatStack(OpenStackCloudObject, object):
self.__heat_cli, cinder, self.__stack)
for volume in volumes:
- settings = settings_utils.create_volume_settings(volume)
+ settings = settings_utils.create_volume_config(volume)
creator = OpenStackVolume(self._os_creds, settings)
out.append(creator)
diff --git a/snaps/openstack/create_volume.py b/snaps/openstack/create_volume.py
index 65acee8..c134ca1 100644
--- a/snaps/openstack/create_volume.py
+++ b/snaps/openstack/create_volume.py
@@ -18,6 +18,7 @@ import time
from cinderclient.exceptions import NotFound
+from snaps.config.volume import VolumeConfig
from snaps.openstack.openstack_creator import OpenStackVolumeObject
from snaps.openstack.utils import cinder_utils
@@ -228,45 +229,18 @@ class OpenStackVolume(OpenStackVolumeObject):
return status == expected_status_code
-class VolumeSettings:
- def __init__(self, **kwargs):
- """
- Constructor
- :param name: the volume's name (required)
- :param description: the volume's name (optional)
- :param size: the volume's size in GB (default 1)
- :param image_name: when a glance image is used for the image source
- (optional)
- :param type_name: the associated volume's type name (optional)
- :param availability_zone: the name of the compute server on which to
- deploy the volume (optional)
- :param multi_attach: when true, volume can be attached to more than one
- server (default False)
- """
-
- self.name = kwargs.get('name')
- self.description = kwargs.get('description')
- self.size = int(kwargs.get('size', 1))
- self.image_name = kwargs.get('image_name')
- self.type_name = kwargs.get('type_name')
- self.availability_zone = kwargs.get('availability_zone')
-
- if kwargs.get('availability_zone'):
- self.multi_attach = bool(kwargs.get('availability_zone'))
- else:
- self.multi_attach = False
-
- if not self.name:
- raise VolumeSettingsError("The attribute name is required")
-
-
-class VolumeSettingsError(Exception):
+class VolumeSettings(VolumeConfig):
"""
- Exception to be thrown when an volume settings are incorrect
+ Class to hold the configuration settings required for creating OpenStack
+ Volume Type Encryption objects
+ deprecated
"""
- def __init__(self, message):
- Exception.__init__(self, message)
+ def __init__(self, **kwargs):
+ from warnings import warn
+ warn('Use snaps.config.volume.VolumeConfig instead',
+ DeprecationWarning)
+ super(self.__class__, self).__init__(**kwargs)
class VolumeCreationError(Exception):
diff --git a/snaps/openstack/tests/create_instance_tests.py b/snaps/openstack/tests/create_instance_tests.py
index bc664fe..c7a6c83 100644
--- a/snaps/openstack/tests/create_instance_tests.py
+++ b/snaps/openstack/tests/create_instance_tests.py
@@ -24,6 +24,7 @@ from neutronclient.common.exceptions import InvalidIpForSubnetClient
from novaclient.exceptions import BadRequest
from snaps import file_utils
+from snaps.config.volume import VolumeConfig
from snaps.config.router import RouterConfig
from snaps.config.keypair import KeypairConfig
from snaps.openstack import create_network, create_router
@@ -41,7 +42,7 @@ from snaps.openstack.create_router import OpenStackRouter
from snaps.openstack.create_security_group import (
SecurityGroupSettings, OpenStackSecurityGroup, SecurityGroupRuleSettings,
Direction, Protocol)
-from snaps.openstack.create_volume import OpenStackVolume, VolumeSettings
+from snaps.openstack.create_volume import OpenStackVolume
from snaps.openstack.tests import openstack_tests, validation_utils
from snaps.openstack.tests.os_source_file_test import (
OSIntegrationTestCase, OSComponentTestCase)
@@ -2886,9 +2887,9 @@ class CreateInstanceVolumeTests(OSIntegrationTestCase):
net_name=guid + '-pub-net', subnet_name=guid + '-pub-subnet',
router_name=guid + '-pub-router', external_net=self.ext_net_name)
- self.volume_settings1 = VolumeSettings(
+ self.volume_settings1 = VolumeConfig(
name=self.__class__.__name__ + '-' + str(guid) + '-1')
- self.volume_settings2 = VolumeSettings(
+ self.volume_settings2 = VolumeConfig(
name=self.__class__.__name__ + '-' + str(guid) + '-2')
# Initialize for tearDown()
diff --git a/snaps/openstack/tests/create_volume_tests.py b/snaps/openstack/tests/create_volume_tests.py
index 91b52b1..ca13860 100644
--- a/snaps/openstack/tests/create_volume_tests.py
+++ b/snaps/openstack/tests/create_volume_tests.py
@@ -14,6 +14,7 @@
# limitations under the License.
from cinderclient.exceptions import NotFound, BadRequest
+from snaps.config.volume import VolumeConfig, VolumeConfigError
from snaps.config.volume_type import VolumeTypeConfig
from snaps.openstack.create_image import OpenStackImage
from snaps.openstack.create_volume_type import OpenStackVolumeType
@@ -29,7 +30,7 @@ import unittest
import uuid
from snaps.openstack.create_volume import (
- VolumeSettings, VolumeSettingsError, OpenStackVolume)
+ VolumeSettings, OpenStackVolume)
from snaps.openstack.tests.os_source_file_test import OSIntegrationTestCase
from snaps.openstack.utils import cinder_utils
@@ -44,11 +45,11 @@ class VolumeSettingsUnitTests(unittest.TestCase):
"""
def test_no_params(self):
- with self.assertRaises(VolumeSettingsError):
+ with self.assertRaises(VolumeConfigError):
VolumeSettings()
def test_empty_config(self):
- with self.assertRaises(VolumeSettingsError):
+ with self.assertRaises(VolumeConfigError):
VolumeSettings(**dict())
def test_name_only(self):
@@ -125,7 +126,7 @@ class CreateSimpleVolumeSuccessTests(OSIntegrationTestCase):
super(self.__class__, self).__start__()
guid = uuid.uuid4()
- self.volume_settings = VolumeSettings(
+ self.volume_settings = VolumeConfig(
name=self.__class__.__name__ + '-' + str(guid))
self.cinder = cinder_utils.cinder_client(self.os_creds)
@@ -234,7 +235,7 @@ class CreateSimpleVolumeFailureTests(OSIntegrationTestCase):
Tests the creation of an OpenStack volume with a negative size to
ensure it raises a BadRequest exception.
"""
- volume_settings = VolumeSettings(
+ volume_settings = VolumeConfig(
name=self.__class__.__name__ + '-' + str(self.guid), size=-1)
# Create Volume
@@ -248,7 +249,7 @@ class CreateSimpleVolumeFailureTests(OSIntegrationTestCase):
Tests the creation of an OpenStack volume with a type that does not
exist to ensure it raises a NotFound exception.
"""
- volume_settings = VolumeSettings(
+ volume_settings = VolumeConfig(
name=self.__class__.__name__ + '-' + str(self.guid),
type_name='foo')
@@ -263,7 +264,7 @@ class CreateSimpleVolumeFailureTests(OSIntegrationTestCase):
Tests the creation of an OpenStack volume with an image that does not
exist to ensure it raises a BadRequest exception.
"""
- volume_settings = VolumeSettings(
+ volume_settings = VolumeConfig(
name=self.__class__.__name__ + '-' + str(self.guid),
image_name='foo')
@@ -278,7 +279,7 @@ class CreateSimpleVolumeFailureTests(OSIntegrationTestCase):
Tests the creation of an OpenStack volume with an availability zone
that does not exist to ensure it raises a BadRequest exception.
"""
- volume_settings = VolumeSettings(
+ volume_settings = VolumeConfig(
name=self.__class__.__name__ + '-' + str(self.guid),
availability_zone='foo')
@@ -321,7 +322,7 @@ class CreateVolumeWithTypeTests(OSIntegrationTestCase):
"""
self.volume_creator = OpenStackVolume(
self.os_creds,
- VolumeSettings(name=self.volume_name, type_name='foo'))
+ VolumeConfig(name=self.volume_name, type_name='foo'))
with self.assertRaises(NotFound):
self.volume_creator.create()
@@ -332,8 +333,8 @@ class CreateVolumeWithTypeTests(OSIntegrationTestCase):
"""
self.volume_creator = OpenStackVolume(
self.os_creds,
- VolumeSettings(name=self.volume_name,
- type_name=self.volume_type_name))
+ VolumeConfig(
+ name=self.volume_name, type_name=self.volume_type_name))
created_volume = self.volume_creator.create(block=True)
self.assertIsNotNone(created_volume)
@@ -383,7 +384,7 @@ class CreateVolumeWithImageTests(OSIntegrationTestCase):
"""
self.volume_creator = OpenStackVolume(
self.os_creds,
- VolumeSettings(name=self.volume_name, image_name='foo'))
+ VolumeConfig(name=self.volume_name, image_name='foo'))
with self.assertRaises(BadRequest):
self.volume_creator.create(block=True)
@@ -395,7 +396,7 @@ class CreateVolumeWithImageTests(OSIntegrationTestCase):
"""
self.volume_creator = OpenStackVolume(
self.os_creds,
- VolumeSettings(name=self.volume_name, image_name=self.image_name))
+ VolumeConfig(name=self.volume_name, image_name=self.image_name))
created_volume = self.volume_creator.create(block=True)
self.assertIsNotNone(created_volume)
diff --git a/snaps/openstack/utils/settings_utils.py b/snaps/openstack/utils/settings_utils.py
index c4714cc..80dfc84 100644
--- a/snaps/openstack/utils/settings_utils.py
+++ b/snaps/openstack/utils/settings_utils.py
@@ -15,18 +15,18 @@
import uuid
from snaps import file_utils
-from snaps.config.volume_type import (
- ControlLocation, VolumeTypeEncryptionConfig, VolumeTypeConfig)
from snaps.config.flavor import FlavorConfig
from snaps.config.keypair import KeypairConfig
from snaps.config.router import RouterConfig
+from snaps.config.volume import VolumeConfig
+from snaps.config.volume_type import (
+ ControlLocation, VolumeTypeEncryptionConfig, VolumeTypeConfig)
from snaps.openstack.create_instance import (
VmInstanceSettings, FloatingIpSettings)
from snaps.openstack.create_network import (
PortSettings, SubnetSettings, NetworkSettings)
from snaps.openstack.create_security_group import (
SecurityGroupSettings, SecurityGroupRuleSettings)
-from snaps.openstack.create_volume import VolumeSettings
from snaps.openstack.utils import (
neutron_utils, nova_utils, heat_utils, glance_utils)
@@ -148,13 +148,13 @@ def create_router_settings(neutron, router):
port_settings=filtered_settings)
-def create_volume_settings(volume):
+def create_volume_config(volume):
"""
Returns a VolumeSettings object
:param volume: a SNAPS-OO Volume object
"""
- return VolumeSettings(
+ return VolumeConfig(
name=volume.name, description=volume.description,
size=volume.size, type_name=volume.type,
availability_zone=volume.availability_zone,
diff --git a/snaps/openstack/utils/tests/cinder_utils_tests.py b/snaps/openstack/utils/tests/cinder_utils_tests.py
index e8c31db..b624b09 100644
--- a/snaps/openstack/utils/tests/cinder_utils_tests.py
+++ b/snaps/openstack/utils/tests/cinder_utils_tests.py
@@ -18,11 +18,12 @@ import uuid
import time
from cinderclient.exceptions import NotFound, BadRequest
+from snaps.config.volume import VolumeConfig
from snaps.config.volume_type import (
VolumeTypeConfig, ControlLocation, VolumeTypeEncryptionConfig)
from snaps.config.qos import Consumer, QoSConfig
from snaps.openstack import create_volume
-from snaps.openstack.create_volume import VolumeSettings
+from snaps.openstack.create_qos import Consumer
from snaps.openstack.tests import validation_utils
from snaps.openstack.tests.os_source_file_test import OSComponentTestCase
from snaps.openstack.utils import cinder_utils
@@ -91,7 +92,7 @@ class CinderUtilsVolumeTests(OSComponentTestCase):
"""
Tests the cinder_utils.create_volume()
"""
- volume_settings = VolumeSettings(name=self.volume_name)
+ volume_settings = VolumeConfig(name=self.volume_name)
self.volume = cinder_utils.create_volume(
self.cinder, volume_settings)
self.assertIsNotNone(self.volume)
@@ -108,7 +109,7 @@ class CinderUtilsVolumeTests(OSComponentTestCase):
"""
Tests the cinder_utils.create_volume()
"""
- volume_settings = VolumeSettings(name=self.volume_name)
+ volume_settings = VolumeConfig(name=self.volume_name)
self.volume = cinder_utils.create_volume(
self.cinder, volume_settings)
self.assertIsNotNone(self.volume)
diff --git a/snaps/openstack/utils/tests/nova_utils_tests.py b/snaps/openstack/utils/tests/nova_utils_tests.py
index 0c313b9..6335ed9 100644
--- a/snaps/openstack/utils/tests/nova_utils_tests.py
+++ b/snaps/openstack/utils/tests/nova_utils_tests.py
@@ -19,6 +19,7 @@ import uuid
import os
from snaps import file_utils
+from snaps.config.volume import VolumeConfig
from snaps.config.flavor import FlavorConfig
from snaps.openstack import create_instance
from snaps.openstack.create_flavor import OpenStackFlavor
@@ -26,7 +27,7 @@ from snaps.openstack.create_image import OpenStackImage
from snaps.openstack.create_instance import (
VmInstanceSettings, OpenStackVmInstance)
from snaps.openstack.create_network import OpenStackNetwork, PortSettings
-from snaps.openstack.create_volume import OpenStackVolume, VolumeSettings
+from snaps.openstack.create_volume import OpenStackVolume
from snaps.openstack.tests import openstack_tests
from snaps.openstack.tests.os_source_file_test import OSComponentTestCase
from snaps.openstack.utils import (
@@ -375,7 +376,7 @@ class NovaUtilsInstanceVolumeTests(OSComponentTestCase):
self.flavor_creator.create()
# Create Volume
- volume_settings = VolumeSettings(
+ volume_settings = VolumeConfig(
name=self.__class__.__name__ + '-' + str(guid))
self.volume_creator = OpenStackVolume(
self.os_creds, volume_settings)
diff --git a/snaps/openstack/utils/tests/settings_utils_tests.py b/snaps/openstack/utils/tests/settings_utils_tests.py
index f4e7da5..1157f2c 100644
--- a/snaps/openstack/utils/tests/settings_utils_tests.py
+++ b/snaps/openstack/utils/tests/settings_utils_tests.py
@@ -356,7 +356,7 @@ class SettingsUtilsUnitTests(unittest.TestCase):
volume = Volume(
name='vol-name', volume_id='vol-id', description='desc', size=99,
vol_type='vol-type', availability_zone='zone1', multi_attach=True)
- settings = settings_utils.create_volume_settings(volume)
+ settings = settings_utils.create_volume_config(volume)
self.assertEqual(volume.name, settings.name)
self.assertEqual(volume.description, settings.description)
self.assertEqual(volume.size, settings.size)
diff --git a/snaps/test_suite_builder.py b/snaps/test_suite_builder.py
index f9c4e92..264651a 100644
--- a/snaps/test_suite_builder.py
+++ b/snaps/test_suite_builder.py
@@ -16,6 +16,7 @@
import logging
import unittest
+from snaps.config.tests.volume_tests import VolumeConfigUnitTests
from snaps.config.tests.volume_type_tests import VolumeTypeConfigUnitTests
from snaps.config.tests.qos_tests import QoSConfigUnitTests
from snaps.config.tests.stack_tests import StackConfigUnitTests
@@ -232,6 +233,8 @@ def add_unit_tests(suite):
suite.addTest(unittest.TestLoader().loadTestsFromTestCase(
VolumeTypeSettingsUnitTests))
suite.addTest(unittest.TestLoader().loadTestsFromTestCase(
+ VolumeConfigUnitTests))
+ suite.addTest(unittest.TestLoader().loadTestsFromTestCase(
VolumeSettingsUnitTests))
suite.addTest(unittest.TestLoader().loadTestsFromTestCase(
SettingsUtilsUnitTests))