diff options
author | mp7462@student.uni-lj.si <mp7462@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-12-15 19:07:39 +0000 |
---|---|---|
committer | mp7462@student.uni-lj.si <mp7462@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-12-15 19:07:39 +0000 |
commit | 48b10bed216de5fac542832e7874a24e6b5e2541 (patch) | |
tree | 717397adbf83ae76296c90d70d5814e1438a5c65 /kpov_judge/tasks | |
parent | 7e7d9c1e05be07301597d3144f1e817524f2b50b (diff) |
Finished computers, networks, params_meta
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@78 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks')
-rw-r--r-- | kpov_judge/tasks/openvpn_simple_smb/task.py | 112 |
1 files changed, 81 insertions, 31 deletions
diff --git a/kpov_judge/tasks/openvpn_simple_smb/task.py b/kpov_judge/tasks/openvpn_simple_smb/task.py index 6257d67..486ddef 100644 --- a/kpov_judge/tasks/openvpn_simple_smb/task.py +++ b/kpov_judge/tasks/openvpn_simple_smb/task.py @@ -16,96 +16,130 @@ V ta imenik skopirajte datoteke, ki so prek SMB dostopne na SimpleArbiter. } computers = { - 'maliNetworkManager': { + 'SimpleArbiter': { 'disks': [ - { 'name': 'maliNetworkManager', + { 'name': 'SimpleArbiterVPN', + # attempt automount }, #{ 'name': 'CDROM', - # 'options':{'readonly': True}, - # 'parts': [],# no parts, no mounting. - #} + # 'options': {'readonly': True}, + # 'parts': [{'dev': 'b1', 'path': '/cdrom'}], + #}, + ], + 'network_interfaces': [ + { + 'network': 'test-net' + }, + { + 'network': 'net1' + } ], - 'network_interfaces': [{'network': 'net1'}], 'flavor': 'm1.tiny', 'config_drive': False - }, - 'maliBrezNetworkManager': { + 'VPNClient1': { 'disks': [ - { 'name': 'maliBrezNetworkManager', + { 'name': 'VPNClient1', }, #{ 'name': 'CDROM', # 'options':{'readonly': True}, # 'parts': [],# no parts, no mounting. #} ], - 'network_interfaces': [{'network': 'net1'}], + 'network_interfaces': [ + { + 'network': 'net1' + } + }, 'flavor': 'm1.tiny', 'config_drive': False }, - 'SimpleArbiter': { + 'VPNClient2': { 'disks': [ - { 'name': 'simpleArbiterDhcp', - # attempt automount + { 'name': 'VPNClient2', }, #{ 'name': 'CDROM', - # 'options': {'readonly': True}, - # 'parts': [{'dev': 'b1', 'path': '/cdrom'}], - #}, + # 'options':{'readonly': True}, + # 'parts': [],# no parts, no mounting. + #} ], - 'network_interfaces': [{'network': 'net1'}, {'network': 'test-net'}], + 'network_interfaces': [ + { + 'network': 'net1' + } + }, 'flavor': 'm1.tiny', 'config_drive': False + } } networks = { - 'net1': { - 'public': False - }, 'test-net': { 'public': True + }, + # Used for the VPN tunnel + 'net1': { + 'public': False } } params_meta = { - 'IP_NM': { + 'IP_SimpleArbiterVPN': { 'descriptions': { - 'si': 'Naslov maliNetworkManager' + 'si': 'Naslov SimpleArbiter' }, 'w': False, 'public': True, 'type': 'IP', 'generated': True }, - 'DNS_NM': { + 'DNS_SimpleArbiterVPN': { 'descriptions': { - 'si': 'DNS za maliNetworkManager' + 'si': 'DNS za SimpleArbiter' }, 'w': False, 'public': True, 'type': 'IP', 'generated': True }, - 'IP_static': { + 'IP_VPNClient1': { 'descriptions': { - 'si': 'Naslov maliBrezNetworkManager' + 'si': 'Naslov VPNClient1' }, 'w': False, 'public': True, 'type': 'IP', 'generated': True }, - 'DNS_static': { + 'DNS_VPNClient1': { 'descriptions': { - 'si': 'DNS za maliBrezNetworkManager' + 'si': 'DNS za VPNClient1' }, 'w': False, 'public': True, 'type': 'IP', 'generated': True }, + 'IP_VPNClient2': { + 'descriptions': { + 'si': 'Naslov VPNClient2' + }, + 'w': False, + 'public': True, + 'type': 'IP', + 'generated': True + }, + 'DNS_VPNClient2': { + 'descriptions': { + 'si': 'DNS za VPNClient2' + }, + 'w': False, + 'public': True, + 'type': 'IP', + 'generated': True + } } @@ -130,14 +164,28 @@ def task(IP_NM, DNS_NM, IP_static, DNS_static): sA.login(IP_NM, peer_user, peer_passwd) sB.login(IP_static, peer_user, peer_passwd) + + ###### # sA - # make sure NM is not handling eth0 + ###### + + # TODO what is this exactly? + # Make sure NM is not handling eth0 results['NM_nmcli'] = sA.run('nmcli d') + + # Get the IP of the network as per a DNS server results['NM_nslookup'] = sA.run('nslookup www.arnes.si') + + + ###### # sB + ###### + # check whether NM is handling eth0 results['static_nmcli'] = sB.run('nmcli d') + + # Get the IP of the network as per a DNS server results['static_nslookup'] = sB.run('nslookup www.arnes.si') # Check if the tap exists @@ -155,8 +203,10 @@ def task(IP_NM, DNS_NM, IP_static, DNS_static): # TODO # Check if both clients are connected to the correct VPN (check if first 24 bits of IP addr are the same as the server's) - # TODO - # Ping each of the clients (10.8.0.6 and 10.8.0.10, these are default incrementing addresses handed by OpenVPN) + + # Pings each of the clients + # 10.8.0.6 and 10.8.0.10 are the first two default addresses distributed by OpenVPN + |