summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks
diff options
context:
space:
mode:
authorsr5154@student.uni-lj.si <sr5154@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2017-05-08 09:42:58 +0000
committersr5154@student.uni-lj.si <sr5154@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2017-05-08 09:42:58 +0000
commit1e62d7ad2da10196b52a6b703659501ff1b1d5bb (patch)
treebc60979cdfb9c7ff52106d08c3f86859b7229bb0 /kpov_judge/tasks
parent040be8ae5a1475182b782ac8da86d263b646da7e (diff)
Js res ne stekam navodil, ampak men se zdi, da so zdej bl pravilna
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@416 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks')
-rw-r--r--kpov_judge/tasks/dhcp_dns_predefined_ip/task.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/kpov_judge/tasks/dhcp_dns_predefined_ip/task.py b/kpov_judge/tasks/dhcp_dns_predefined_ip/task.py
index a7d6949..5c215fd 100644
--- a/kpov_judge/tasks/dhcp_dns_predefined_ip/task.py
+++ b/kpov_judge/tasks/dhcp_dns_predefined_ip/task.py
@@ -6,7 +6,7 @@
instructions = {
'si':u"""
Ustvari tri navidezne računalnike. Za enega (SimpleArbiter) uporabi sliko diska simpleArbiterGW. Na drugega (DHCP_server) postavi strežnika
-DHCP in DNS. Poskrbi, da bo preostali računalnik (DHCP_client) dobil naslov, ki ga prebereš na SimpleArbiterju.
+DHCP in DNS. Poskrbi, da bo preostali računalnik (DHCP_client) dobil naslov {Client_IP}.
Poskrbi, da bo DNS strežnik za domeno test.net vrnil naslov {HOSTNAME_X_IP}.
DHCP_server naj za DNS strežnik uporabi {DNS_NM}.
DHCP_client naj za DNS strežnik uporabi {DNS_static}.
@@ -66,9 +66,10 @@ params_meta = {
'IP_static': {'descriptions': {'si': 'Naslov maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
'DNS_static': {'descriptions': {'si': 'DNS za maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
'HOSTNAME_X_IP': {'descriptions': {'si': 'Naslov HOSTNAME_X'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'Client_IP': {'descriptions': {'si': 'Naslov za DHCP_Client'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
}
-def task(IP_NM, DNS_NM, IP_static, DNS_static, HOSTNAME_X_IP):
+def task(IP_NM, DNS_NM, IP_static, DNS_static, HOSTNAME_X_IP, Client_IP):
from pexpect import pxssh
import pexpect
results = dict()
@@ -91,7 +92,7 @@ def task(IP_NM, DNS_NM, IP_static, DNS_static, HOSTNAME_X_IP):
results['static_nmcli'] = sB.before
results['static_nslookup'] = sB.run('nslookup www.arnes.si')
# test the DNS server
- results['NM_dns_test'] = sA.run('nslookup test 127.0.0.1')
+ results['NM_dns_test'] = sA.run('nslookup test.net 127.0.0.1')
sA.logout()
sB.logout()
return results
@@ -103,7 +104,7 @@ def gen_params(user_id, params_meta):
dns_servers = ['193.2.1.66', '193.2.1.72', '8.8.8.8', '8.8.4.4', '208.67.222.222', '208.67.220.220']
net = kpov_random_helpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24)
params['DNS_NM'] = r.choice(dns_servers)
- params['IP_NM'], params['IP_static'], params['HOSTNAME_X_IP'] = kpov_random_helpers.IPv4_addr_gen(r, net, 3)
+ params['IP_NM'], params['IP_static'], params['HOSTNAME_X_IP'], params['Client_IP'] = kpov_random_helpers.IPv4_addr_gen(r, net, 4)
params['DNS_static'] = r.choice(dns_servers)
return params