Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
c04f3e09
Commit
c04f3e09
authored
Feb 21, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test that the sandbox can't get to the network.
parent
9dbfca12
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
common/lib/codejail/codejail/tests/test_jailpy.py
+12
-0
No files found.
common/lib/codejail/codejail/tests/test_jailpy.py
View file @
c04f3e09
...
@@ -96,6 +96,18 @@ class TestLimits(JailPyHelpers, unittest.TestCase):
...
@@ -96,6 +96,18 @@ class TestLimits(JailPyHelpers, unittest.TestCase):
self
.
assertEqual
(
res
.
stdout
,
"Trying
\n
"
)
self
.
assertEqual
(
res
.
stdout
,
"Trying
\n
"
)
self
.
assertIn
(
"ermission denied"
,
res
.
stderr
)
self
.
assertIn
(
"ermission denied"
,
res
.
stderr
)
def
test_cant_use_network
(
self
):
res
=
jailpy
(
dedent
(
"""
\
import urllib
print "Reading google"
u = urllib.urlopen("http://google.com")
google = u.read()
print len(google)
"""
))
self
.
assertNotEqual
(
res
.
status
,
0
)
self
.
assertEqual
(
res
.
stdout
,
"Reading google
\n
"
)
self
.
assertIn
(
"IOError"
,
res
.
stderr
)
# TODO: write files
# TODO: write files
# TODO: read network
# TODO: read network
# TODO: fork
# TODO: fork
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment