Exemple #1
0
 def test_get_service_name_by_node_process(self):
     ctx = self._get_context()
     s_name_1 = ctx.get_service_name_by_node_process(yarn.RESOURCE_MANAGER)
     self.assertEqual(yarn.YARN().ui_name, s_name_1)
     s_name_2 = ctx.get_service_name_by_node_process(
         yarn.RESOURCE_MANAGER.ui_name)
     self.assertEqual(yarn.YARN().ui_name, s_name_2)
     not_existing_np = np.NodeProcess('not_existing', 'NotExisting', 'foo')
     self.assertIsNone(
         ctx.get_service_name_by_node_process(not_existing_np))
     self.assertIsNone(
         ctx.get_service_name_by_node_process(not_existing_np.ui_name))
Exemple #2
0
 def test_get_cluster_services(self):
     ctx = self._get_context()
     actual_services = ctx.get_cluster_services()
     actual_services_names = map(lambda s: s.ui_name, actual_services)
     expected_services_names = [
         yarn.YARN().ui_name,
         management.Management().ui_name,
         maprfs.MapRFS().ui_name,
         oozie.Oozie().ui_name,
         swift.Swift().ui_name,
     ]
     self.assertEqual(sorted(actual_services_names),
                      sorted(expected_services_names))
Exemple #3
0
 def test_get_service(self):
     ctx = self._get_context()
     service = ctx.get_service(yarn.HISTORY_SERVER)
     self.assertEqual(yarn.YARN().ui_name, service.ui_name)
     with testtools.ExpectedException(e.InvalidDataException):
         ctx.get_service(self.fake_np)