summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/isc_dhcp_live_boot
diff options
context:
space:
mode:
authorbk1910@student.uni-lj.si <bk1910@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2014-12-12 21:08:28 +0000
committerbk1910@student.uni-lj.si <bk1910@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2014-12-12 21:08:28 +0000
commitfd996822148fae4a9dd16aec4eb3c1717c72643f (patch)
tree2ab9563365e6ed8d8bb72f55d5ff680f37c37a24 /kpov_judge/tasks/isc_dhcp_live_boot
parentf9fd2baaaa811a1e796ed4f359fd53588c05933f (diff)
First example how task_check in isc_chcp_ilve_boot schould look like
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@63 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.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/kpov_judge/tasks/isc_dhcp_live_boot/task.py b/kpov_judge/tasks/isc_dhcp_live_boot/task.py
index b446450..3667f8c 100644
--- a/kpov_judge/tasks/isc_dhcp_live_boot/task.py
+++ b/kpov_judge/tasks/isc_dhcp_live_boot/task.py
@@ -136,16 +136,26 @@ def gen_params(user_id, params_meta):
def task_check(results, params):
import re
- score = -9
+ score = 0
+
+ #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
+
+ #TASK1: all computers up
if results['NM_nslookup'].find('Server:\t\t{0}\r'.format(params['DNS_NM'])) > -1:
score += 3
+ #TASK2: SimpleArbeiter IP_GW
if results['static_nslookup'].find('Server:\t\t{0}\r'.format(params['DNS_static'])) > -1:
score += 3
+ #TASK3: SimpleArbeiter IP_DHCP
if re.search(r'eth0 +802-.*connected', results['NM_nmcli']):
score += 2
- if not re.search(r'eth0 +802-.*connected', results['static_nmcli']):
+ #TASK4: SimpleArbaiter IP_B
+ if re.search(r'eth0 +802-.*connected', results['static_nmcli']):
score += 2
- score = 0
+ if results['NoNameATM'].find('NoFormatATM'.format(params['NoNameAtm]))> -1:
+ score +=2
+ #Same pattern for other tasks
return score
def prepare_disks(templates, params):