summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/nat_vlc
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge/tasks/nat_vlc')
-rw-r--r--kpov_judge/tasks/nat_vlc/task.py20
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):