Exemplo n.º 1
0
    def test_cluster_create_list_delete(self):
        # Create a cluster
        desired_capacity = 2
        min_size = 1
        max_size = 3
        metadata = {'k1': 'v1'}
        timeout = 120
        cluster_id1 = utils.create_a_cluster(self, self.profile_id,
                                             desired_capacity, min_size,
                                             max_size, timeout, metadata)

        # Verify creation result
        cluster1 = utils.get_a_cluster(self, cluster_id1)
        self.assertIsNotNone(cluster1)
        self.assertEqual(desired_capacity, cluster1['desired_capacity'])
        self.assertEqual(desired_capacity, len(cluster1['nodes']))
        self.assertEqual(min_size, cluster1['min_size'])
        self.assertEqual(max_size, cluster1['max_size'])
        self.assertEqual(metadata, cluster1['metadata'])
        self.assertEqual(timeout, cluster1['timeout'])

        # Create another cluster
        cluster_id2 = utils.create_a_cluster(self, self.profile_id)

        # List clusters
        clusters = utils.list_clusters(self)
        self.assertIsNotNone(clusters)
        cluster_ids = [c['id'] for c in clusters]
        self.assertIn(cluster_id1, cluster_ids)
        self.assertIn(cluster_id2, cluster_ids)

        # Delete cluster
        utils.delete_a_cluster(self, cluster_id1)
        utils.delete_a_cluster(self, cluster_id2)
Exemplo n.º 2
0
    def test_cluster_create_list_delete(self):
        # Create a cluster
        desired_capacity = 2
        min_size = 1
        max_size = 3
        metadata = {'k1': 'v1'}
        timeout = 120
        cluster_id1 = utils.create_a_cluster(
            self, self.profile_id, desired_capacity, min_size, max_size,
            timeout, metadata)

        # Verify creation result
        cluster1 = utils.get_a_cluster(self, cluster_id1)
        self.assertIsNotNone(cluster1)
        self.assertEqual(desired_capacity, cluster1['desired_capacity'])
        self.assertEqual(desired_capacity, len(cluster1['nodes']))
        self.assertEqual(min_size, cluster1['min_size'])
        self.assertEqual(max_size, cluster1['max_size'])
        self.assertEqual(metadata, cluster1['metadata'])
        self.assertEqual(timeout, cluster1['timeout'])

        # Create another cluster
        cluster_id2 = utils.create_a_cluster(self, self.profile_id)

        # List clusters
        clusters = utils.list_clusters(self)
        self.assertIsNotNone(clusters)
        cluster_ids = [c['id'] for c in clusters]
        self.assertIn(cluster_id1, cluster_ids)
        self.assertIn(cluster_id2, cluster_ids)

        # Delete cluster
        utils.delete_a_cluster(self, cluster_id1)
        utils.delete_a_cluster(self, cluster_id2)
Exemplo n.º 3
0
 def setUp(self):
     super(TestClusterShowNegativeBadRequest, self).setUp()
     profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, profile_id)
     self.cluster_id1 = utils.create_a_cluster(self, profile_id,
                                               name='c-01')
     self.cluster_id2 = utils.create_a_cluster(self, profile_id,
                                               name='c-01')
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id1)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id2)
 def setUp(self):
     super(TestClusterDelNodesNegativeNodeOfOtherCluster, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
     self.cluster_id2 = utils.create_a_cluster(self, self.profile_id)
     self.node_id = utils.create_a_node(self, self.profile_id,
                                        cluster_id=self.cluster_id2)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id2)
    def setUp(self):
        super(TestClusterDeleteNegativeBadRequest, self).setUp()
        profile_id = utils.create_a_profile(self)
        self.addCleanup(utils.delete_a_profile, self, profile_id)

        self.cluster_id1 = utils.create_a_cluster(self, profile_id,
                                                  name='c-01')
        self.addCleanup(utils.delete_a_cluster, self, self.cluster_id1)
        self.cluster_id2 = utils.create_a_cluster(self, profile_id,
                                                  name='c-01')
        self.addCleanup(utils.delete_a_cluster, self, self.cluster_id2)
Exemplo n.º 6
0
 def setUp(self):
     super(TestClusterDelNodesNegativeNodeOfOtherCluster, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
     self.cluster_id2 = utils.create_a_cluster(self, self.profile_id)
     self.node_id = utils.create_a_node(self,
                                        self.profile_id,
                                        cluster_id=self.cluster_id2)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id2)
