Beispiel #1
0
 def test_create_multiple_clusters_success(self, check_cluster):
     MULTIPLE_CLUSTERS = SAMPLE_CLUSTER.copy()
     MULTIPLE_CLUSTERS['count'] = 2
     clusters = api.create_multiple_clusters(MULTIPLE_CLUSTERS)
     self.assertEqual(2, check_cluster.call_count)
     result_cluster1 = api.get_cluster(clusters['clusters'][0])
     result_cluster2 = api.get_cluster(clusters['clusters'][1])
     self.assertEqual('Active', result_cluster1.status)
     self.assertEqual('Active', result_cluster2.status)
     expected_count = {
         'ng_1': 1,
         'ng_2': 3,
         'ng_3': 1,
     }
     ng_count = 0
     for ng in result_cluster1.node_groups:
         self.assertEqual(expected_count[ng.name], ng.count)
         ng_count += 1
     self.assertEqual(3, ng_count)
     api.terminate_cluster(result_cluster1.id)
     api.terminate_cluster(result_cluster2.id)
     self.assertEqual(
         ['get_open_ports', 'recommend_configs', 'validate',
          'ops.provision_cluster',
          'get_open_ports', 'recommend_configs', 'validate',
          'ops.provision_cluster',
          'ops.terminate_cluster',
          'ops.terminate_cluster'], self.calls_order)
Beispiel #2
0
 def test_create_multiple_clusters_success(self, check_cluster):
     MULTIPLE_CLUSTERS = SAMPLE_CLUSTER.copy()
     MULTIPLE_CLUSTERS['count'] = 2
     clusters = api.create_multiple_clusters(MULTIPLE_CLUSTERS)
     self.assertEqual(2, check_cluster.call_count)
     result_cluster1 = api.get_cluster(clusters['clusters'][0])
     result_cluster2 = api.get_cluster(clusters['clusters'][1])
     self.assertEqual(c_u.CLUSTER_STATUS_ACTIVE, result_cluster1.status)
     self.assertEqual(c_u.CLUSTER_STATUS_ACTIVE, result_cluster2.status)
     expected_count = {
         'ng_1': 1,
         'ng_2': 3,
         'ng_3': 1,
     }
     ng_count = 0
     for ng in result_cluster1.node_groups:
         self.assertEqual(expected_count[ng.name], ng.count)
         ng_count += 1
     self.assertEqual(3, ng_count)
     api.terminate_cluster(result_cluster1.id)
     api.terminate_cluster(result_cluster2.id)
     self.assertEqual(
         ['get_open_ports', 'recommend_configs', 'validate',
          'ops.provision_cluster',
          'get_open_ports', 'recommend_configs', 'validate',
          'ops.provision_cluster',
          'ops.terminate_cluster',
          'ops.terminate_cluster'], self.calls_order)
Beispiel #3
0
def clusters_create_multiple(data):
    return u.render(api.create_multiple_clusters(data))
Beispiel #4
0
def clusters_create_multiple(data):
    return u.render(api.create_multiple_clusters(data))