def test_if_rlimits_can_be_used(dcos_api_session):
 name = 'test-rlimits-{}'.format(uuid.uuid4().hex)
 argv = ['/opt/mesosphere/bin/mesos-execute', '--rlimits={"rlimits": [{"type":"RLMT_CORE"}]}', '--master=leader.mesos:5050', '--name={}'.format(name), '--command=ulimit -c | grep -q unlimited', '--shell=true', '--env={"LC_ALL":"C"}']
 output = subprocess.check_output(argv, stderr=subprocess.STDOUT, universal_newlines=True)
 expected_output = "Received status update TASK_FINISHED for task '{name}'".format(name=name)
 assert (expected_output in output)

def test_if_rlimits_can_be_used ( dcos_api_session ) : name = 'test-rlimits-{}' . format ( uuid . uuid4 ( ) . hex ) argv = [ '/opt/mesosphere/bin/mesos-execute' , '--rlimits={"rlimits": [{"type":"RLMT_CORE"}]}' , '--master=leader.mesos:5050' , '--name={}' . format ( name ) , '--command=ulimit -c | grep -q unlimited' , '--shell=true' , '--env={"LC_ALL":"C"}' ] output = subprocess . check_output ( argv , stderr = subprocess . STDOUT , universal_newlines = True ) expected_output = "Received status update TASK_FINISHED for task '{name}'" . format ( name = name ) assert ( expected_output in output )
this test verifies that rlimits can be used .