diff options
Diffstat (limited to 'kpov_judge/tasks/openvpn_simple_smb')
-rw-r--r-- | kpov_judge/tasks/openvpn_simple_smb/task.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/kpov_judge/tasks/openvpn_simple_smb/task.py b/kpov_judge/tasks/openvpn_simple_smb/task.py index e1bb9b0..efec2e3 100644 --- a/kpov_judge/tasks/openvpn_simple_smb/task.py +++ b/kpov_judge/tasks/openvpn_simple_smb/task.py @@ -10,17 +10,16 @@ VPNClient1 in VPNClient2, ki jima nastavite pravilne mrežne nastavitve (medsebo Na vse racunalnike namestite OpenVPN in program za nadzor nad virtualnimi napravami (s katerim kreirate napravo tap). Strežnik SimpleArbiterVPN naj generira skupno skrivnost (*.key), katero shranite v imenik /vpn in jo na VPNCLient uporabite skupaj z konfiguracijsko datoteko za OpenVPN povezavo. Nato poskrbite, da bo VPNClient na navideznem omrežju prek NFS omogočil -dostop do imenika /home/test/IME_IMENIKA, pri čemer IME_IMENIKA preberite na SimpleArbiter. +dostop do imenika /home/test/DIRNAME, pri čemer DIRNAME preberite na SimpleArbiter. V ta imenik skopirajte datoteke, ki so prek SMB dostopne na SimpleArbiter. -""" - +""", 'en':u""" Setup three virtual machines - SimpleArbiterVPN and two VPN clients (VPNClient1, VPNClient2). Set both clients network cards so that they will have access to internal network and internet. Install OpenVPN to all three machines and a program for supervising virtual devices (which you will use to create device tap). Server SimpleArbiterVPN should generate a common secret (*.key), which you should save to /vpn directory and use on VPNClient together with configuration file for OpenVPN connection. After that make sure that -VPNClient has enabled access to /home/test/IME_IMENIKA over NFS on it's virtual connection. You will get +VPNClient has enabled access to /home/test/DIRNAME over NFS on it's virtual connection. You will get IME_IMENIKA from SimpleArbiter. Copy files that should be available from AimpleArbiter over SMB to IME_IMENIKA. """ } @@ -63,7 +62,7 @@ computers = { { 'network': 'net1' } - }, + ], 'flavor': 'm1.tiny', 'config_drive': False @@ -81,7 +80,7 @@ computers = { { 'network': 'net1' } - }, + ], 'flavor': 'm1.tiny', 'config_drive': False @@ -99,11 +98,14 @@ networks = { } #Tukaj sem generiral tri parametre, prosil bi če se upoštevajo pri Tasku. params_meta = { - 'IME_IMENIKA': {}, 'IME_KLJUCA':{}, 'HASH': {} + 'IP_SimpleArbiterVPN': {'descriptions':{'si':'IP za SimpleArbiter'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True}, + 'IP_VPNClient1': {'descriptions':{'si':'IP za 1. klienta'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True}, + 'IP_VPNClient2': {'descriptions':{'si':'IP za 2. klienta'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True}, + 'DIRNAME': {'descriptions':{'si':'Imenik, dostopen prek NFS'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True}, } -def task(IP_SimpleArbiterVPN, DNS_SimpleArbiterVPN, IP_VPNClient1, DNS_VPNClient1, IP_VPNClient2, DNS_VPNClient2): +def task(IP_SimpleArbiterVPN, IP_VPNClient1, IP_VPNClient2, DIRNAME): 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 @@ -227,7 +229,7 @@ def task(IP_SimpleArbiterVPN, DNS_SimpleArbiterVPN, IP_VPNClient1, DNS_VPNClient ###### # Ping the VPN server - sC1.sendLine('ping -c 3 {0}'.format( DNS_SimpleArbiterVPN )) + sC1.sendLine('ping -c 3 {0}'.format( IP_SimpleArbiterVPN )) sC1.prompt() output = sC1.before results['VPNClient1_ping_VPN_server'] = output @@ -238,7 +240,7 @@ def task(IP_SimpleArbiterVPN, DNS_SimpleArbiterVPN, IP_VPNClient1, DNS_VPNClient ###### # Ping the VPN server - sC2.sendLine('ping -c 3 {0}'.format( DNS_SimpleArbiterVPN )) + sC2.sendLine('ping -c 3 {0}'.format( IP_SimpleArbiterVPN )) sC2.prompt() output = sC2.before results['VPNClient2_ping_VPN_server'] = output @@ -263,7 +265,7 @@ def gen_params(user_id, params_meta): alpha=["1","2","3","4","5","6","7","8","9","0"] rnd = random.Random(alpha) for x in id: - hash+=chr(int(x)+80)+rnd + hash+=chr(int(x)+80)+rnd params['HASH']=hash return params |