diff options
Diffstat (limited to 'kpov_judge/tasks/dhcp_dns_predefined_ip')
-rw-r--r-- | kpov_judge/tasks/dhcp_dns_predefined_ip/task.py | 9 |
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 |