aboutsummaryrefslogtreecommitdiff
path: root/rumba/prototypes/rlite.py
diff options
context:
space:
mode:
authorVincenzo Maffione <v.maffione@gmail.com>2017-04-13 22:50:31 +0200
committerVincenzo Maffione <v.maffione@gmail.com>2017-04-13 22:50:43 +0200
commit1f70912a80177b79905242dc7bd8c013625d85a5 (patch)
treea82b22e00e68de4ca4febad0beca6e7bee24ef58 /rumba/prototypes/rlite.py
parent17f8e41dc79dbc452a7bfa87717a0ca878eb773e (diff)
downloadrumba-1f70912a80177b79905242dc7bd8c013625d85a5.tar.gz
rumba-1f70912a80177b79905242dc7bd8c013625d85a5.zip
prototypes: rlite: implement create_ipcps()
Diffstat (limited to 'rumba/prototypes/rlite.py')
-rw-r--r--rumba/prototypes/rlite.py41
1 files changed, 34 insertions, 7 deletions
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")