def test_launch_app_on_public_agent(): """ Test the successful launch of a mesos container on public agent. MoMs by default do not have slave_public access. """ client = marathon.create_client() app_def = common.add_role_constraint_to_app_def(apps.mesos_app(), ['slave_public']) client.add_app(app_def) shakedown.deployment_wait() tasks = client.get_tasks(app_def["id"]) task_ip = tasks[0]['host'] assert task_ip in shakedown.get_public_agents(), "The application task got started on a private agent"
def test_launch_app_on_public_agent(): """ Test the successful launch of a mesos container on public agent. MoMs by default do not have slave_public access. """ client = marathon.create_client() app_id = uuid.uuid4().hex app_def = common.add_role_constraint_to_app_def(app_mesos(app_id).copy(), ['slave_public']) client.add_app(app_def) shakedown.deployment_wait() tasks = client.get_tasks(app_id) task_ip = tasks[0]['host'] assert task_ip in shakedown.get_public_agents()