summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/nat_port_forward
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2018-09-26 16:23:29 +0200
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2018-09-26 16:23:29 +0200
commit03c9d6d8441e3293b058fed270866419781b734c (patch)
treea456f12f5c26c836685c6e47c95cfe2897e43723 /kpov_judge/tasks/nat_port_forward
parent3938c69f3e1586c1ffbcae5395414ca8480e6ba4 (diff)
Run 2to3
Some stuff is broken now.
Diffstat (limited to 'kpov_judge/tasks/nat_port_forward')
-rw-r--r--kpov_judge/tasks/nat_port_forward/task.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/kpov_judge/tasks/nat_port_forward/task.py b/kpov_judge/tasks/nat_port_forward/task.py
index 645b20f..2688268 100644
--- a/kpov_judge/tasks/nat_port_forward/task.py
+++ b/kpov_judge/tasks/nat_port_forward/task.py
@@ -4,7 +4,7 @@
# kpov_random_helpers should be imported by add_assignment.py
instructions = {
- 'si':u"""
+ 'si':"""
Postavi tri računalnike - SimpleArbiter z diska simpleArbiter, TestClient z diska testClient in NATServer. NATServer naj ima dva omrežna vmesnika - z enim naj bo
povezan na omrežje, od koder bo imel dostop do Interneta, z drugim pa na SimpleArbiter. TestClient naj bo povezan na isto omrežje z dostopom do Interneta kot NATServer.
Poskrbi, da bo NATServer služil kot DHCP strežnik ter privzeti prehod za SimpleArbiter.
@@ -66,7 +66,7 @@ params_meta = {
'IP_NAT': {'descriptions': {'si': 'Naslov NATServer, dostopen s TestClient'}, 'w': True, 'public':True, 'type': 'IP', 'generated': False},
'PORT_OUTER': {'descriptions': {'si': 'Zunanja vrata'}, 'w': False, 'public':True, 'type': 'port', 'generated': True},
'PORT_INNER': {'descriptions': {'si': 'Notranja vrata'}, 'w': False, 'public': True, 'type': 'port', 'generated': True},
- 'NET': {'descriptions': {'si': u'Področje naslovov med SimpleArbiter in TestClient'}, 'w': False, 'public': True, 'type': 'NET', 'generated': True},
+ 'NET': {'descriptions': {'si': 'Področje naslovov med SimpleArbiter in TestClient'}, 'w': False, 'public': True, 'type': 'NET', 'generated': True},
}
def task(IP_TEST_CLIENT, IP_NAT, PORT_OUTER, PORT_INNER, NET):
@@ -86,7 +86,7 @@ def task(IP_TEST_CLIENT, IP_NAT, PORT_OUTER, PORT_INNER, NET):
k = r.randint(10, 15)
results['pre_nc'] = str(k)
results['nc_pre'] = ""
- for i in xrange(k):
+ for i in range(k):
sshconn.sendline("nc {} {}".format(IP_NAT, PORT_OUTER))
sshconn.sendline()
sshconn.sendintr()
@@ -96,7 +96,7 @@ def task(IP_TEST_CLIENT, IP_NAT, PORT_OUTER, PORT_INNER, NET):
sshconn.sendline()
sshconn.prompt()
sshconn.sendline("nc {} {}".format(IP_NAT, PORT_OUTER))
- results['post_nc'] = "".join([r.choice("abcd\n") for i in xrange(100)])
+ results['post_nc'] = "".join([r.choice("abcd\n") for i in range(100)])
sshconn.sendline(results['post_nc'])
time.sleep(1)
sshconn.sendintr()
@@ -126,7 +126,7 @@ def gen_params(user_id, params_meta):
def task_check(results, params):
import re
- import cPickle
+ import pickle
#if results is None:
# with open('bla.pickle') as f:
# results = cPickle.load(f)