Exemplo n.º 7
0
    def setUp(self):
        super(TestClusterPolicyShowNegativePolicyNotFound, self).setUp()
        profile_id = utils.create_a_profile(self)
        self.addCleanup(utils.delete_a_profile, self, profile_id)

        self.cluster_id = utils.create_a_cluster(self, profile_id)
        self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 8
0
    def setUp(self):
        super(TestClusterList, self).setUp()
        profile_id = utils.create_a_profile(self)
        self.addCleanup(utils.delete_a_profile, self, profile_id)

        self.cluster_id = utils.create_a_cluster(self, profile_id)
        self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 9
0
 def setUp(self):
     super(TestClusterActionScaleIn, self).setUp()
     profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, profile_id)
     self.cluster_id = utils.create_a_cluster(self, profile_id,
                                              desired_capacity=1)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 10
0
    def setUp(self):
        super(TestClusterReplaceNodesNegativeNewNotOrphan, self).setUp()
        self.profile_id = utils.create_a_profile(self)
        self.addCleanup(utils.delete_a_profile, self, self.profile_id)
        self.cluster_id = utils.create_a_cluster(self, self.profile_id)
        self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
        self.old_node = utils.create_a_node(self,
                                            self.profile_id,
                                            cluster_id=self.cluster_id)
        self.addCleanup(utils.delete_a_node, self, self.old_node)

        self.cluster_id2 = utils.create_a_cluster(self, self.profile_id)
        self.addCleanup(utils.delete_a_cluster, self, self.cluster_id2)
        self.new_node = utils.create_a_node(self, self.profile_id,
                                            self.cluster_id2)
        self.addCleanup(utils.delete_a_node, self, self.new_node)
Exemplo n.º 11
0
    def test_cluster_create_delete(self):
        # Create a cluster
        desired_capacity = 2
        min_size = 1
        max_size = 3
        metadata = {'k1': 'v1'}
        timeout = 600
        cluster_id = utils.create_a_cluster(
            self, self.profile_id, desired_capacity, min_size, max_size,
            timeout, metadata)

        # Verify creation result
        cluster = utils.get_a_cluster(self, cluster_id)
        self.assertIsNotNone(cluster)
        self.assertEqual(desired_capacity, cluster['desired_capacity'])
        self.assertEqual(desired_capacity, len(cluster['nodes']))
        for nid in cluster['nodes']:
            node = utils.get_a_node(self, nid, show_details=True)
            self.assertEqual('ACTIVE', node['status'])
            self.assertEqual(cluster_id, node['cluster_id'])
            self.assertIsNotNone(node['details'])
            self.assertEqual('ACTIVE', node['details']['status'])
            self.assertEqual(self.spec['properties']['flavor'],
                             node['details']['flavor'])
            self.assertEqual(self.spec['properties']['name'],
                             node['details']['name'])
            metadata = {
                'cluster_id': cluster['id'],
                'cluster_node_id': node['id'],
                'cluster_node_index': six.text_type(node['index'])
            }
            self.assertEqual(metadata, node['details']['metadata'])

        # Delete cluster
        utils.delete_a_cluster(self, cluster_id)
Exemplo n.º 12
0
    def setUp(self):
        super(TestClusterDelete, self).setUp()
        profile_id = utils.create_a_profile(self)
        self.addCleanup(utils.delete_a_profile, self, profile_id)

        # cluster will be deleted by test case
        self.cluster_id = utils.create_a_cluster(self, profile_id)
Exemplo n.º 13
0
    def test_cluster_create_delete(self):
        # Create a cluster
        desired_capacity = 2
        min_size = 1
        max_size = 3
        metadata = {'k1': 'v1'}
        timeout = 600
        cluster_id = utils.create_a_cluster(
            self, self.profile_id, desired_capacity, min_size, max_size,
            timeout, metadata)

        # Verify creation result
        cluster = utils.get_a_cluster(self, cluster_id)
        self.assertIsNotNone(cluster)
        self.assertEqual(desired_capacity, cluster['desired_capacity'])
        self.assertEqual(desired_capacity, len(cluster['nodes']))
        for nid in cluster['nodes']:
            # TODO(Yanyan Hu)verify nova server property as well
            # after node show datail works.
            node = utils.get_a_node(self, nid)
            self.assertEqual('ACTIVE', node['status'])
            self.assertEqual(cluster_id, node['cluster_id'])

        # Delete cluster
        utils.delete_a_cluster(self, cluster_id)
