Commit 7df8265c by Ned Batchelder

This test was misnamed, and is now skipped.

The test was written when I thought I could limit many small files. I've
changed it back to assert that the many files were prevented, but since
we don't prevent them yet, I've skipped the test.
parent 274aa878
...@@ -213,10 +213,13 @@ class TestLimits(JailCodeHelpers, unittest.TestCase): ...@@ -213,10 +213,13 @@ class TestLimits(JailCodeHelpers, unittest.TestCase):
self.assertIn("IOError", res.stderr) self.assertIn("IOError", res.stderr)
def test_cant_write_many_small_temp_files(self): def test_cant_write_many_small_temp_files(self):
# We would like this to fail, but there's nothing that checks total
# file size written, so the sandbox does not prevent it yet.
raise SkipTest("There's nothing checking total file size yet.")
set_limit('FSIZE', 1000) set_limit('FSIZE', 1000)
res = jailpy(code="""\ res = jailpy(code="""\
import os, tempfile import os, tempfile
print "Trying mkstemp" print "Trying mkstemp 250"
for i in range(250): for i in range(250):
f, path = tempfile.mkstemp() f, path = tempfile.mkstemp()
os.close(f) os.close(f)
...@@ -226,8 +229,9 @@ class TestLimits(JailCodeHelpers, unittest.TestCase): ...@@ -226,8 +229,9 @@ class TestLimits(JailCodeHelpers, unittest.TestCase):
assert f2.read() == "hello" assert f2.read() == "hello"
print "Finished 250" print "Finished 250"
""") """)
self.assertResultOk(res) self.assertNotEqual(res.status, 0)
self.assertEqual(res.stdout, "Trying mkstemp\nFinished 250\n") self.assertEqual(res.stdout, "Trying mkstemp 250\n")
self.assertIn("IOError", res.stderr)
def test_cant_use_network(self): def test_cant_use_network(self):
res = jailpy(code="""\ res = jailpy(code="""\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment