From 055453d46e760ae27a8f0d108c191b3b0d1c88a2 Mon Sep 17 00:00:00 2001 From: Marco Capitani Date: Mon, 18 Sep 2017 11:43:06 +0200 Subject: IRATI: fix for variable installpath --- rumba/prototypes/irati.py | 27 +++++++++++++++------------ rumba/prototypes/irati_templates.py | 4 +++- 2 files changed, 18 insertions(+), 13 deletions(-) (limited to 'rumba/prototypes') diff --git a/rumba/prototypes/irati.py b/rumba/prototypes/irati.py index 48b013a..eebabc1 100644 --- a/rumba/prototypes/irati.py +++ b/rumba/prototypes/irati.py @@ -52,8 +52,14 @@ class Experiment(mod.Experiment): def fake_sudo(s): return s - def __init__(self, testbed, nodes=None): + def __init__(self, testbed, nodes=None, installpath=None, varpath=None): mod.Experiment.__init__(self, testbed, nodes) + if installpath is None: + installpath = '/usr' + if varpath is None: + varpath = '' + irati_templates.env_dict['installpath'] = installpath + irati_templates.env_dict['varpath'] = varpath self.manager = False self.conf_files = None self.shim2vlan = {} @@ -76,22 +82,19 @@ class Experiment(mod.Experiment): def install(self): """Installs IRATI on the nodes.""" 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 ethtool socat " - "libnl-3-dev libnl-genl-3-dev"), + 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 ~; 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_proxy_commands(self.testbed, node.ssh_config, - cmds, time_out=None) + cmds, time_out=None) def bootstrap_network(self): """Creates the network by enrolling and configuring the nodes""" @@ -255,7 +258,7 @@ class Experiment(mod.Experiment): if self.manager: # Add MAD/Manager configuration - irati_templates.ipcmconf_base["addons"] = { + irati_templates.get_ipcmconf_base()["addons"] = { "mad": { "managerAppName": "", "NMSDIFs": [{"DIF": "%s" % mgmt_dif_name}], @@ -270,7 +273,7 @@ class Experiment(mod.Experiment): for node in self.nodes: # type: mod.Node node2id_map[node.name] = node_number node_number += 1 - ipcmconfs[node.name] = copy.deepcopy(irati_templates.ipcmconf_base) + ipcmconfs[node.name] = copy.deepcopy(irati_templates.get_ipcmconf_base()) if self.manager: ipcmconfs[node.name]["addons"]["mad"]["managerAppName"] \ = "%s.mad-1--" % (node.name,) diff --git a/rumba/prototypes/irati_templates.py b/rumba/prototypes/irati_templates.py index 0b2b40d..c94de92 100644 --- a/rumba/prototypes/irati_templates.py +++ b/rumba/prototypes/irati_templates.py @@ -26,8 +26,10 @@ # Environment setup for VMs. Standard linux approach env_dict = {'installpath': '/usr', 'varpath': ''} + # Template for a IPCM configuration file -ipcmconf_base = { +def get_ipcmconf_base(): + return { "configFileVersion": "1.4.1", "localConfiguration": { "installationPath": "%(installpath)s/bin" % env_dict, -- cgit v1.2.3