diff options
author | jz8469@student.uni-lj.si <jz8469@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2015-01-27 22:43:05 +0000 |
---|---|---|
committer | jz8469@student.uni-lj.si <jz8469@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2015-01-27 22:43:05 +0000 |
commit | 1f892308faad1ef57c789f26410c415c35977f5d (patch) | |
tree | 8c1ec60b2cb800f483162bd17630543d97556534 /kpov_judge/tasks/nat_vlc | |
parent | 944bcefbbdcbbc22a9aadf1a1d2eb74bd3d572da (diff) |
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
Diffstat (limited to 'kpov_judge/tasks/nat_vlc')
-rw-r--r-- | kpov_judge/tasks/nat_vlc/task.py | 20 |
1 files changed, 11 insertions, 9 deletions
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): |