summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/openvpn_simple_smb
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge/tasks/openvpn_simple_smb')
-rw-r--r--kpov_judge/tasks/openvpn_simple_smb/task.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/kpov_judge/tasks/openvpn_simple_smb/task.py b/kpov_judge/tasks/openvpn_simple_smb/task.py
index c807f90..4243454 100644
--- a/kpov_judge/tasks/openvpn_simple_smb/task.py
+++ b/kpov_judge/tasks/openvpn_simple_smb/task.py
@@ -101,7 +101,7 @@ params_meta = {
def task(IP_SimpleArbiterVPN, IP_VPNClient1, IP_LANClient1, DIRNAME):
- import pxssh # Used to set up an SSH connection to a remote machine
+ from pexpect import pxssh # Used to set up an SSH connection to a remote machine
import pexpect # Allows the script to spawn a child application and control it as if a human were typing commands
@@ -275,14 +275,14 @@ def task_check(results, params):
return score, hints
-def prepare_disks(templates, params):
+def prepare_disks(templates, task_params, global_params):
#d = templates['simpleArbiterDhcp']
#guestmount -a d -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt
#asistent je pocasnela :)
import random
- r = random.Random(params['secret_random_seed'])
+ r = random.Random(task_params['secret_random_seed'])
s = "\n".join([
"".join([r.choice("0123456789abcdef") for i in xrange(16)])
for i in xrange(16)])
@@ -298,13 +298,14 @@ iface tap0 inet static
pre-up tunctl -t tap0
address {}
netmask 255.255.255.0
-""".format(params['IP_SimpleArbiterVPN'])
+""".format(task_params['IP_SimpleArbiterVPN'])
templates['simpleArbiterDhcpGWVPN'].write_append("/etc/network/interfaces", netaddr_s)
for i in xrange(3):
fname = kpov_random_helpers.fname_gen(r, False)
templates['simpleArbiterDhcpGWVPN'].write(
"/srv/smb/" + fname + '.txt',
kpov_random_helpers.fortune(r, 4096))
+ write_default_config(templates['simpleArbiterDhcpGWVPN'], global_params)
templates['student-VPNClient1'].write("/home/student/" + keyfile, s)
# uid, gid (student = )
templates['student-VPNClient1'].chown(1000, 1000, "/home/student/" + keyfile)