From 535debbf696713e3776e679fc649777372e6b92d Mon Sep 17 00:00:00 2001 From: "mp7462@student.uni-lj.si" Date: Sat, 20 Dec 2014 10:28:32 +0000 Subject: Removed install nmap. git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@107 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414 --- kpov_judge/tasks/openvpn_simple_smb/task.py | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'kpov_judge') diff --git a/kpov_judge/tasks/openvpn_simple_smb/task.py b/kpov_judge/tasks/openvpn_simple_smb/task.py index 1de4ecc..d6cfae1 100644 --- a/kpov_judge/tasks/openvpn_simple_smb/task.py +++ b/kpov_judge/tasks/openvpn_simple_smb/task.py @@ -22,11 +22,12 @@ Server SimpleArbiterVPN should generate a common secret (*.key), which you shoul 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 IME_IMENIKA from SimpleArbiter. Copy files that should be available from AimpleArbiter over SMB to IME_IMENIKA. - """ } computers = { + # SimpleArbiter needs to have the package nmap installed + # http://linux.die.net/man/1/nmap 'SimpleArbiter': { 'disks': [ { 'name': 'SimpleArbiterVPN', @@ -231,33 +232,25 @@ def task(IP_SimpleArbiterVPN, DNS_SimpleArbiterVPN, IP_VPNClient1, DNS_VPNClient ### # Check if both clients are connected to the correct VPN # (check if first 24 bits of IP addr are the same as the IP of the VPN server) - # a.k.a. the YES WE CAN method of checking things - # really, really hoping it has root privileges too ### - ### Install nmap - # TODO: (polz) Don't install nmap here - tell me that you - # need nmap to be present on simpleArbiter and I'll install it. - # Check if root + # User must be root sA.sendline('id -u') sA.prompt() uid = sA.before.split('\n') uid = uid[1].rstrip() - #print uid - # If is isn't root + # If it isn't root if ( uid != "0" ): - print "SimpleArbiter user must be root to continue with this step (installing nmap mostly)" + print "SimpleArbiter user must be root to continue with this step" # If it is, we continue else: - ### Install the nmap package - # Check if nmap is already installed + # Check if nmap is installed sA.sendline('dpkg-query -W nmap') sA.prompt() lines = sA.before.split('\n') line = lines[1] # If it isn't if ( len(line.rstrip()) == 4 ): # returns "nmap\r\n" if package isn't installed - sA.sendline('apt-get install nmap --assume-yes') - # If it is + print "Computer SimpleArbiter must have nmap installed" else: sA.sendline('') #sA.wait() # For some reason this hangs @@ -275,7 +268,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( DNS_SimpleArbiterVPN )) sC1.prompt() output = sC1.before results['VPNClient1_ping_VPN_server'] = output @@ -286,7 +279,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( DNS_SimpleArbiterVPN )) sC2.prompt() output = sC2.before results['VPNClient2_ping_VPN_server'] = output -- cgit v1.2.1