From 1e179fc8058f7bbcea7b6a681726796b4ffe9748 Mon Sep 17 00:00:00 2001 From: Vincenzo Maffione Date: Wed, 7 Jun 2017 10:04:07 +0200 Subject: rumba: add initial version of rumba-access --- tools/rumba-access | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 tools/rumba-access (limited to 'tools/rumba-access') 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} -- cgit v1.2.3 From dcb7c8743244b4010db159d7d8d794278a792b17 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Wed, 7 Jun 2017 11:27:22 +0200 Subject: tools: Update access script to use proxy The proxy command was not added to the file generated with ssh info. This adds it, and changes the access script to use it if it is there. --- rumba/model.py | 9 ++++++--- tools/rumba-access | 20 +++++++++++++++----- 2 files changed, 21 insertions(+), 8 deletions(-) (limited to 'tools/rumba-access') diff --git a/rumba/model.py b/rumba/model.py index 941cba8..d1b9988 100644 --- a/rumba/model.py +++ b/rumba/model.py @@ -523,8 +523,11 @@ class Experiment: 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.write("%s;%s;%s;%s;%s\n" % (node.name, + self.testbed.username, + node.ssh_config.hostname, + node.ssh_config.port, + node.ssh_config.proxycommand)) f.close() # Examine the nodes and DIFs, compute the registration and enrollment @@ -642,7 +645,7 @@ class Server: def get_new_clients(self, interval): """ Returns a list of clients of size appropriate to the server's rate. - + The list's size should be a sample from Poisson(arrival_rate) over interval seconds. Hence, the average size should be interval * arrival_rate. diff --git a/tools/rumba-access b/tools/rumba-access index 06b0a02..4c77d2b 100755 --- a/tools/rumba-access +++ b/tools/rumba-access @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash FILE=ssh_info @@ -8,24 +8,34 @@ if [ "$MACHINE_ID" == "" ]; then exit 255 fi -USER=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk '{print $2}') +USER=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk -F';' '{print $2}') if [ "$USER" == "" ]; then echo "Error: Node ${MACHINE_ID} unknown" exit 255 fi -HOST=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk '{print $3}') +HOST=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk -F';' '{print $3}') if [ "$HOST" == "" ]; then echo "Error: Node ${MACHINE_ID} unknown" exit 255 fi -SSH_PORT=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk '{print $4}') +SSH_PORT=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk -F';' '{print $4}') if [ "$SSH_PORT" == "" ]; then echo "Error: Node ${MACHINE_ID} unknown" exit 255 fi +PROXY_CMD=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk -F';' '{print $5}') +if [ "$PROXY_CMD" == "" ]; 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} +if [[ $PROXY_CMD = "None" ]]; then + ssh -A -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p ${SSH_PORT} ${USER}@${HOST} +else + ssh -A -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -oProxyCommand="$PROXY_CMD" -p ${SSH_PORT} ${USER}@${HOST} +fi -- cgit v1.2.3 From a427bde346383f8b414e3f49680d40cd1e94d321 Mon Sep 17 00:00:00 2001 From: Vincenzo Maffione Date: Thu, 8 Jun 2017 22:19:05 +0200 Subject: tools: rumba-access: rearrange script --- tools/rumba-access | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tools/rumba-access') diff --git a/tools/rumba-access b/tools/rumba-access index 4c77d2b..e4ab468 100755 --- a/tools/rumba-access +++ b/tools/rumba-access @@ -32,10 +32,12 @@ if [ "$PROXY_CMD" == "" ]; then exit 255 fi -echo "Accessing Rumba node ${MACHINE_ID}" -# -o IdentityFile=buildroot/irati_rsa if [[ $PROXY_CMD = "None" ]]; then - ssh -A -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p ${SSH_PORT} ${USER}@${HOST} + PROXY_CMD="" else - ssh -A -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -oProxyCommand="$PROXY_CMD" -p ${SSH_PORT} ${USER}@${HOST} + PROXY_CMD="-oProxyCommand=$PROXY_CMD" fi + +echo "Accessing Rumba node ${MACHINE_ID}" +# -o IdentityFile=buildroot/irati_rsa +ssh -A -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${PROXY_CMD} -p ${SSH_PORT} ${USER}@${HOST} -- cgit v1.2.3 From a10ec3b3a963c486344a90214c162e118d801c47 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Mon, 12 Jun 2017 13:14:47 +0200 Subject: tools: Fix rumba access script This fixes some errors in the rumba access script. --- tools/rumba-access | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tools/rumba-access') diff --git a/tools/rumba-access b/tools/rumba-access index e4ab468..075caf0 100755 --- a/tools/rumba-access +++ b/tools/rumba-access @@ -34,10 +34,11 @@ fi if [[ $PROXY_CMD = "None" ]]; then PROXY_CMD="" + PROXY_PREF="" else - PROXY_CMD="-oProxyCommand=$PROXY_CMD" + PROXY_PREF="-oProxyCommand=" fi echo "Accessing Rumba node ${MACHINE_ID}" # -o IdentityFile=buildroot/irati_rsa -ssh -A -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${PROXY_CMD} -p ${SSH_PORT} ${USER}@${HOST} +ssh -A -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${PROXY_PREF}"${PROXY_CMD}" -p ${SSH_PORT} ${USER}@${HOST} -- cgit v1.2.3 From a5e67722327ecb2046798e6ad9a103fb42cb09e8 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Tue, 13 Jun 2017 09:42:01 +0200 Subject: tools: Revert rumba-access to initial state This reverts the script to its original state since it was not functioning properly. --- tools/rumba-access | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'tools/rumba-access') diff --git a/tools/rumba-access b/tools/rumba-access index 075caf0..1cf382e 100755 --- a/tools/rumba-access +++ b/tools/rumba-access @@ -32,13 +32,9 @@ if [ "$PROXY_CMD" == "" ]; then exit 255 fi +echo "Accessing Rumba node ${MACHINE_ID}" if [[ $PROXY_CMD = "None" ]]; then - PROXY_CMD="" - PROXY_PREF="" + ssh -A -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p ${SSH_PORT} ${USER}@${HOST} else - PROXY_PREF="-oProxyCommand=" + ssh -A -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -oProxyCommand="$PROXY_CMD" -p ${SSH_PORT} ${USER}@${HOST} fi - -echo "Accessing Rumba node ${MACHINE_ID}" -# -o IdentityFile=buildroot/irati_rsa -ssh -A -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${PROXY_PREF}"${PROXY_CMD}" -p ${SSH_PORT} ${USER}@${HOST} -- cgit v1.2.3