From dce4f4a70c6c2e2b585c6e4d3efe5dd5fa2796ec Mon Sep 17 00:00:00 2001 From: "gasperfele@fri1.uni-lj.si" Date: Fri, 6 Feb 2015 11:24:17 +0000 Subject: Finished grep test for task 4; moving on with other tasks. git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@268 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414 --- kpov_judge/tasks/copy_rename_20_files_tail_env/task.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'kpov_judge/tasks/copy_rename_20_files_tail_env') 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 25243c5..0b4bcff 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 @@ -238,17 +238,21 @@ def task_check(results, params): linknames.append("".join([ r.choice("123456789abcdefghijk") for j in xrange(8)])) print( results['grep_mama']) print( results['grep_napake']) - for i in dirnames + linknames: - if results['grep_napake'].find(i) < 0: + for i in dirnames + linknames + papa_fnames: + if (i not in papa_fnames) and 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: + if results['grep_napake'].find(i) >= 0: task3_ok = False if results['grep_mama'].find(i) >= 0: task3_ok = False - + for i in mama_fnames: + if results['grep_mama'].find(i) < 0: + task3_ok = False + if task3_ok: + score += 2 # sledenje syslog print( results['syslog_start_time']) print( results['syslog_result']) @@ -280,7 +284,7 @@ def prepare_disks(templates, params): d.touch(fname) d.chown("student", "student", fname) d.mkdir(params['mv_dst_dir']) - d.chown(params['mv_dst_dir']) + d.chown("student", 'student', params['mv_dst_dir']) # grep mama # mama fnames d.mkdir('/home/student/grep_test_dir') -- cgit v1.2.1