def test_create_yarn_cluster(self):
        # arrange
        expected_masterip = '127.0.0.1'
        expected_vm_dict = [{'name': 'f_vm', 'adminPass': '******'}, {'name': 'f_2 vm', 'adminPass': '******'}]
        c_yarn_cluster = YarnCluster(self.opts)
 
        # act
        returned_masterip, returned_vm_dict = c_yarn_cluster.create_yarn_cluster()
        # assert
        self.assertTupleEqual((expected_masterip, expected_vm_dict), (returned_masterip, returned_vm_dict))
Beispiel #2
0
         raise ClientError(msg,error_fatal)
         
 if not skip_cluster_create:
     try:
         cluster_options = check_cluster_options(cluster_options,dsl,token,map_dsl_to_cluster)
     except ClientError,e:
         msg = str(e.args[0])
         action_stop(token, id, current_task, msg)
         raise e
     # cluster section
     # only need to import create cluster if we are going to be making a cluster
     from backend.create_cluster import YarnCluster
     state_msg = 'Started experiment cluster creation'
     action_continue(token, id, current_task, state_msg)
     c_cluster = YarnCluster(cluster_options)
     MASTER_IP, servers, password, cluster_id = c_cluster.create_yarn_cluster()
     if cluster_id > 0:
         state_msg = 'Experiment cluster created successfully'
         action_continue(token, id, current_task, state_msg)
         cluster_id_for_replay = cluster_id
     else:
         state_msg = 'Experiment cluster creation failed'
         action_stop(token, id, current_task, state_msg)
         raise ClientError(state_msg, error_fatal)
 
 # actions section
 actions = dsl_data_dict.get('actions',[])
 if len(actions)>0 and cluster_id_for_replay is not None:
     try:
         actions = check_actions(actions, dsl, token)
     except ClientError,e: