Ejemplo n.º 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())
Ejemplo n.º 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())
Ejemplo n.º 3
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)

        # has HDFS_JOURNALNODE
        cluster = get_cluster()
        jns_node_group = mock.MagicMock()
        jns_node_group.node_processes = ['HDFS_JOURNALNODE']
        jns_node_group.instances = [mock.Mock()]
        list.append(cluster.node_groups, jns_node_group)
        uri = eng.get_name_node_uri(cluster)
        self.assertEqual("hdfs://nameservice01", uri)
Ejemplo n.º 4
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)
Ejemplo n.º 5
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)
Ejemplo n.º 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)
Ejemplo n.º 7
0
 def test_get_hdfs_user(self):
     eng = edp_engine.EdpOozieEngine(get_cluster())
     self.assertEqual('hdfs', eng.get_hdfs_user())