From 1f70912a80177b79905242dc7bd8c013625d85a5 Mon Sep 17 00:00:00 2001 From: Vincenzo Maffione Date: Thu, 13 Apr 2017 22:50:31 +0200 Subject: prototypes: rlite: implement create_ipcps() --- rumba/prototypes/rlite.py | 41 ++++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) (limited to 'rumba/prototypes/rlite.py') diff --git a/rumba/prototypes/rlite.py b/rumba/prototypes/rlite.py index 0ff680d..387c502 100644 --- a/rumba/prototypes/rlite.py +++ b/rumba/prototypes/rlite.py @@ -27,8 +27,8 @@ class Experiment(mod.Experiment): def __init__(self, testbed, nodes=None): mod.Experiment.__init__(self, testbed, nodes) - def setup(self): - cmds = list() + def init(self): + cmds = [] if False: # ubuntu cmds.append("apt-get update") @@ -38,19 +38,46 @@ class Experiment(mod.Experiment): cmds.append("rm -rf ~/rlite") cmds.append("cd ~; git clone https://github.com/vmaffione/rlite") cmds.append("cd ~/rlite && ./configure && make && sudo make install") + + # Load kernel modules cmds.append("modprobe rlite") cmds.append("modprobe rlite-normal") cmds.append("modprobe rlite-shim-eth") cmds.append("modprobe rlite-shim-udp4") cmds.append("modprobe rlite-shim-loopback") - cmds.append("nohup rlite-uipcps -v DBG -k 0 -U -A &> uipcp.log &") + + # Start the uipcps daemon + cmds.append("rlite-uipcps -v DBG -k 0 &> uipcp.log &") for node in self.nodes: ssh.execute_commands(self.testbed, node.ssh_config, cmds, time_out=None) + def create_ipcps(self): + for node in self.nodes: + cmds = [] + for ipcp in node.ipcps: + + if type(ipcp.dif) is mod.NormalDIF: + ipcp_type = 'normal' + elif type(ipcp.dif) is mod.ShimEthDIF: + ipcp_type = 'shim-eth' + elif type(ipcp.dif) is mod.ShimUDPDIF: + ipcp_type = 'shim-udp4' + else: + print("unknown type for DIF %s, default to loopback" \ + % ipcp.dif.name) + ipcp_type = 'shim-loopback' + + cmds.append("rlite-ctl ipcp-create %s %s %s" % \ + (ipcp.name, ipcp_type, ipcp.dif.name)) + + ssh.execute_commands(self.testbed, node.ssh_config, cmds, + time_out = None) + def run_prototype(self): - print("[RLITE experiment] start") - print("Setting up rlite on the nodes...") - self.setup() - print("[RLITE experiment] end") + print("rlite: setting up") + self.init() + print("rlite: software initialized on all nodes") + self.create_ipcps() + print("rlite: IPCPs created on all nodes") -- cgit v1.2.3