Example #1
0
    def test_cluster_update_profile(self):
        spec_nova_server = copy.deepcopy(test_utils.spec_nova_server)
        spec_nova_server['properties']['flavor'] = 'new_flavor'
        spec_nova_server['properties']['image'] = 'new_image'
        new_profile = test_api.create_profile(
            self.client, test_utils.random_name('profile'), spec_nova_server)

        # Create cluster with original profile
        desired_capacity = 2
        min_size = 1
        max_size = 3
        cluster_name = test_utils.random_name('cluster')
        cluster = test_api.create_cluster(self.client, cluster_name,
                                          self.profile['id'], desired_capacity,
                                          min_size, max_size)
        cluster = test_utils.wait_for_status(test_api.get_cluster, self.client,
                                             cluster['id'], 'ACTIVE')

        # Update cluster with new profile
        action_id = test_api.update_cluster(self.client,
                                            cluster['id'],
                                            profile=new_profile['id'])
        test_utils.wait_for_status(test_api.get_action, self.client, action_id,
                                   'SUCCEEDED')

        # Verify update result
        cluster = test_api.get_cluster(self.client, cluster['id'])
        self.assertEqual(new_profile['id'], cluster['profile_id'])
        nodes = cluster['nodes']
        for n in nodes:
            node = test_api.get_node(self.client, n, show_details=True)
            self.assertEqual(new_profile['id'], node['profile_id'])

        # Delete cluster
        test_api.delete_cluster(self.client, cluster['id'])
        test_utils.wait_for_delete(test_api.get_cluster, self.client,
                                   cluster['id'])
        # Delete new profile
        test_api.delete_profile(self.client, new_profile['id'])
    def test_cluster_update_profile(self):
        spec_nova_server = copy.deepcopy(test_utils.spec_nova_server)
        spec_nova_server['properties']['flavor'] = 'new_flavor'
        spec_nova_server['properties']['image'] = 'new_image'
        new_profile = test_api.create_profile(
            self.client, test_utils.random_name('profile'),
            spec_nova_server)

        # Create cluster with original profile
        desired_capacity = 2
        min_size = 1
        max_size = 3
        cluster_name = test_utils.random_name('cluster')
        cluster = test_api.create_cluster(self.client, cluster_name,
                                          self.profile['id'], desired_capacity,
                                          min_size, max_size)
        cluster = test_utils.wait_for_status(test_api.get_cluster, self.client,
                                             cluster['id'], 'ACTIVE')

        # Update cluster with new profile
        action_id = test_api.update_cluster(self.client, cluster['id'],
                                            profile=new_profile['id'])
        test_utils.wait_for_status(test_api.get_action, self.client,
                                   action_id, 'SUCCEEDED')

        # Verify update result
        cluster = test_api.get_cluster(self.client, cluster['id'])
        self.assertEqual(new_profile['id'], cluster['profile_id'])
        nodes = cluster['nodes']
        for n in nodes:
            node = test_api.get_node(self.client, n, show_details=True)
            self.assertEqual(new_profile['id'], node['profile_id'])

        # Delete cluster
        test_api.delete_cluster(self.client, cluster['id'])
        test_utils.wait_for_delete(test_api.get_cluster, self.client,
                                   cluster['id'])
        # Delete new profile
        test_api.delete_profile(self.client, new_profile['id'])
Example #3
0
 def tearDown(self):
     # Delete profile
     test_api.delete_profile(self.client, self.profile["id"])
     super(TestWebhook, self).tearDown()
Example #4
0
 def tearDown(self):
     # Delete profile
     test_api.delete_profile(self.client, self.profile['id'])
     super(TestNode, self).tearDown()
Example #5
0
 def tearDown(self):
     # Delete profile
     test_api.delete_profile(self.client, self.profile['id'])
     super(TestClusterHealth, self).tearDown()
Example #6
0
 def tearDown(self):
     # Delete profile
     test_api.delete_profile(self.client, self.profile['id'])
     super(TestLBPolicy, self).tearDown()
Example #7
0
 def tearDown(self):
     # Delete profile
     test_api.delete_profile(self.client, self.profile['id'])
     super(TestScalingPolicy, self).tearDown()
 def tearDown(self):
     # Delete profile
     test_api.delete_profile(self.client, self.profile['id'])
     super(TestClusterScaling, self).tearDown()
Example #9
0
 def tearDown(self):
     # Delete profile
     test_api.delete_profile(self.client, self.profile['id'])
     super(TestReceiver, self).tearDown()