def setUp(self): super(TestNodeShowNegativeBadRequest, self).setUp() profile_id = utils.create_a_profile(self) self.addCleanup(utils.delete_a_profile, self, profile_id) self.node_id1 = utils.create_a_node(self, profile_id, name='n-01') self.node_id2 = utils.create_a_node(self, profile_id, name='n-01') self.addCleanup(utils.delete_a_node, self, self.node_id1) self.addCleanup(utils.delete_a_node, self, self.node_id2)
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(TestClusterReplaceNodeNegativeOldOrphan, 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) self.addCleanup(utils.delete_a_node, self, self.old_node) self.new_node = utils.create_a_node(self, self.profile_id) self.addCleanup(utils.delete_a_node, self, self.new_node)
def test_node_create_show_list_delete(self): # Create an orphan node name = data_utils.rand_name('node') metadata = {'k1': 'v1'} role = 'individual' node_id1 = utils.create_a_node(self, self.profile_id, metadata=metadata, role=role, name=name) # Verify creation result node1 = utils.get_a_node(self, node_id1) self.assertIsNotNone(node1) self.assertEqual(name, node1['name']) self.assertEqual(metadata, node1['metadata']) self.assertEqual(role, node1['role']) self.assertEqual('', node1['cluster_id']) self.assertNotIn('details', node1) # Get node with detail node1 = utils.get_a_node(self, node_id1, show_details=True) self.assertIn('details', node1) self.assertIsNotNone(node1['details']) # Create second node with target cluster name = data_utils.rand_name('node') node_id2 = utils.create_a_node(self, self.profile_id, cluster_id=self.cluster_id, metadata=metadata, role=role, name=name) # Verify creation result node2 = utils.get_a_node(self, node_id2) self.assertIsNotNone(node2) self.assertEqual(self.cluster_id, node2['cluster_id']) cluster = utils.get_a_cluster(self, self.cluster_id) self.assertIn(node_id2, cluster['nodes']) # List nodes nodes = utils.list_nodes(self) self.assertIsNotNone(nodes) self.assertEqual(2, len(nodes)) node_ids = [n['id'] for n in nodes] self.assertIn(node_id1, node_ids) self.assertIn(node_id2, node_ids) # Delete nodes utils.delete_a_node(self, node_id1) utils.delete_a_node(self, node_id2)
def setUp(self): super(TestNodeShow, self).setUp() profile_id = utils.create_a_profile(self) self.addCleanup(utils.delete_a_profile, self, profile_id) self.node_id = utils.create_a_node(self, profile_id) self.addCleanup(utils.delete_a_node, self, self.node_id)
def setUp(self): super(TestNodeOperationNegativeEngineFailure, self).setUp() profile_id = utils.create_a_profile(self) self.addCleanup(utils.delete_a_profile, self, profile_id) self.node_id = utils.create_a_node(self, profile_id) self.addCleanup(utils.delete_a_node, self, self.node_id)
def setUp(self): super(TestClusterReplaceNodeNegativeProfileUnmatch, self).setUp() self.profile_id = utils.create_a_profile( self, spec=constants.spec_nova_server) 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, self.cluster_id) self.addCleanup(utils.delete_a_node, self, self.old_node) self.profile_id2 = utils.create_a_profile( self, spec=constants.spec_heat_stack) self.addCleanup(utils.delete_a_profile, self, self.profile_id2) self.new_node = utils.create_a_node(self, self.profile_id2) self.addCleanup(utils.delete_a_node, self, self.new_node)
def setUp(self): super(TestClusterCollect, 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.node1 = utils.create_a_node(self, profile_id, name='N01', cluster_id=self.cluster_id) self.addCleanup(utils.delete_a_node, self, self.node1) self.node2 = utils.create_a_node(self, profile_id, name='N02', cluster_id=self.cluster_id) self.addCleanup(utils.delete_a_node, self, self.node2)
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(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)
def setUp(self): super(TestClusterDelNodesNegativeOrphanNode, 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 test_node_create_show_list_delete(self): # Create an orphan node name = data_utils.rand_name('node') metadata = {'k1': 'v1'} role = 'individual' node_id1 = utils.create_a_node( self, self.profile_id, metadata=metadata, role=role, name=name) # Verify creation result node1 = utils.get_a_node(self, node_id1) self.assertIsNotNone(node1) self.assertEqual(name, node1['name']) self.assertEqual(metadata, node1['metadata']) self.assertEqual(role, node1['role']) self.assertEqual('', node1['cluster_id']) self.assertNotIn('details', node1) # Get node with detail node1 = utils.get_a_node(self, node_id1, show_details=True) self.assertIn('details', node1) self.assertIsNotNone(node1['details']) # Create second node with target cluster name = data_utils.rand_name('node') node_id2 = utils.create_a_node( self, self.profile_id, cluster_id=self.cluster_id, metadata=metadata, role=role, name=name) # Verify creation result node2 = utils.get_a_node(self, node_id2) self.assertIsNotNone(node2) self.assertEqual(self.cluster_id, node2['cluster_id']) cluster = utils.get_a_cluster(self, self.cluster_id) self.assertIn(node_id2, cluster['nodes']) # List nodes nodes = utils.list_nodes(self) self.assertIsNotNone(nodes) self.assertEqual(2, len(nodes)) node_ids = [n['id'] for n in nodes] self.assertIn(node_id1, node_ids) self.assertIn(node_id2, node_ids) # Delete nodes utils.delete_a_node(self, node_id1) utils.delete_a_node(self, node_id2)
def setUp(self): super(TestNodeUpdate, 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.node_id = utils.create_a_node(self, self.profile_id) self.addCleanup(utils.delete_a_node, self, self.node_id)
def setUp(self): super(TestNodeUpdateNegativeProfileNotFound, 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 node self.node_id = utils.create_a_node(self, profile_id) self.addCleanup(utils.delete_a_node, self, self.node_id)
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)
def setUp(self): super(TestClusterReplaceNodesNegativeNewNotFound, 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)
def setUp(self): super(TestNodeUpdate, self).setUp() profile_id = utils.create_a_profile(self) self.addCleanup(utils.delete_a_profile, self, profile_id) self.node_id = utils.create_a_node(self, profile_id, name='node1', metadata={'k1': 'v1'}, role='member') self.addCleanup(utils.delete_a_node, self, self.node_id)
def setUp(self): super(TestClusterAddNodesNegativeNodeNotOrphan, 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.addCleanup(utils.delete_a_cluster, self, self.cluster_id2) self.node_id = utils.create_a_node(self, self.profile_id, cluster_id=self.cluster_id2)
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)
def setUp(self): super(TestNodeUpdateNegativeProfileTypeUnmatch, 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 node self.node_id = utils.create_a_node(self, profile_id) self.addCleanup(utils.delete_a_node, self, self.node_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)
def setUp(self): super(TestNodeUpdateProfile, self).setUp() profile_id = utils.create_a_profile(self) self.addCleanup(utils.delete_a_profile, self, profile_id) 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.node_id = utils.create_a_node(self, profile_id) self.addCleanup(utils.delete_a_node, self, self.node_id)
def setUp(self): super(TestNodeUpdateNegativeProfileMultichoices, 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 node self.node_id = utils.create_a_node(self, profile_id) self.addCleanup(utils.delete_a_node, self, self.node_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)
def setUp(self): super(TestClusterUpdateProfile, self).setUp() self.old_profile_id = utils.create_a_profile(self) self.addCleanup(utils.delete_a_profile, self, self.old_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, self.old_profile_id) self.addCleanup(utils.delete_a_cluster, self, self.cluster_id) self.node1_id = utils.create_a_node(self, self.old_profile_id, name='N01', cluster_id=self.cluster_id) self.addCleanup(utils.delete_a_node, self, self.node1_id)
def setUp(self): super(TestClusterReplaceNodes, 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, max_size=10) self.addCleanup(utils.delete_a_cluster, self, self.cluster_id) self.old_id1 = utils.create_a_node(self, self.profile_id, self.cluster_id) self.old_id2 = utils.create_a_node(self, self.profile_id, self.cluster_id) self.old_id3 = utils.create_a_node(self, self.profile_id, self.cluster_id) self.addCleanup(utils.delete_a_node, self, self.old_id3) self.addCleanup(utils.delete_a_node, self, self.old_id2) self.addCleanup(utils.delete_a_node, self, self.old_id1) # Create three orphan nodes self.new_id1 = utils.create_a_node(self, self.profile_id) self.new_id2 = utils.create_a_node(self, self.profile_id) self.new_id3 = utils.create_a_node(self, self.profile_id)