Exemplo n.º 14
0
 def setUp(self):
     super(TestClusterReplaceNodesNegativeOldNotFound, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
     self.new_node = utils.create_a_node(self, self.profile_id)
     self.addCleanup(utils.delete_a_node, self, self.new_node)
 def setUp(self):
     super(TestClusterScalingNegativeBadRequest, self).setUp()
     profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, profile_id)
     self.cluster_id = utils.create_a_cluster(self, profile_id,
                                              min_size=0, max_size=5,
                                              desired_capacity=1)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
 def setUp(self):
     super(TestClusterResizeNegativeSizeCheckFailed, self).setUp()
     profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, profile_id)
     self.cluster_id = utils.create_a_cluster(self, profile_id,
                                              min_size=0, max_size=5,
                                              desired_capacity=1)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 17
0
 def setUp(self):
     super(TestClusterScaleInNegativeBadRequest, self).setUp()
     profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, profile_id)
     self.cluster_id = utils.create_a_cluster(self, profile_id,
                                              min_size=0, max_size=5,
                                              desired_capacity=1)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 18
0
 def setUp(self):
     super(TestClusterScaleInOut, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id,
                                              min_size=1, max_size=5,
                                              desired_capacity=1)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 19
0
 def setUp(self):
     super(TestLBPolicy, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id,
                                              min_size=0, max_size=5,
                                              desired_capacity=2)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 20
0
 def setUp(self):
     super(TestClusterResizeNegativeSizeCheckFailed, self).setUp()
     profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, profile_id)
     self.cluster_id = utils.create_a_cluster(self, profile_id,
                                              min_size=2, max_size=5,
                                              desired_capacity=3)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 21
