예제 #1
0
 def test_create_hdfs_dir(self, create_dir_hadoop2):
     eng = edp_engine.EdpOozieEngine(get_cluster())
     remote = mock.Mock()
     dir_name = mock.Mock()
     eng.create_hdfs_dir(remote, dir_name)
     create_dir_hadoop2.assert_called_once_with(remote, dir_name,
                                                eng.get_hdfs_user())
예제 #2
0
    def test_validate_job_execution(self, c):
        cluster = get_cluster()
        eng = edp_engine.EdpOozieEngine(cluster)
        eng.validate_job_execution(cluster, mock.Mock(), mock.Mock())

        # more than one oozie server
        dict.__setitem__(cluster.node_groups[1], 'count', 2)
        self.assertRaises(pl_ex.InvalidComponentCountException,
                          eng.validate_job_execution, cluster, mock.Mock(),
                          mock.Mock())
예제 #3
0
 def test_get_oozie_server(self):
     cluster = get_cluster()
     eng = edp_engine.EdpOozieEngine(cluster)
     actual = eng.get_oozie_server(cluster)
     expect = cluster.node_groups[1].instances[0]
     self.assertEqual(expect, actual)
예제 #4
0
 def test_get_resource_manager_uri(self):
     cluster = get_cluster()
     eng = edp_engine.EdpOozieEngine(cluster)
     uri = eng.get_resource_manager_uri(cluster)
     self.assertEqual("master_inst.novalocal:8032", uri)
예제 #5
0
 def test_get_name_node_uri(self):
     cluster = get_cluster()
     eng = edp_engine.EdpOozieEngine(cluster)
     uri = eng.get_name_node_uri(cluster)
     self.assertEqual("hdfs://master_inst.novalocal:8020", uri)
예제 #6
0
 def test_get_oozie_server_uri(self):
     cluster = get_cluster()
     eng = edp_engine.EdpOozieEngine(cluster)
     uri = eng.get_oozie_server_uri(cluster)
     self.assertEqual("http://1.2.3.5:11000/oozie", uri)
예제 #7
0
 def test_get_hdfs_user(self):
     eng = edp_engine.EdpOozieEngine(get_cluster())
     self.assertEqual('hdfs', eng.get_hdfs_user())
예제 #8
0
 def get_edp_engine(self, cluster, job_type):
     if job_type in edp_engine.EdpOozieEngine.get_supported_job_types():
         return edp_engine.EdpOozieEngine(cluster)
     return None