From 71cecca5bfb2e05fe7f195f7c0b23c8242fcdd3e Mon Sep 17 00:00:00 2001 From: "gasperfele@fri1.uni-lj.si" Date: Mon, 24 Nov 2014 15:48:08 +0000 Subject: Fixed references to kpov_random_helpers git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@10 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414 --- kpov_judge/tasks/copy_rename_100_files/task.py | 6 +++--- kpov_judge/tasks/copy_rename_20_files_tail_env/task.py | 6 +++--- kpov_judge/tasks/custom_rdate/task.py | 6 +++--- kpov_judge/tasks/dhcp_dns_predefined_ip/task.py | 6 +++--- kpov_judge/tasks/isc_dhcp_live_boot/task.py | 8 ++++---- kpov_judge/tasks/ldap_import/task.py | 6 +++--- kpov_judge/tasks/ldap_search/task.py | 6 +++--- kpov_judge/tasks/nat_port_forward/task.py | 6 +++--- kpov_judge/tasks/nat_vlc/task.py | 6 +++--- kpov_judge/tasks/network_boot_custom_program/task.py | 6 +++--- kpov_judge/tasks/openvpn_multiple_hops/task.py | 6 +++--- kpov_judge/tasks/openvpn_simple_smb/task.py | 6 +++--- kpov_judge/tasks/openwrt/task.py | 6 +++--- kpov_judge/tasks/public_ip_ssh/task.py | 4 ++-- kpov_judge/tasks/public_ssh_motd_http/task.py | 6 +++--- kpov_judge/tasks/radius_multiple_realms/task.py | 6 +++--- kpov_judge/tasks/radius_mysql_pam/task.py | 2 +- kpov_judge/tasks/rdate_64bit/task.py | 6 +++--- kpov_judge/tasks/set_ip_dhcp_hostname/task.py | 8 ++++---- kpov_judge/tasks/set_ip_static_dhcp/task.py | 6 +++--- kpov_judge/tasks/set_motd/task.py | 4 ++-- kpov_judge/tasks/smb_nfs/task.py | 6 +++--- kpov_judge/tasks/snmp_agent_uptime/task.py | 2 +- kpov_judge/tasks/snmp_alarms_interfaces/task.py | 6 +++--- kpov_judge/tasks/vlc_stream_rtp/task.py | 6 +++--- kpov_judge/test_task.py | 1 + 26 files changed, 72 insertions(+), 71 deletions(-) (limited to 'kpov_judge') diff --git a/kpov_judge/tasks/copy_rename_100_files/task.py b/kpov_judge/tasks/copy_rename_100_files/task.py index 614afd5..39fec0a 100644 --- a/kpov_judge/tasks/copy_rename_100_files/task.py +++ b/kpov_judge/tasks/copy_rename_100_files/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py instructions = { 'si':u""" @@ -94,9 +94,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py index 309a902..6b60a3e 100644 --- a/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py +++ b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # TODO: finish this! -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py instructions = { 'si':u""" @@ -80,9 +80,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/custom_rdate/task.py b/kpov_judge/tasks/custom_rdate/task.py index ea2c098..7fd7e86 100644 --- a/kpov_judge/tasks/custom_rdate/task.py +++ b/kpov_judge/tasks/custom_rdate/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py # TODO: finish this! instructions = { @@ -81,9 +81,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/dhcp_dns_predefined_ip/task.py b/kpov_judge/tasks/dhcp_dns_predefined_ip/task.py index 9f6c591..d251ebd 100644 --- a/kpov_judge/tasks/dhcp_dns_predefined_ip/task.py +++ b/kpov_judge/tasks/dhcp_dns_predefined_ip/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py instructions = { 'si':u""" @@ -92,9 +92,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/isc_dhcp_live_boot/task.py b/kpov_judge/tasks/isc_dhcp_live_boot/task.py index 0a6c33c..5bbdf4f 100644 --- a/kpov_judge/tasks/isc_dhcp_live_boot/task.py +++ b/kpov_judge/tasks/isc_dhcp_live_boot/task.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # TODO: dokoncaj! -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py instructions = { 'si':u""" @@ -86,9 +86,9 @@ def task(IP_DHCP, IP_GW, MAC_BOOT, BOOT_FNAME): def gen_params(user_id, params_meta): params = dict() r = random.Random(user_id) - net = kpovRandomHelpers.IPv4_subnet_gen(r, '10.75.0.0/10', 24) - params['IP_DHCP'], params['IP_GW'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) - params['BOOT_FNAME'] = kpovRandomHelpers.filename_gen(r) + net = kpov_random_helpers.IPv4_subnet_gen(r, '10.75.0.0/10', 24) + params['IP_DHCP'], params['IP_GW'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) + params['BOOT_FNAME'] = kpov_random_helpers.filename_gen(r) # IP_NM, DNS_NM, IP_static, DNS_static) return params diff --git a/kpov_judge/tasks/ldap_import/task.py b/kpov_judge/tasks/ldap_import/task.py index e03387a..b86e878 100644 --- a/kpov_judge/tasks/ldap_import/task.py +++ b/kpov_judge/tasks/ldap_import/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py instructions = { 'si':u""" @@ -97,9 +97,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/ldap_search/task.py b/kpov_judge/tasks/ldap_search/task.py index 7a27591..8bfd744 100644 --- a/kpov_judge/tasks/ldap_search/task.py +++ b/kpov_judge/tasks/ldap_search/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py # Poveži se na strežnik LDAP prek spletnega vmesnika. Ustvari uporabnika z danim imenom in geslom. # Napiši skripto, ki izpiše podatke o tem uporabniku z ldapsearch. # @@ -85,9 +85,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/nat_port_forward/task.py b/kpov_judge/tasks/nat_port_forward/task.py index 97182bc..a860842 100644 --- a/kpov_judge/tasks/nat_port_forward/task.py +++ b/kpov_judge/tasks/nat_port_forward/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py instructions = { 'si':u""" @@ -96,9 +96,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/nat_vlc/task.py b/kpov_judge/tasks/nat_vlc/task.py index 144d86d..4e40c26 100644 --- a/kpov_judge/tasks/nat_vlc/task.py +++ b/kpov_judge/tasks/nat_vlc/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py # Poglej nek film na nekem določenem URL. # (?md5 vsota filma?) @@ -99,9 +99,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/network_boot_custom_program/task.py b/kpov_judge/tasks/network_boot_custom_program/task.py index 3af7a7b..843b15a 100644 --- a/kpov_judge/tasks/network_boot_custom_program/task.py +++ b/kpov_judge/tasks/network_boot_custom_program/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py instructions = { 'si':u""" @@ -95,9 +95,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/openvpn_multiple_hops/task.py b/kpov_judge/tasks/openvpn_multiple_hops/task.py index 850abd3..7ef835b 100644 --- a/kpov_judge/tasks/openvpn_multiple_hops/task.py +++ b/kpov_judge/tasks/openvpn_multiple_hops/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py instructions = { 'si':u""" @@ -96,9 +96,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/openvpn_simple_smb/task.py b/kpov_judge/tasks/openvpn_simple_smb/task.py index eb65d06..2214545 100644 --- a/kpov_judge/tasks/openvpn_simple_smb/task.py +++ b/kpov_judge/tasks/openvpn_simple_smb/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py instructions = { 'si':u""" @@ -95,9 +95,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/openwrt/task.py b/kpov_judge/tasks/openwrt/task.py index af46573..a4c5836 100644 --- a/kpov_judge/tasks/openwrt/task.py +++ b/kpov_judge/tasks/openwrt/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py instructions = { 'si':u""" @@ -94,9 +94,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/public_ip_ssh/task.py b/kpov_judge/tasks/public_ip_ssh/task.py index dbb832f..e308184 100644 --- a/kpov_judge/tasks/public_ip_ssh/task.py +++ b/kpov_judge/tasks/public_ip_ssh/task.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # bson.son.SON an -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py OrderedDict = SON instructions = { @@ -31,7 +31,7 @@ def task(peer_ip, peer_user, peer_passwd): return dict() def gen_params(user_id, params_meta): - return kpovRandomHelpers.default_gen(user_id, params_meta) + return kpov_random_helpers.default_gen(user_id, params_meta) def task_check(results, params): import pxssh diff --git a/kpov_judge/tasks/public_ssh_motd_http/task.py b/kpov_judge/tasks/public_ssh_motd_http/task.py index 8966770..9ad60ee 100644 --- a/kpov_judge/tasks/public_ssh_motd_http/task.py +++ b/kpov_judge/tasks/public_ssh_motd_http/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py instructions = { 'si':u""" @@ -94,9 +94,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/radius_multiple_realms/task.py b/kpov_judge/tasks/radius_multiple_realms/task.py index c48ad02..f4e2d11 100644 --- a/kpov_judge/tasks/radius_multiple_realms/task.py +++ b/kpov_judge/tasks/radius_multiple_realms/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py instructions = { 'si':u""" @@ -100,9 +100,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/radius_mysql_pam/task.py b/kpov_judge/tasks/radius_mysql_pam/task.py index f331fd5..ba8b0d6 100644 --- a/kpov_judge/tasks/radius_mysql_pam/task.py +++ b/kpov_judge/tasks/radius_mysql_pam/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py instructions = { 'si':u""" diff --git a/kpov_judge/tasks/rdate_64bit/task.py b/kpov_judge/tasks/rdate_64bit/task.py index c518d47..9e6af21 100644 --- a/kpov_judge/tasks/rdate_64bit/task.py +++ b/kpov_judge/tasks/rdate_64bit/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py instructions = { 'si':u""" @@ -95,9 +95,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/set_ip_dhcp_hostname/task.py b/kpov_judge/tasks/set_ip_dhcp_hostname/task.py index db7ca35..16c689e 100644 --- a/kpov_judge/tasks/set_ip_dhcp_hostname/task.py +++ b/kpov_judge/tasks/set_ip_dhcp_hostname/task.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # TODO: finish thi -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py instructions = { 'si':u""" @@ -84,9 +84,9 @@ def task(IP_DHCP, Hostname_DHCP, IP_static, MAC_static, IP_dhcp_static): 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) + net = kpov_random_helpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + params['IP_DHCP'], params['IP_static'], params['IP_dhcp_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 3) + params['Hostname_DHCP'] = kpov_random_helpers.hostname_gen(r) return params def task_check(results, params): diff --git a/kpov_judge/tasks/set_ip_static_dhcp/task.py b/kpov_judge/tasks/set_ip_static_dhcp/task.py index 50d6fa1..9e67623 100644 --- a/kpov_judge/tasks/set_ip_static_dhcp/task.py +++ b/kpov_judge/tasks/set_ip_static_dhcp/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py instructions = { 'si':u""" @@ -96,9 +96,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/set_motd/task.py b/kpov_judge/tasks/set_motd/task.py index f329773..696407c 100644 --- a/kpov_judge/tasks/set_motd/task.py +++ b/kpov_judge/tasks/set_motd/task.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # bson.son.SON an -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py # OrderedDict = SON @@ -69,7 +69,7 @@ def task(peer_ip, peer_user, peer_passwd, niz): return results def gen_params(user_id, params_meta): - return kpovRandomHelpers.default_gen(user_id, params_meta) + return kpov_random_helpers.default_gen(user_id, params_meta) def task_check(results, params): niz = params['niz'] diff --git a/kpov_judge/tasks/smb_nfs/task.py b/kpov_judge/tasks/smb_nfs/task.py index b8aa836..f0f7838 100644 --- a/kpov_judge/tasks/smb_nfs/task.py +++ b/kpov_judge/tasks/smb_nfs/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py # TODO: dokoncaj! instructions = { 'si':u""" @@ -64,9 +64,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/snmp_agent_uptime/task.py b/kpov_judge/tasks/snmp_agent_uptime/task.py index b1bf54c..2e4be28 100644 --- a/kpov_judge/tasks/snmp_agent_uptime/task.py +++ b/kpov_judge/tasks/snmp_agent_uptime/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py # TODO: finish this. instructions = { diff --git a/kpov_judge/tasks/snmp_alarms_interfaces/task.py b/kpov_judge/tasks/snmp_alarms_interfaces/task.py index 4e19ef4..bac26a7 100644 --- a/kpov_judge/tasks/snmp_alarms_interfaces/task.py +++ b/kpov_judge/tasks/snmp_alarms_interfaces/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py instructions = { 'si':u""" @@ -98,9 +98,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/tasks/vlc_stream_rtp/task.py b/kpov_judge/tasks/vlc_stream_rtp/task.py index cb9243c..5372e18 100644 --- a/kpov_judge/tasks/vlc_stream_rtp/task.py +++ b/kpov_judge/tasks/vlc_stream_rtp/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpovRandomHelpers should be imported by add_assignment.py +# kpov_random_helpers should be imported by add_assignment.py # Postavi nek film na Internet tako, da ga bodo lahko ostali videli. # TODO: finish this @@ -96,9 +96,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) 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 = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + 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'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params diff --git a/kpov_judge/test_task.py b/kpov_judge/test_task.py index c35aabd..c6f6014 100755 --- a/kpov_judge/test_task.py +++ b/kpov_judge/test_task.py @@ -185,6 +185,7 @@ if __name__ == '__main__': if basic_args.help: # params_argparser.print_help() print params_argparser.format_help() + exit(0) # run task.task() public_params = dict() for k in inspect.getargs(task.func_code)[0]: -- cgit v1.2.1