0
 def setUp(self):
     super(TestClusterPolicyDetachNegativeUnattached, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
     self.policy_id = utils.create_a_policy(self)
     self.addCleanup(utils.delete_a_policy, self, self.policy_id)
Exemplo n.º 22
0
 def setUp(self):
     super(TestScalingPolicy, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id,
                                              min_size=0, max_size=5,
                                              desired_capacity=1)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 23
0
 def setUp(self):
     super(TestClusterActionAddNodes, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
     self.node_id = utils.create_a_node(self, self.profile_id)
     self.addCleanup(utils.delete_a_node, self, self.node_id)
 def setUp(self):
     super(TestClusterPolicyUpdateNegativeUnattached, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
     self.policy_id = utils.create_a_policy(self)
     self.addCleanup(utils.delete_a_policy, self, self.policy_id)
Exemplo n.º 25
0
 def setUp(self):
     super(TestReceiver, self).setUp()
     self.profile_id = utils.create_a_profile(
         self, spec=constants.spec_heat_stack)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id,
                                              desired_capacity=1)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 26
0
 def setUp(self):
     super(TestClusterUpdate, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.profile_id_new = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id_new)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id,
                                              desired_capacity=3)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 27
0
 def setUp(self):
     super(TestClusterActionPolicyDetach, self).setUp()
     profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, profile_id)
     self.cluster_id = utils.create_a_cluster(self, profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
     self.policy_id = utils.create_a_policy(self)
     self.addCleanup(utils.delete_a_policy, self, self.policy_id)
     utils.cluster_attach_policy(self, self.cluster_id, self.policy_id)
Exemplo n.º 28
0
 def setUp(self):
     super(TestClusterActionPolicyDetach, self).setUp()
     profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, profile_id)
     self.cluster_id = utils.create_a_cluster(self, profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
     self.policy_id = utils.create_a_policy(self)
     self.addCleanup(utils.delete_a_policy, self, self.policy_id)
     utils.cluster_attach_policy(self, self.cluster_id, self.policy_id)
Exemplo n.º 29
0
 def setUp(self):
     super(TestNodeCreateNegativeBadRequest, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.profile_id2 = utils.create_a_profile(
         self, spec=constants.spec_heat_stack)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id2)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 30
0
 def setUp(self):
     super(TestClusterUpdateNegativeProfileNotFound, self).setUp()
     # Create a profile
     profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, profile_id)
     self.profile_id = profile_id
     # Create a cluster
     self.cluster_id = utils.create_a_cluster(self, profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 31
0
 def setUp(self):
     super(TestClusterUpdateNegativeProfileNotFound, self).setUp()
     # Create a profile
     profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, profile_id)
     self.profile_id = profile_id
     # Create a cluster
     self.cluster_id = utils.create_a_cluster(self, profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 32
0
 def setUp(self):
     super(TestNodeCreateNegativeBadRequest, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.profile_id2 = utils.create_a_profile(
         self, spec=constants.spec_heat_stack)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id2)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 33
0
    def setUp(self):
        super(TestReceiverDelete, self).setUp()
        profile_id = utils.create_a_profile(self)
        self.addCleanup(utils.delete_a_profile, self, profile_id)

        cluster_id = utils.create_a_cluster(self, profile_id)
        self.addCleanup(utils.delete_a_cluster, self, cluster_id)

        self.receiver_id = utils.create_a_receiver(self.client, cluster_id,
                                                   'CLUSTER_RESIZE')
 def setUp(self):
     super(TestClusterAddNodesNegativeSizeCheckFailed, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id,
                                              desired_capacity=1,
                                              max_size=1)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
     self.node_id = utils.create_a_node(self, self.profile_id)
     self.addCleanup(utils.delete_a_node, self, self.node_id)
Exemplo n.º 35
0
 def setUp(self):
     super(TestClusterUpdate, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.profile_id_new = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id_new)
     self.cluster_id = utils.create_a_cluster(self,
                                              self.profile_id,
                                              desired_capacity=3)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 36
0
    def setUp(self):
        super(TestReceiverDelete, self).setUp()
        profile_id = utils.create_a_profile(self)
        self.addCleanup(utils.delete_a_profile, self, profile_id)

        cluster_id = utils.create_a_cluster(self, profile_id)
        self.addCleanup(utils.delete_a_cluster, self, cluster_id)

        self.receiver_id = utils.create_a_receiver(self.client, cluster_id,
                                                   'CLUSTER_RESIZE')
 def setUp(self):
     super(TestClusterDelNodesNegativeSizeCheckFailed, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id,
                                              desired_capacity=1,
                                              min_size=1)
     self.cluster = utils.get_a_cluster(self, self.cluster_id)
     self.node_id = self.cluster['nodes'][0]
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 38
0
 def setUp(self):
     super(TestClusterAddNodesNegativeSizeCheckFailed, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id,
                                              desired_capacity=1,
                                              max_size=1)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
     self.node_id = utils.create_a_node(self, self.profile_id)
     self.addCleanup(utils.delete_a_node, self, self.node_id)
Exemplo n.º 39
0
    def setUp(self):
        super(TestClusterPolicyShowNegativeNoPolicyBinding, self).setUp()
        profile_id = utils.create_a_profile(self)
        self.addCleanup(utils.delete_a_profile, self, profile_id)

        self.cluster_id = utils.create_a_cluster(self, profile_id)
        self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)

        self.policy_id = utils.create_a_policy(self)
        self.addCleanup(utils.delete_a_policy, self, self.policy_id)
Exemplo n.º 40
0
 def setUp(self):
     super(TestClusterDelNodesNegativeSizeCheckFailed, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.cluster_id = utils.create_a_cluster(self,
                                              self.profile_id,
                                              desired_capacity=1,
                                              min_size=1)
     self.cluster = utils.get_a_cluster(self, self.cluster_id)
     self.node_id = self.cluster['nodes'][0]
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 41
0
 def setUp(self):
     super(TestClusterActionReplaceNodes, self).setUp()
     profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, profile_id)
     self.cluster_id = utils.create_a_cluster(self, profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
     self.origin_node = utils.create_a_node(self,
                                            profile_id,
                                            cluster_id=self.cluster_id)
     self.addCleanup(utils.delete_a_node, self, self.origin_node)
     self.replace_node = utils.create_a_node(self, profile_id)
    def setUp(self):
        super(TestClusterAddNodesNegativeProfileTypeUnmatch, self).setUp()
        self.profile_id = utils.create_a_profile(self)
        self.addCleanup(utils.delete_a_profile, self, self.profile_id)
        self.cluster_id = utils.create_a_cluster(self, self.profile_id)
        self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)

        self.profile_id2 = utils.create_a_profile(
            self, spec=constants.spec_heat_stack)
        self.addCleanup(utils.delete_a_profile, self, self.profile_id2)
        self.node_id = utils.create_a_node(self, self.profile_id2)
        self.addCleanup(utils.delete_a_node, self, self.node_id)
