def test_ext_mongo_without_mongo_node(self): cluster = self.env.create( release_kwargs={ 'attributes_metadata': self.get_custom_meta(True, True)}, nodes_kwargs=[] ) task = Task(name=TASK_NAMES.deploy, cluster=cluster) CheckBeforeDeploymentTask._check_mongo_nodes(task)
def test_ext_mongo_without_mongo_node(self): cluster = self.env.create(release_kwargs={ 'attributes_metadata': self.get_custom_meta(True, True) }, nodes_kwargs=[]) task = Task(name=TASK_NAMES.deploy, cluster=cluster) CheckBeforeDeploymentTask._check_mongo_nodes(task)
def test_mongo_node_without_ext_mongo(self): cluster = self.env.create(release_kwargs={ 'attributes_metadata': self.get_custom_meta(True, False) }, nodes_kwargs=[{ 'pending_roles': ['mongo'], 'status': 'discover', 'pending_addition': True }]) task = Task(name=TASK_NAMES.deploy, cluster=cluster) CheckBeforeDeploymentTask._check_mongo_nodes(task)
def test_check_volumes_and_disks_do_not_run_if_node_ready(self): self.set_node_status('ready') with patch.object(VolumeManager, 'check_disk_space_for_deployment') as check_mock: CheckBeforeDeploymentTask._check_disks(self.task) self.assertFalse(check_mock.called) with patch.object(VolumeManager, 'check_volume_sizes_for_deployment') as check_mock: CheckBeforeDeploymentTask._check_volumes(self.task) self.assertFalse(check_mock.called)
def test_mongo_node_without_ext_mongo(self): cluster = self.env.create( release_kwargs={ 'attributes_metadata': self.get_custom_meta(True, False)}, nodes_kwargs=[ {'pending_roles': ['mongo'], 'status': 'discover', 'pending_addition': True} ] ) task = Task(name=TASK_NAMES.deploy, cluster=cluster) CheckBeforeDeploymentTask._check_mongo_nodes(task)
def test_check_volumes_and_disks_do_not_run_if_node_ready(self): self.set_node_status('ready') with patch.object( VolumeManager, 'check_disk_space_for_deployment') as check_mock: CheckBeforeDeploymentTask._check_disks(self.task) self.assertFalse(check_mock.called) with patch.object( VolumeManager, 'check_volume_sizes_for_deployment') as check_mock: CheckBeforeDeploymentTask._check_volumes(self.task) self.assertFalse(check_mock.called)
def test_check_volumes_and_disks_run_if_node_not_ready(self): self.set_node_status('discover') with patch.object(VolumeManager, 'check_disk_space_for_deployment') as check_mock: CheckBeforeDeploymentTask._check_disks(self.task) self.assertEquals(check_mock.call_count, 1) with patch.object(VolumeManager, 'check_volume_sizes_for_deployment') as check_mock: CheckBeforeDeploymentTask._check_volumes(self.task) self.assertEquals(check_mock.call_count, 1)
def test_check_volumes_and_disks_run_if_node_not_ready(self): self.set_node_status('discover') with patch.object( VolumeManager, 'check_disk_space_for_deployment') as check_mock: CheckBeforeDeploymentTask._check_disks(self.task) self.assertEqual(check_mock.call_count, 1) with patch.object( VolumeManager, 'check_volume_sizes_for_deployment') as check_mock: CheckBeforeDeploymentTask._check_volumes(self.task) self.assertEqual(check_mock.call_count, 1)
def test_check_nodes_online_do_not_raise_exception_node_to_deletion(self): self.node.online = False self.node.pending_deletion = True self.env.db.commit() CheckBeforeDeploymentTask._check_nodes_are_online(self.task)
def is_checking_required(self): return CheckBeforeDeploymentTask._is_disk_checking_required(self.node)