summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/set_ip_static_dhcp
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge/tasks/set_ip_static_dhcp')
-rw-r--r--kpov_judge/tasks/set_ip_static_dhcp/evaluation/task.py100
-rw-r--r--kpov_judge/tasks/set_ip_static_dhcp/lecture/ideja.txt2
-rw-r--r--kpov_judge/tasks/set_ip_static_dhcp/task.py8
3 files changed, 4 insertions, 106 deletions
diff --git a/kpov_judge/tasks/set_ip_static_dhcp/evaluation/task.py b/kpov_judge/tasks/set_ip_static_dhcp/evaluation/task.py
deleted file mode 100644
index 0fad134..0000000
--- a/kpov_judge/tasks/set_ip_static_dhcp/evaluation/task.py
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-# TODO: finish thi
-# kpovRandomHelpers should be imported by add_assignment.py
-
-instructions = {
- 'si':u"""
-Ustvari tri navidezne računalnike. Za disk prvega uporabi sliko diska simpleArbiterDhcp.
-Za enega od ostalih dveh (Z_DHCP) poskrbi, da bo dobil IP prek DHCP, pri čemer
-naj kot hostname strežniku pošlje ime, ki ga dobiš na simpleArbiterDhcp.
-Za drugega poskrbi, da bo imel statično nastavljen IP.
-"""
-}
-
-computers = {
- 'Z_DHCP': {
- 'disks': [
- { 'name': 'Z_DHCP',
- },
- #{ 'name': 'CDROM',
- # 'options':{'readonly': True},
- # 'parts': [],# no parts, no mounting.
- #}
- ],
- 'network_interfaces': [{'network': 'net1'}],
- 'flavor': 'm1.tiny',
- 'config_drive': False
-
- },
- 'BREZ_DHCP': {
- 'disks': [
- { 'name': 'BREZ_DHCP',
- },
- #{ 'name': 'CDROM',
- # 'options':{'readonly': True},
- # 'parts': [],# no parts, no mounting.
- #}
- ],
- 'network_interfaces': [{'network': 'net1'}],
- 'flavor': 'm1.tiny',
- 'config_drive': False
-
- },
- 'SimpleArbiter': {
- 'disks': [
- { 'name': 'simpleArbiterDhcp',
- # attempt automount
- },
- #{ 'name': 'CDROM',
- # 'options': {'readonly': True},
- # 'parts': [{'dev': 'b1', 'path': '/cdrom'}],
- #},
- ],
- 'network_interfaces': [{'network': 'net1'}, {'network': 'test-net'}],
- 'flavor': 'm1.tiny',
- 'config_drive': False
- }
-}
-
-networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
-
-params_meta = {
- 'IP_DHCP': {'opis': 'Naslov za DHCP', 'w': False, 'public': False, 'type': 'IP', 'generated': True},
- 'Hostname_DHCP': {'opis': 'Ime DHCP', 'w': False, 'public': True, 'type': 'hostname', 'generated': True},
- 'IP_static': {'opis': 'Naslov BREZ_DHCP', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'IP_dhcp_static': {'opis': 'Dodeljen IP brez DHCP', 'w': False, 'public': False, 'type': 'IP', 'generated': True},
-}
-
-def task(IP_DHCP, Hostname_DHCP, IP_static, MAC_static, IP_dhcp_static):
- import pxssh
- import pexpect
- results = dict()
- # check hostname of DHCP
- # check the hostname in the response of IP_DHCP
- # check availability of IP_static
- # check non-availability of IP_dhcp_static
- return results
-
-def gen_params(user_id, params_meta):
- r = random.Random(user_id)
- # IP_NM, DNS_NM, IP_static, DNS_static)
- net = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24)
- params['IP_DHCP'], params['IP_static'], params['IP_dhcp_static'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 3)
- params['Hostname_DHCP'] = kpovRandomHelpers.hostname_gen(r)
- return params
-
-def task_check(results, params):
- import re
- score = -9
- if results['bla']:
- score += 3
- return score
-
-def prepare_disks(templates, params):
-# d = templates['simpleArbiterDhcp']
-# create config for static_DHCP
-# set static_DHCP hostname
- pass
-
diff --git a/kpov_judge/tasks/set_ip_static_dhcp/lecture/ideja.txt b/kpov_judge/tasks/set_ip_static_dhcp/lecture/ideja.txt
deleted file mode 100644
index 92d984c..0000000
--- a/kpov_judge/tasks/set_ip_static_dhcp/lecture/ideja.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Mrežne nastavitve pod Linuxom. Ukazi za delo z mrežo. tcpdump. NetworkManager.
-dbus.
diff --git a/kpov_judge/tasks/set_ip_static_dhcp/task.py b/kpov_judge/tasks/set_ip_static_dhcp/task.py
index 1d79a61..50d6fa1 100644
--- a/kpov_judge/tasks/set_ip_static_dhcp/task.py
+++ b/kpov_judge/tasks/set_ip_static_dhcp/task.py
@@ -63,10 +63,10 @@ computers = {
networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
params_meta = {
- 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True},
+ 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ 'DNS_NM': {'descriptions': {'si': 'DNS za maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
+ '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},
}
def task(IP_NM, DNS_NM, IP_static, DNS_static):