aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2017-06-07 08:17:51 +0000
committerSander Vrijders <sander.vrijders@intec.ugent.be>2017-06-07 08:17:51 +0000
commitdb18f01116739a2854c4305a7ad72da8c56d446d (patch)
treeb6c691147854bf26eff58867d79c84899da73e44
parent0cb3ff13b092d6a96f60aaa4bff4d9609b067a86 (diff)
parent1e179fc8058f7bbcea7b6a681726796b4ffe9748 (diff)
downloadrumba-db18f01116739a2854c4305a7ad72da8c56d446d.tar.gz
rumba-db18f01116739a2854c4305a7ad72da8c56d446d.zip
Merge branch 'rumba-access' into 'master'
rumba: add initial version of rumba-access See merge request !53
-rw-r--r--rumba/model.py8
-rwxr-xr-xtools/rumba-access31
2 files changed, 39 insertions, 0 deletions
diff --git a/rumba/model.py b/rumba/model.py
index eee8fac..941cba8 100644
--- a/rumba/model.py
+++ b/rumba/model.py
@@ -520,6 +520,13 @@ class Experiment:
if not ipcp.dif_bootstrapper:
break
+ def dump_ssh_info(self):
+ f = open('ssh_info', 'w')
+ for node in self.nodes:
+ f.write("%s %s %s %s\n" % (node.name, self.testbed.username,
+ node.ssh_config.hostname, node.ssh_config.port))
+ f.close()
+
# Examine the nodes and DIFs, compute the registration and enrollment
# order, the list of IPCPs to create, registrations, ...
def generate(self):
@@ -545,6 +552,7 @@ class Experiment:
def swap_in(self):
# Realize the experiment testbed (testbed-specific)
self.testbed.swap_in(self)
+ self.dump_ssh_info()
def swap_out(self):
# Undo the testbed (testbed-specific)
diff --git a/tools/rumba-access b/tools/rumba-access
new file mode 100755
index 0000000..06b0a02
--- /dev/null
+++ b/tools/rumba-access
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+FILE=ssh_info
+
+MACHINE_ID=$1
+if [ "$MACHINE_ID" == "" ]; then
+ echo "usage: $0 NODE_NAME"
+ exit 255
+fi
+
+USER=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk '{print $2}')
+if [ "$USER" == "" ]; then
+ echo "Error: Node ${MACHINE_ID} unknown"
+ exit 255
+fi
+
+HOST=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk '{print $3}')
+if [ "$HOST" == "" ]; then
+ echo "Error: Node ${MACHINE_ID} unknown"
+ exit 255
+fi
+
+SSH_PORT=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk '{print $4}')
+if [ "$SSH_PORT" == "" ]; then
+ echo "Error: Node ${MACHINE_ID} unknown"
+ exit 255
+fi
+
+echo "Accessing Rumba node ${MACHINE_ID}"
+# -o IdentityFile=buildroot/irati_rsa
+ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p ${SSH_PORT} ${USER}@${HOST}