summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/rename_grep_network
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge/tasks/rename_grep_network')
-rw-r--r--kpov_judge/tasks/rename_grep_network/task.py42
1 files changed, 21 insertions, 21 deletions
diff --git a/kpov_judge/tasks/rename_grep_network/task.py b/kpov_judge/tasks/rename_grep_network/task.py
index 91ace1a..ce3661b 100644
--- a/kpov_judge/tasks/rename_grep_network/task.py
+++ b/kpov_judge/tasks/rename_grep_network/task.py
@@ -12,7 +12,7 @@ instructions = {
'si': u"""
Ustvari dva navidezna računalnika s slikama diskov
- SimpleArbiterExam s sliko diska simpleArbiterDhcp in
-SmallStudent s slikama diska student-entrance4
+SmallStudent s slikama diska student-entrance3
in smallstudent-personal.
Drugi razdelek na sliki smallstudent-personal priklopi na imenik {mntdir}
@@ -26,12 +26,11 @@ Na SmallStudent ustvari uporabnika {testuser} z geslom {passwd}.
Na smallstudent-personal je nekje skrita
datoteka, ki vsebuje niz {magicstr}.
-Skopiraj jo v domači imenik {testuser} in preimenuj tako, da vse znake 'O' v imenu zamenjaš s 'K'.
-V kopiji zamenjaj vse pojavitve številke "12" z "dvanajst".
-Pazi, da nobena druga datoteka v domačem imeniku v svojem imenu ne bo vsebovala "K".
+Skopiraj jo v domači imenik {testuser} in preimenuj tako, da vse znake 'O' v imenu zamenjaš z 'I'.
+Pazi, da nobena druga datoteka v domačem imeniku v svojem imenu ne bo vsebovala "I".
Poskrbi, da bo lastnik {testuser}, skupina pa naj ostane nespremenjena.
-Brati naj jo ima pravico samo lastnik, pisati lastnik in ostali, poganjati le skupina.
+Brati naj jo ima pravico samo lastnik, pisati lastnik in skupina, poganjati nihče.
""",
'en': u'''
''',
@@ -60,7 +59,7 @@ computers = {
'SmallStudent': {
'disks': [
{
- 'name': 'student-entrance3',
+ 'name': 'student-entrance4',
# 'parts': [{'dev': 'sda1', 'path': '/'}],
},
{
@@ -223,22 +222,23 @@ def task_check(results, params):
score = 0
hidden_contents = params['magicstr']
r = random.Random(params['rndseed'])
- dstfile = "".join([r.choice("qQoOp") for i in range(64)]) + "K.txt"
- dstfile = dstfile.replace('O', 'K')
+ dstfile = "".join([r.choice("qQoOp") for i in range(64)]) + "I.txt"
+ dstfile = dstfile.replace('O', 'I')
for i in range(1000):
start = "".join([r.choice(["po", "p0", "no", "ko", "fo", "qo"]) for i in range(20)])
- mid = "".join([r.choice("1lIi") + r.choice("zZ2") for i in range(60)])
+ mid = "".join([r.choice("uiasdfghjkyxcvbnm1234567890ASDFGHJKYZXCVBNM") for i in range(60)])
+ end = r.choice(["lz", "1z", "Iz", "iz", "l2", "I2", "12"])
#if start[:2] == "po" and end == "lz":
# start = "po"
# mid = "kaka"
- x = start + mid
+ x = start + mid + end
hidden_contents += x + "\r\n"
- #expected_contents = hidden_contents
- expected_contents = re.sub(r"12",
- r"dvanajst",
- hidden_contents,
- re.MULTILINE)
- expected_contents = "cat ~/*K*.txt\r\n".format(dstfile) + expected_contents
+ expected_contents = hidden_contents
+ #expected_contents = re.sub(r"^po.*lz\r$",
+ # r"pokakalz\r",
+ # hidden_contents,
+ # re.MULTILINE)
+ expected_contents = "cat ~/*I*.txt\r\n".format(dstfile) + expected_contents
if results["dst_file_contents"] == expected_contents:
score += 3
else:
@@ -252,7 +252,7 @@ def task_check(results, params):
hints += ["wrong file contents\n" + str(diff_pos[1])]
#hints += ["wrong file contents"]
params['dstfile'] = dstfile
- expected_dst_ls = u"ls -l ~/\\*K\\*.txt\r\n-rw---x-w- 1 {testuser} bilbo .*{dstfile}\r\n".format(**params)
+ expected_dst_ls = u"ls -l ~/\\*I\\*.txt\r\n-rw--w---- 1 {testuser} bilbo .*{dstfile}\r\n".format(**params)
if re.match(expected_dst_ls, results["dst_ls"]):
score += 2
else:
@@ -284,10 +284,10 @@ def prepare_disks(templates, task_params, global_params):
r = random.Random(task_params['rndseed'])
dstfile = "".join([r.choice("qQoOp") for i in range(64)]) + "I.txt"
for i in range(1000):
-
- start = "".join([r.choice(["po", "p0", "no", "ko", "fo", "qo"]) for i in range(20)])
- mid = "".join([r.choice("1lIi") + r.choice("zZ2") for i in range(60)])
- hidden_contents += start + mid + "\n"
+ x = "".join([r.choice(["po", "p0", "no", "ko", "fo", "qo"]) for i in range(20)])
+ x += "".join([r.choice("uiasdfghjkyxcvbnm1234567890ASDFGHJKYZXCVBNM") for i in range(60)])
+ x += r.choice(["lz", "1z", "Iz", "iz", "l2", "I2", "12"])
+ hidden_contents += x + "\n"
# create hidden file
dir_list = ['Qlipper', 'Thunar', 'blender', 'autostart', 'kazam', 'mc', 'netsurf', 'pulse', 'qupzilla', 'radare2', 'teamviewer', 'texstudio', 'vlc']
ending_list = ['rc', '.conf', '', '.txt']