From 1f892308faad1ef57c789f26410c415c35977f5d Mon Sep 17 00:00:00 2001 From: "jz8469@student.uni-lj.si" Date: Tue, 27 Jan 2015 22:43:05 +0000 Subject: task_check je narejen git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@242 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414 --- kpov_judge/tasks/nat_vlc/task.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'kpov_judge/tasks/nat_vlc/task.py') diff --git a/kpov_judge/tasks/nat_vlc/task.py b/kpov_judge/tasks/nat_vlc/task.py index b0e9342..1d6728c 100644 --- a/kpov_judge/tasks/nat_vlc/task.py +++ b/kpov_judge/tasks/nat_vlc/task.py @@ -120,16 +120,18 @@ def gen_params(user_id, params_meta): def task_check(results, params): import re - score = -9 - if results['NM_nslookup'].find('Server:\t\t{0}\r'.format(params['DNS_NM'])) > -1: - score += 3 - if results['static_nslookup'].find('Server:\t\t{0}\r'.format(params['DNS_static'])) > -1: - score += 3 - if re.search(r'eth0 +802-.*connected', results['NM_nmcli']): - score += 2 - if not re.search(r'eth0 +802-.*connected', results['static_nmcli']): - score += 2 score = 0 + if re.search(r'0% packet loss',results['IP_simple ping to NAT']): + score += 2 + if results['IP_NAT ip forward']=='1': + score += 2 + if not re.search(r'Network is unreachable',results['IP_simple to internet']): + score += 2 + if re.search(r'94.140.66.250',results['IP_simple dns']): + score += 2 + gateway='0.0.0.0\t'+params['IP_NAT'] + if re.search(gateway,results['IP_simple routing table']): + score += 2 return score def prepare_disks(templates, params): -- cgit v1.2.1