summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/copy_rename_20_files_tail_env
diff options
context:
space:
mode:
authorgasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2015-02-04 10:08:02 +0000
committergasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2015-02-04 10:08:02 +0000
commitb5c1a3bd1ff20a8153f1525f373bd0773372547b (patch)
treedc1c15782fa7d30eff8efd7fa87b7c38ea2c7b98 /kpov_judge/tasks/copy_rename_20_files_tail_env
parent640a93b4dc4ed5e8c6c296f41c9c7cf6fe0384ea (diff)
Continuing work on subtask 3 (grep)
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@267 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks/copy_rename_20_files_tail_env')
-rw-r--r--kpov_judge/tasks/copy_rename_20_files_tail_env/task.py34
1 files changed, 21 insertions, 13 deletions
diff --git a/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py
index 64b2a01..25243c5 100644
--- a/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py
+++ b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py
@@ -122,17 +122,14 @@ def task(IP_malishell, file_rename_dirname, mv_src_dir, mv_dst_dir, cowsay_strin
#
conn.sendline('cd /home/student/grep_test_dir')
conn.prompt()
- conn.sendline('grep "mama" * > /dev/null 2>&1')
- conn.prompt()
- results['grep_err'] = conn.before
- conn.sendline('grep "mama" * 2> /dev/null')
- conn.prompt()
- results['grep_stdout'] = conn.before
conn.sendline('. ~/mama_ukaz')
conn.prompt()
- conn.sendline('cat ~/mama.txt ~/napake.txt')
+ conn.sendline('cat ~/napake.txt')
+ conn.prompt()
+ results['grep_napake'] = conn.before
+ conn.sendline('cat ~/mama.txt')
conn.prompt()
- results['grep_result'] = conn.before
+ results['grep_mama'] = conn.before
# sledenje syslog
conn.sendline('date')
conn.prompt()
@@ -226,21 +223,32 @@ def task_check(results, params):
score += 2
# mama_ukaz
#
+ task3_ok = True
mama_fnames = []
for i in xrange(20):
- fnames.append("".join([ r.choice("123456789abcdefghijk") for j in xrange(8)]))
+ mama_fnames.append("".join([ r.choice("123456789abcdefghijk") for j in xrange(8)]))
papa_fnames = []
for i in xrange(20):
- fnames.append("".join([ r.choice("123456789abcdefghijk") for j in xrange(8)]))
+ papa_fnames.append("".join([ r.choice("123456789abcdefghijk") for j in xrange(8)]))
dirnames = []
for i in xrange(20):
dirnames.append("".join([ r.choice("123456789abcdefghijk") for j in xrange(8)]))
linknames = []
for i in xrange(20):
linknames.append("".join([ r.choice("123456789abcdefghijk") for j in xrange(8)]))
- print( results['grep_err'])
- print( results['grep_stdout'])
- print( results['grep_result'])
+ print( results['grep_mama'])
+ print( results['grep_napake'])
+ for i in dirnames + linknames:
+ if results['grep_napake'].find(i) < 0:
+ task3_ok = False
+ if results['grep_mama'].find(i) >= 0:
+ task3_ok = False
+ for i in papa_fnames:
+ if results['grep_napake'].find(i) < 0:
+ task3_ok = False
+ if results['grep_mama'].find(i) >= 0:
+ task3_ok = False
+
# sledenje syslog
print( results['syslog_start_time'])
print( results['syslog_result'])