diff options
author | gasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2015-04-01 20:32:28 +0000 |
---|---|---|
committer | gasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2015-04-01 20:32:28 +0000 |
commit | 53fea983a90447865c429c2573bfb36cba179054 (patch) | |
tree | 42a0fa57a43103378144607d16e575e82071f7e1 /kpov_judge/tasks/isc_dhcp_live_boot | |
parent | 2fe40ec78ce6ab3a8c2c5659713b7f947a5686fc (diff) |
added hints to task results
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@296 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks/isc_dhcp_live_boot')
-rw-r--r-- | kpov_judge/tasks/isc_dhcp_live_boot/task.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/kpov_judge/tasks/isc_dhcp_live_boot/task.py b/kpov_judge/tasks/isc_dhcp_live_boot/task.py index 78dd05c..0e86c11 100644 --- a/kpov_judge/tasks/isc_dhcp_live_boot/task.py +++ b/kpov_judge/tasks/isc_dhcp_live_boot/task.py @@ -163,26 +163,36 @@ def gen_params(user_id, params_meta): def task_check(results, params): import re score = 0 - + hints = [] #TO FINISH SCORING WE REQUIRE DICT KEYS AND FUNCTIONS gen_params AND task TO BE FINISHED #POINTS FOR EACH TASK MAY BE ADJUSTED IN THE FUTURE if results['dhcping_other'].find(params['IP_DHCP']) >= 0: score += 1 + else: + hints += ["DHCP wrong"] if results['dhcping_SA'].find(params['IP_DHCP']) >= 0: score += 1 + else: + hints += ["DHCP wrong"] p = re.search(r"FNAME:(.*)\r", results['dhcpdump_other_reply']) other_fname = p.group(1) if other_fname == params['BOOT_FNAME']: score += 3 + else: + hints += ["special fname wrong"] p = re.search(r"FNAME:(.*)\r", results['dhcpdump_SA_reply']) sa_fname = p.group(1) if sa_fname == params['BOOT_FNAME']: score += 3 + else: + hints += ["fname wrong"] if results['tftp_string'].split('\r\r\n')[-2] == "# " + params['TFTP_STRING']: score += 2 - return score + else: + hints += ["tftp wrong"] + return score, hints def prepare_disks(templates, params): # d = templates['simpleArbiterDhcp'] |