Exemplo n.º 43
0
    def setUp(self):
        super(TestClusterAddNodesNegativeProfileTypeUnmatch, self).setUp()
        self.profile_id = utils.create_a_profile(self)
        self.addCleanup(utils.delete_a_profile, self, self.profile_id)
        self.cluster_id = utils.create_a_cluster(self, self.profile_id)
        self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)

        self.profile_id2 = utils.create_a_profile(
            self, spec=constants.spec_heat_stack)
        self.addCleanup(utils.delete_a_profile, self, self.profile_id2)
        self.node_id = utils.create_a_node(self, self.profile_id2)
        self.addCleanup(utils.delete_a_node, self, self.node_id)
Exemplo n.º 44
0
 def setUp(self):
     super(TestClusterUpdateNegativeProfileTypeUnmatch, self).setUp()
     # Create a profile
     profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, profile_id)
     self.profile_id = profile_id
     # Create a cluster
     self.cluster_id = utils.create_a_cluster(self, profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
     # Create a new profile of different type
     self.new_profile_id = utils.create_a_profile(
         self, spec=constants.spec_heat_stack)
     self.addCleanup(utils.delete_a_profile, self, self.new_profile_id)
Exemplo n.º 45
0
 def setUp(self):
     super(TestClusterUpdateNegativeProfileTypeUnmatch, self).setUp()
     # Create a profile
     profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, profile_id)
     self.profile_id = profile_id
     # Create a cluster
     self.cluster_id = utils.create_a_cluster(self, profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
     # Create a new profile of different type
     self.new_profile_id = utils.create_a_profile(
         self, spec=constants.spec_heat_stack)
     self.addCleanup(utils.delete_a_profile, self, self.new_profile_id)
Exemplo n.º 46
0
    def setUp(self):
        super(TestClusterDeleteNegativePolicyConflict, self).setUp()
        profile_id = utils.create_a_profile(self)
        self.addCleanup(utils.delete_a_profile, self, profile_id)

        self.cluster_id = utils.create_a_cluster(self, profile_id)
        self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)

        policy_id = utils.create_a_policy(self)
        self.addCleanup(utils.delete_a_policy, self, policy_id)

        utils.cluster_attach_policy(self, self.cluster_id, policy_id)
        self.addCleanup(utils.cluster_detach_policy, self, self.cluster_id,
                        policy_id)
Exemplo n.º 47
0
    def setUp(self):
        super(TestPolicyDeleteNegativeConflict, self).setUp()
        profile_id = utils.create_a_profile(self)
        self.addCleanup(utils.delete_a_profile, self, profile_id)

        cluster_id = utils.create_a_cluster(self, profile_id)
        self.addCleanup(utils.delete_a_cluster, self, cluster_id)

        self.policy_id = utils.create_a_policy(self)
        self.addCleanup(utils.delete_a_policy, self, self.policy_id)

        utils.cluster_attach_policy(self, cluster_id, self.policy_id)
        self.addCleanup(utils.cluster_detach_policy, self, cluster_id,
                        self.policy_id)
Exemplo n.º 48
0
 def setUp(self):
     super(TestBatchPolicy, self).setUp()
     self.new_profile2 = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.new_profile2)
     self.new_profile = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.new_profile)
     self.old_profile = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.old_profile)
     self.cluster_id = utils.create_a_cluster(self,
                                              self.old_profile,
                                              min_size=0,
                                              max_size=2,
                                              desired_capacity=2)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 49
0
    def setUp(self):
        super(TestClusterUpdateProfile, self).setUp()

        profile_id = utils.create_a_profile(self)
        self.addCleanup(utils.delete_a_profile, self, profile_id)

        # create a new profile
        new_spec = copy.deepcopy(constants.spec_nova_server)
        new_spec['properties']['flavor'] = 'new_flavor'
        new_spec['properties']['image'] = 'new_image'
        self.new_profile_id = utils.create_a_profile(self, new_spec)
        self.addCleanup(utils.delete_a_profile, self, self.new_profile_id)

        self.cluster_id = utils.create_a_cluster(self, profile_id)
        self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 50
