def test_octarine_srv(dcos_api_session, timeout=30):
 test_uuid = uuid.uuid4().hex[:16]
 octarine_id = uuid.uuid4().hex
 proxy = ('"http://127.0.0.1:$(/opt/mesosphere/bin/octarine ' + '--client --port {})"'.format(octarine_id))
 port_name = 'pinger'
 cmd = ('/opt/mesosphere/bin/octarine {} & '.format(octarine_id) + '/opt/mesosphere/bin/python -m http.server ${PORT0}')
 raw_app_id = 'integration-test-app-octarine-srv-{}'.format(test_uuid)
 check_command = 'curl --fail --proxy {} _{}._{}._tcp.marathon.mesos.mydcos.directory'.format(proxy, port_name, raw_app_id)
 app_definition = {'id': '/{}'.format(raw_app_id), 'cpus': 0.1, 'mem': 128, 'cmd': cmd, 'disk': 0, 'instances': 1, 'portDefinitions': [{'port': 0, 'protocol': 'tcp', 'name': port_name, 'labels': {}}], 'healthChecks': [{'protocol': 'COMMAND', 'command': {'value': check_command}, 'gracePeriodSeconds': 5, 'intervalSeconds': 10, 'timeoutSeconds': 10, 'maxConsecutiveFailures': 3}]}
 dcos_api_session.marathon.deploy_and_cleanup(app_definition)

def test_octarine_srv ( dcos_api_session , timeout = 30 ) : test_uuid = uuid . uuid4 ( ) . hex [ : 16 ] octarine_id = uuid . uuid4 ( ) . hex proxy = ( '"http://127.0.0.1:$(/opt/mesosphere/bin/octarine ' + '--client --port {})"' . format ( octarine_id ) ) port_name = 'pinger' cmd = ( '/opt/mesosphere/bin/octarine {} & ' . format ( octarine_id ) + '/opt/mesosphere/bin/python -m http.server ${PORT0}' ) raw_app_id = 'integration-test-app-octarine-srv-{}' . format ( test_uuid ) check_command = 'curl --fail --proxy {} _{}._{}._tcp.marathon.mesos.mydcos.directory' . format ( proxy , port_name , raw_app_id ) app_definition = { 'id' : '/{}' . format ( raw_app_id ) , 'cpus' : 0.1 , 'mem' : 128 , 'cmd' : cmd , 'disk' : 0 , 'instances' : 1 , 'portDefinitions' : [ { 'port' : 0 , 'protocol' : 'tcp' , 'name' : port_name , 'labels' : { } } ] , 'healthChecks' : [ { 'protocol' : 'COMMAND' , 'command' : { 'value' : check_command } , 'gracePeriodSeconds' : 5 , 'intervalSeconds' : 10 , 'timeoutSeconds' : 10 , 'maxConsecutiveFailures' : 3 } ] } dcos_api_session . marathon . deploy_and_cleanup ( app_definition )
test resolving srv records through octarine .