aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrumba/prototypes/enroll.py8
-rw-r--r--rumba/prototypes/irati.py23
-rw-r--r--rumba/testbeds/jfed.py35
3 files changed, 47 insertions, 19 deletions
diff --git a/rumba/prototypes/enroll.py b/rumba/prototypes/enroll.py
index 458736a..99b49a6 100755
--- a/rumba/prototypes/enroll.py
+++ b/rumba/prototypes/enroll.py
@@ -78,8 +78,8 @@ if connected:
get_response(s)
# Send the IPCP list command
- cmd = 'list-ipcps\n'
- s.sendall(bytes(cmd, 'ascii'))
+ cmd = u'list-ipcps\n'
+ s.sendall(cmd.encode('ascii'))
# Get the list of IPCPs and parse it to look for the enroller ID
print('Looking up identifier for IPCP %s' % args.enrollee_name)
@@ -98,11 +98,11 @@ if connected:
raise Exception()
# Send the enroll command
- cmd = 'enroll-to-dif %s %s %s %s 1\n' \
+ cmd = u'enroll-to-dif %s %s %s %s 1\n' \
% (enrollee_id, args.dif, args.lower_dif, args.enroller_name)
print(cmd)
- s.sendall(bytes(cmd, 'ascii'))
+ s.sendall(cmd.encode('ascii'))
# Get the enroll command answer
lines = get_response(s)
diff --git a/rumba/prototypes/irati.py b/rumba/prototypes/irati.py
index e24dd60..b5f8f6b 100644
--- a/rumba/prototypes/irati.py
+++ b/rumba/prototypes/irati.py
@@ -21,8 +21,6 @@
import copy
import json
-import subprocess
-
import os
import time
@@ -69,14 +67,19 @@ class Experiment(mod.Experiment):
def install(self):
"""Installs IRATI on the nodes."""
- cmds = list()
-
- cmds.append("sudo apt-get update")
- cmds.append("sudo apt-get install g++ gcc "
- "protobuf-compiler libprotobuf-dev git --yes")
- cmds.append("sudo rm -rf ~/irati")
- cmds.append("cd && git clone https://github.com/IRATI/stack irati")
- cmds.append("cd ~/irati && sudo ./install-from-scratch")
+ cmds = [self.sudo("apt-get update"),
+ "export https_proxy=\"https://proxy.atlantis.ugent.be:8080\"; "
+ + 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 ~; "
+ "export https_proxy=\"https://proxy.atlantis.ugent.be:8080\"; "
+ + "git clone https://github.com/IRATI/stack irati",
+ "cd ~/irati && git checkout arcfire",
+ "cd ~/irati && "
+ + self.sudo("./install-from-scratch")]
for node in self.nodes:
ssh.execute_commands(self.testbed, node.ssh_config,
diff --git a/rumba/testbeds/jfed.py b/rumba/testbeds/jfed.py
index 5394146..53a812f 100644
--- a/rumba/testbeds/jfed.py
+++ b/rumba/testbeds/jfed.py
@@ -27,7 +27,7 @@ import tarfile
import rumba.model as mod
import rumba.log as log
-
+from rumba import ssh_support
logger = log.get_logger(__name__)
@@ -49,7 +49,7 @@ class Testbed(mod.Testbed):
self.jfed_jar = "jfed_cli/experimenter-cli.jar"
if image is not None:
self.image = "urn:publicid:IDN+" + authority + \
- "+image+GeniSlices:" + image
+ "+image+wall2-ilabt-iminds-be:" + image
else:
self.image = None
@@ -164,22 +164,47 @@ class Testbed(mod.Testbed):
rspec = xml.parse(self.manifest)
xml_nodes = rspec.getElementsByTagName("node")
+ dir_path = os.path.dirname(os.path.abspath(__file__))
+
# Complete details of the nodes after swapin
for xml_node in xml_nodes:
n_name = xml_node.getAttribute("client_id")
intfs = xml_node.getElementsByTagName("interface")
+ got = False
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)
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)]
+ )
+ 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,
+ 'cd ~ && chmod a+x mac2ifname.sh')
+ ifname = ssh_support.execute_command(
+ self,
+ node_n.ssh_config,
+ './mac2ifname.sh ' + mac
+ )
i_name = intf.getAttribute("client_id")
for ipcp in node_n.ipcps:
if isinstance(ipcp, mod.ShimEthIPCP):
if self.if_id[ipcp] == i_name:
- comp_id = intf.getAttribute("component_id")
- comp_arr = comp_id.split(":")
- ipcp.ifname = comp_arr[-1]
+ ipcp.ifname = ifname
+ # comp_id = intf.getAttribute("component_id")
+ # comp_arr = comp_id.split(":")
+ # ipcp.ifname = comp_arr[-1]
# xml_ip = intf.getElementsByTagName("ip")
# interface.ip = xml_ip[0].getAttribute("address")