diff options
author | Petr Malik <pmalik@tesora.com> | 2015-09-25 16:00:25 -0400 |
---|---|---|
committer | Petr Malik <pmalik@tesora.com> | 2015-11-16 15:03:08 -0500 |
commit | 0a0680f4d8c1551d24ea9d20aa57d99e9883bbd8 (patch) | |
tree | 9658154273d460da50f2fff75ec58b1435f7be79 /trove/tests | |
parent | 4fcc22b06ee70cd008f420e9f619ce9edb681384 (diff) | |
download | trove-0a0680f4d8c1551d24ea9d20aa57d99e9883bbd8.tar.gz |
Add 'volume_type' parameter to instance create
Allow the user to specify Cinder backend to use when creating a
volume.
Also, accept the 'volume_type' parameter in cluster create API.
The parameter is currently not used by any of the clustering
implementations.
Change-Id: I5415bcef7c9a50ef898a3f3fb74d4d61eca1c96f
Depends-On: Ied40b30ca738d815ca0a57971bb59f29ddc20b91
Implements-Blueprint: volume-type-on-create
Diffstat (limited to 'trove/tests')
6 files changed, 19 insertions, 9 deletions
diff --git a/trove/tests/unittests/cluster/test_cluster_controller.py b/trove/tests/unittests/cluster/test_cluster_controller.py index 66ea9388..fe20921a 100644 --- a/trove/tests/unittests/cluster/test_cluster_controller.py +++ b/trove/tests/unittests/cluster/test_cluster_controller.py @@ -155,6 +155,7 @@ class TestClusterController(TestCase): instances = [ { 'volume_size': 1, + 'volume_type': None, 'flavor_id': '1234', 'availability_zone': 'az', 'nics': [ diff --git a/trove/tests/unittests/cluster/test_cluster_pxc_controller.py b/trove/tests/unittests/cluster/test_cluster_pxc_controller.py index 38a470a4..e8032c6a 100644 --- a/trove/tests/unittests/cluster/test_cluster_pxc_controller.py +++ b/trove/tests/unittests/cluster/test_cluster_pxc_controller.py @@ -139,6 +139,7 @@ class TestClusterController(trove_testtools.TestCase): instances = [ { 'volume_size': 1, + 'volume_type': None, 'flavor_id': '1234', 'availability_zone': 'az', 'nics': [ diff --git a/trove/tests/unittests/cluster/test_cluster_redis_controller.py b/trove/tests/unittests/cluster/test_cluster_redis_controller.py index 2a10b696..5f59e79f 100644 --- a/trove/tests/unittests/cluster/test_cluster_redis_controller.py +++ b/trove/tests/unittests/cluster/test_cluster_redis_controller.py @@ -154,6 +154,7 @@ class TestClusterController(trove_testtools.TestCase): instances = [ { "volume_size": None, + 'volume_type': None, "flavor_id": "1234", "availability_zone": "az", "nics": [ @@ -162,6 +163,7 @@ class TestClusterController(trove_testtools.TestCase): }, { "volume_size": None, + 'volume_type': None, "flavor_id": "1234", "availability_zone": "az", "nics": [ @@ -170,6 +172,7 @@ class TestClusterController(trove_testtools.TestCase): }, { "volume_size": None, + 'volume_type': None, "flavor_id": "1234", "availability_zone": "az", "nics": [ diff --git a/trove/tests/unittests/cluster/test_cluster_vertica_controller.py b/trove/tests/unittests/cluster/test_cluster_vertica_controller.py index 2e4f8cbc..208885c5 100644 --- a/trove/tests/unittests/cluster/test_cluster_vertica_controller.py +++ b/trove/tests/unittests/cluster/test_cluster_vertica_controller.py @@ -139,6 +139,7 @@ class TestClusterController(trove_testtools.TestCase): instances = [ { 'volume_size': 1, + 'volume_type': None, 'flavor_id': '1234', 'availability_zone': 'az', 'nics': [ diff --git a/trove/tests/unittests/taskmanager/test_manager.py b/trove/tests/unittests/taskmanager/test_manager.py index 3a496461..ade09a58 100644 --- a/trove/tests/unittests/taskmanager/test_manager.py +++ b/trove/tests/unittests/taskmanager/test_manager.py @@ -203,7 +203,7 @@ class TestManager(trove_testtools.TestCase): 'mysql', 'mysql-server', 2, 'temp-backup-id', None, 'some_password', None, Mock(), - 'some-master-id', None) + 'some-master-id', None, None) mock_tasks.get_replication_master_snapshot.assert_called_with( self.context, 'some-master-id', mock_flavor, 'temp-backup-id', replica_number=1) @@ -219,14 +219,15 @@ class TestManager(trove_testtools.TestCase): self.context, ['id1', 'id2'], Mock(), Mock(), Mock(), None, None, 'mysql', 'mysql-server', 2, 'temp-backup-id', None, 'some_password', None, - Mock(), 'some-master-id', None) + Mock(), 'some-master-id', None, None) def test_AttributeError_create_instance(self): self.assertRaisesRegexp( AttributeError, 'Cannot create multiple non-replica instances.', self.manager.create_instance, self.context, ['id1', 'id2'], Mock(), Mock(), Mock(), None, None, 'mysql', 'mysql-server', 2, - 'temp-backup-id', None, 'some_password', None, Mock(), None, None) + 'temp-backup-id', None, 'some_password', None, Mock(), None, None, + None) def test_create_instance(self): mock_tasks = Mock() @@ -238,14 +239,15 @@ class TestManager(trove_testtools.TestCase): mock_flavor, 'mysql-image-id', None, None, 'mysql', 'mysql-server', 2, 'temp-backup-id', None, 'password', - None, mock_override, None, None) + None, mock_override, None, None, None) mock_tasks.create_instance.assert_called_with(mock_flavor, 'mysql-image-id', None, None, 'mysql', 'mysql-server', 2, 'temp-backup-id', None, 'password', None, - mock_override, None) + mock_override, + None, None, None) mock_tasks.wait_for_instance.assert_called_with(36000, mock_flavor) def test_create_cluster(self): diff --git a/trove/tests/unittests/taskmanager/test_models.py b/trove/tests/unittests/taskmanager/test_models.py index 09309e49..7ce443a5 100644 --- a/trove/tests/unittests/taskmanager/test_models.py +++ b/trove/tests/unittests/taskmanager/test_models.py @@ -377,7 +377,7 @@ class FreshInstanceTasksTest(trove_testtools.TestCase): 'Error creating security group for instance', self.freshinstancetasks.create_instance, mock_flavor, 'mysql-image-id', None, None, 'mysql', 'mysql-server', 2, - None, None, None, None, Mock(), None) + None, None, None, None, Mock(), None, None, None) @patch.object(BaseInstance, 'update_db') @patch.object(backup_models.Backup, 'get_by_id') @@ -399,7 +399,7 @@ class FreshInstanceTasksTest(trove_testtools.TestCase): 'Error creating DNS entry for instance', self.freshinstancetasks.create_instance, mock_flavor, 'mysql-image-id', None, None, 'mysql', 'mysql-server', - 2, Mock(), None, 'root_password', None, Mock(), None) + 2, Mock(), None, 'root_password', None, Mock(), None, None, None) @patch.object(BaseInstance, 'update_db') @patch.object(taskmanager_models.FreshInstanceTasks, '_create_dns_entry') @@ -424,9 +424,11 @@ class FreshInstanceTasksTest(trove_testtools.TestCase): None, None, 'mysql', 'mysql-server', 2, None, None, None, None, - overrides, None) + overrides, None, None, + 'volume_type') mock_create_secgroup.assert_called_with('mysql') - mock_build_volume_info.assert_called_with('mysql', volume_size=2) + mock_build_volume_info.assert_called_with('mysql', volume_size=2, + volume_type='volume_type') mock_guest_prepare.assert_called_with( 768, mock_build_volume_info(), 'mysql-server', None, None, None, config_content, None, overrides, None, None) |