diff options
author | Sander Vrijders <sander.vrijders@ugent.be> | 2017-10-25 18:35:42 +0200 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@ugent.be> | 2017-10-25 19:07:58 +0200 |
commit | 6503ca2369a5cc876f33bcbc41b10972602571ea (patch) | |
tree | 815635c0e5ce200f0a6737f6a7aff6076baba2d5 | |
parent | 624a7885319ea71e0e1eef760d490871748d2967 (diff) | |
download | rumba-6503ca2369a5cc876f33bcbc41b10972602571ea.tar.gz rumba-6503ca2369a5cc876f33bcbc41b10972602571ea.zip |
prototypes, testbeds, ssh_support: Add several fixes
This adds several fixes in order for rlite to function on the exogeni
testbed.
-rw-r--r-- | rumba/prototypes/irati.py | 17 | ||||
-rw-r--r-- | rumba/prototypes/rlite.py | 2 | ||||
-rw-r--r-- | rumba/ssh_support.py | 2 | ||||
-rw-r--r-- | rumba/testbeds/jfed.py | 37 |
4 files changed, 26 insertions, 32 deletions
diff --git a/rumba/prototypes/irati.py b/rumba/prototypes/irati.py index 53c8b16..757a66e 100644 --- a/rumba/prototypes/irati.py +++ b/rumba/prototypes/irati.py @@ -82,15 +82,14 @@ class Experiment(mod.Experiment): def install(self): """Installs IRATI on the nodes.""" cmds = [self.sudo("apt-get update"), - self.sudo("apt-get install g++ gcc " - "protobuf-compiler libprotobuf-dev git --yes " - "pkg-config " - "libnl-3-dev libnl-genl-3-dev"), - self.sudo("rm -rf ~/irati"), - "cd ~; git clone https://github.com/IRATI/stack irati", - "cd ~/irati && git checkout arcfire", - "cd ~/irati && " - + self.sudo("./install-from-scratch")] + self.sudo("apt-get install g++ gcc libtool " + "linux-headers-$(uname -r) autoconf automake " + "protobuf-compiler=2.6.1-1 libprotobuf-dev=2.6.1-1 " + "git pkg-config libssl-dev=1.0.1k-3 --yes"), + self.sudo("rm -rf ~/stack"), + "cd ~; git clone -b arcfire https://github.com/IRATI/stack", + "cd ~/stack && " + + self.sudo("./configure && ") + self.sudo("make install")] for node in self.nodes: ssh.execute_proxy_commands(self.testbed, node.ssh_config, diff --git a/rumba/prototypes/rlite.py b/rumba/prototypes/rlite.py index 3700640..6d28432 100644 --- a/rumba/prototypes/rlite.py +++ b/rumba/prototypes/rlite.py @@ -63,7 +63,7 @@ class Experiment(mod.Experiment): "modprobe rlite-shim-eth", "modprobe rlite-shim-udp4", "modprobe rlite-shim-loopback", - "rlite-uipcps -v DBG &> uipcp.log &"] + "rlite-uipcps -v DBG >uipcp.log 2>&1 &"] self.may_sudo(cmds) for node in self.nodes: diff --git a/rumba/ssh_support.py b/rumba/ssh_support.py index d9be604..9aa312e 100644 --- a/rumba/ssh_support.py +++ b/rumba/ssh_support.py @@ -88,11 +88,11 @@ def ssh_connect(hostname, port, username, password, time_out, proxy_server): logger.error('If you are sure this is not a man in the ' + 'middle attack, edit that file to remove the ' + 'entry and then hit return to try again.') + input() except (paramiko.ssh_exception.SSHException, EOFError): retry += 1 logger.error('Failed to connect to host, retrying: ' + str(retry) + '/' + str(max_retries) + ' retries') - input('Hit Enter when ready') if retry == max_retries: raise SSHException('Failed to connect to host') diff --git a/rumba/testbeds/jfed.py b/rumba/testbeds/jfed.py index c79b1aa..8973335 100644 --- a/rumba/testbeds/jfed.py +++ b/rumba/testbeds/jfed.py @@ -231,23 +231,19 @@ class Testbed(mod.Testbed): rspec = xml.parse(self.manifest) xml_nodes = rspec.getElementsByTagName("node") - # Complete details of the nodes after swapin - logger.info("Sleeping for two seconds to avoid contacting jfed nodes " - "too soon.") - time.sleep(2) for xml_node in xml_nodes: n_name = xml_node.getAttribute("client_id") intfs = xml_node.getElementsByTagName("interface") - got = False + node_n = None for node in experiment.nodes: if node.name == n_name: node_n = node - got = True - if not got: - logger.error("Not found node %s", n_name) + break + if node_n is None: + logger.error("Didn't find node %s", n_name) - hostname=None + hostname = None if "wall" in self.auth_name: hostname = node_n.name + "." + self.exp_name + "." + \ auth_name_r + "." + self.auth_name @@ -258,29 +254,28 @@ class Testbed(mod.Testbed): auth_name_r + "." + self.auth_name if "exogeni" in self.auth_name: - for services_node in xml_node.getElementsByTagName("services"): - for login_node in services_node.getElementsByTagName("login"): - hostname = login_node.getAttribute("hostname") - break + s_node = xml_node.getElementsByTagName("services")[0] + l_node = s_node.getElementsByTagName("login")[0] + hostname = l_node.getAttribute("hostname") node_n.ssh_config.hostname = hostname for intf in intfs: aux_mac_address = intf.getAttribute("mac_address") - mac = ":".join( - [aux_mac_address[i:i+2] for i in range(0, 12, 2)] - ) + + if "wall" in self.auth_name: + mac = ":".join( + [aux_mac_address[i:i+2] for i in range(0, 12, 2)] + ) + else: + mac = aux_mac_address + command = ( 'echo "mac=\\"\$1\\"; cd / && ./sbin/ifconfig -a | ' 'awk \'/^[a-z]/ { if ( \\"\'\\"\$mac\\"\'\\" == \$5 )' ' print \$1}\'" > mac2ifname.sh') ssh_support.execute_command(self, node_n.ssh_config, command) - # ssh_support.copy_path_to_testbed( - # self, - # node_n.ssh_config, - # os.path.join(dir_path, 'mac2ifname.sh'), - # '') ssh_support.execute_command( self, node_n.ssh_config, |