diff options
Diffstat (limited to 'trove/tests/unittests/taskmanager/test_models.py')
-rw-r--r-- | trove/tests/unittests/taskmanager/test_models.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/trove/tests/unittests/taskmanager/test_models.py b/trove/tests/unittests/taskmanager/test_models.py index ac1cfc71..6f875d0a 100644 --- a/trove/tests/unittests/taskmanager/test_models.py +++ b/trove/tests/unittests/taskmanager/test_models.py @@ -81,7 +81,8 @@ class fake_Server: class fake_ServerManager: def create(self, name, image_id, flavor_id, files, userdata, security_groups, block_device_mapping, availability_zone=None, - nics=None, config_drive=False): + nics=None, config_drive=False, + scheduler_hints=None): server = fake_Server() server.id = "server_id" server.name = name @@ -380,7 +381,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, None, None, None, Mock(), None, None, None, None, None) @patch.object(BaseInstance, 'update_db') @patch.object(backup_models.Backup, 'get_by_id') @@ -402,7 +403,7 @@ class FreshInstanceTasksTest(trove_testtools.TestCase): self.freshinstancetasks.create_instance, mock_flavor, 'mysql-image-id', None, None, 'mysql', 'mysql-server', 2, Mock(), None, 'root_password', None, Mock(), None, None, None, - None) + None, None) @patch.object(BaseInstance, 'update_db') @patch.object(taskmanager_models.FreshInstanceTasks, '_create_dns_entry') @@ -417,6 +418,8 @@ class FreshInstanceTasksTest(trove_testtools.TestCase): mock_guest_prepare, mock_build_volume_info, mock_create_secgroup, + mock_create_server, + mock_get_injected_files, *args): mock_flavor = {'id': 8, 'ram': 768, 'name': 'bigger_flavor'} config_content = {'config_contents': 'some junk'} @@ -428,13 +431,18 @@ class FreshInstanceTasksTest(trove_testtools.TestCase): 'mysql-server', 2, None, None, None, None, overrides, None, None, - 'volume_type', None) + 'volume_type', None, + {'group': 'sg-id'}) mock_create_secgroup.assert_called_with('mysql') 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, None) + mock_create_server.assert_called_with( + 8, 'mysql-image-id', mock_create_secgroup(), + 'mysql', mock_build_volume_info()['block_device'], None, + None, mock_get_injected_files(), {'group': 'sg-id'}) @patch.object(trove.guestagent.api.API, 'attach_replication_slave') @patch.object(rpc, 'get_client') |