0
    def setUp(self):
        super(TestReceiverDeleteNegativeBadRequest, self).setUp()
        profile_id = utils.create_a_profile(self)
        self.addCleanup(utils.delete_a_profile, self, profile_id)
        cluster_id = utils.create_a_cluster(self, profile_id)
        self.addCleanup(utils.delete_a_cluster, self, cluster_id)

        self.receiver_id1 = utils.create_a_receiver(self, cluster_id,
                                                    'CLUSTER_RESIZE',
                                                    name='r-01')
        self.addCleanup(utils.delete_a_receiver, self, self.receiver_id1)
        self.receiver_id2 = utils.create_a_receiver(self, cluster_id,
                                                    'CLUSTER_RESIZE',
                                                    name='r-01')
        self.addCleanup(utils.delete_a_receiver, self, self.receiver_id2)
Exemplo n.º 51
0
    def setUp(self):
        super(TestClusterDeleteNegativeReceiverConflict, self).setUp()
        profile_id = utils.create_a_profile(self)
        self.addCleanup(utils.delete_a_profile, self, profile_id)

        self.cluster_id = utils.create_a_cluster(self, profile_id)
        self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)

        self.receiver_id = utils.create_a_receiver(self,
                                                   self.cluster_id,
                                                   'CLUSTER_SCALE_OUT',
                                                   'webhook',
                                                   'fake',
                                                   params={'count': '1'})
        self.addCleanup(utils.delete_a_receiver, self, self.receiver_id)
Exemplo n.º 52
0
 def setUp(self):
     super(TestClusterUpdateNegativeProfileMultichoices, self).setUp()
     # Create a profile
     profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, profile_id)
     self.profile_id = profile_id
     # Create a cluster
     self.cluster_id = utils.create_a_cluster(self, profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
     # Create two new profiles of the same type with the same name
     new_spec = copy.deepcopy(constants.spec_nova_server)
     new_spec['properties']['flavor'] = 'new_flavor'
     new_profile_id1 = utils.create_a_profile(self, new_spec, name='p-nova')
     new_profile_id2 = utils.create_a_profile(self, new_spec, name='p-nova')
     self.addCleanup(utils.delete_a_profile, self, new_profile_id1)
     self.addCleanup(utils.delete_a_profile, self, new_profile_id2)
Exemplo n.º 53
0
    def setUp(self):
        super(TestWebhookTrigger, self).setUp()
        profile_id = utils.create_a_profile(self)
        self.addCleanup(utils.delete_a_profile, self, profile_id)

        cluster_id = utils.create_a_cluster(self, profile_id)
        self.addCleanup(utils.delete_a_cluster, self, cluster_id)

        params = {'max_size': 2}
        self.receiver_id = utils.create_a_receiver(self, cluster_id,
                                                   'CLUSTER_RESIZE',
                                                   params=params)
        self.addCleanup(self.client.delete_obj, 'receivers', self.receiver_id)

        receiver = self.client.get_obj('receivers', self.receiver_id)
        self.webhook_url = receiver['body']['channel']['alarm_url']
Exemplo n.º 54
0
 def setUp(self):
     super(TestClusterMembership, self).setUp()
     # Create a profile
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     # Create a cluster
     self.cluster_id = utils.create_a_cluster(self, self.profile_id,
                                              desired_capacity=0,
                                              min_size=0, max_size=3)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
     # Create three orphan nodes
     self.node_id1 = utils.create_a_node(self, self.profile_id)
     self.node_id2 = utils.create_a_node(self, self.profile_id)
     self.node_id3 = utils.create_a_node(self, self.profile_id)
     self.addCleanup(utils.delete_a_node, self, self.node_id1)
     self.addCleanup(utils.delete_a_node, self, self.node_id2)
     self.addCleanup(utils.delete_a_node, self, self.node_id3)
Exemplo n.º 55
0
 def setUp(self):
     super(TestNodeCreateShowListDelete, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
 def setUp(self):
     super(TestClusterPolicyDetachNegativePolicyNotFound, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)
Exemplo n.º 57
0
 def setUp(self):
     super(TestReceiverCreate, self).setUp()
     self.profile_id = utils.create_a_profile(self)
     self.addCleanup(utils.delete_a_profile, self, self.profile_id)
     self.cluster_id = utils.create_a_cluster(self, self.profile_id)
     self.addCleanup(utils.delete_a_cluster, self, self.cluster_id)