def test_ui_registration_requirement(): """ Testing the UI is a challenge with this toolchain. The UI team has the best tooling for testing it. This test verifies that the required configurations for the service endpoint and ability to launch to the service UI are present. """ tasks = mesos.get_master().tasks() for task in tasks: if task['name'] == 'marathon-user': for label in task['labels']: if label['key'] == 'DCOS_PACKAGE_NAME': assert label['value'] == 'marathon' if label['key'] == 'DCOS_SERVICE_NAME': assert label['value'] == 'marathon-user'
def get_service(service_name, inactive=False, completed=False): """ Get a dictionary describing a service :param service_name: the service name :type service_name: str :param inactive: whether to include inactive services :type inactive: bool :param completed: whether to include completed services :type completed: bool :return: a dict describing a service :rtype: dict, or None """ services = mesos.get_master().frameworks(inactive=inactive, completed=completed) for service in services: if service['name'] == service_name: return service return None
def get_mesos_tasks(): """ Get a list of mesos tasks """ return mesos.get_master().tasks()