diff options
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | rumba/log.py | 15 | ||||
-rw-r--r-- | rumba/prototypes/ouroboros.py | 6 | ||||
-rw-r--r-- | rumba/prototypes/rlite.py | 8 | ||||
-rw-r--r-- | rumba/ssh_support.py | 2 | ||||
-rw-r--r-- | rumba/testbeds/jfed.py | 14 | ||||
-rwxr-xr-x | setup.py | 8 |
7 files changed, 35 insertions, 28 deletions
@@ -1,7 +1,7 @@ -# Rumba: A framework to install, bootstrap a RINA network +# Rumba: A framework to bootstrap a RINA network on a testbed Rumba is part of ARCFIRE 2020, Work Package 3. It is a framework in -Python which allows user to write a Python script to define a RINA +Python which allows a user to write a Python script to define a RINA network. The physical graph needed for this RINA network is then calculated and realised on one of the supported testbeds. Next, if the user requests this, one of the supported RINA prototypes is @@ -128,6 +128,9 @@ folder. $ eval `ssh-agent` $ ssh-add /home/morty/cert.pem + Pay attention to run your rumba script in the same terminal used for the + previous commands, without changing the user (e.g. using su or sudo). + ## Accessing nodes after swap-in To access a node once the experiment swapped in, use the following @@ -135,4 +138,5 @@ folder. $ rumba-access $NODE_NAME - Where $NODE_NAME is the name of the node to access.
\ No newline at end of file + Where $NODE_NAME is the name of the node to access. + diff --git a/rumba/log.py b/rumba/log.py index d95c034..bed0170 100644 --- a/rumba/log.py +++ b/rumba/log.py @@ -40,9 +40,8 @@ class RumbaFormatter(logging.Formatter): def __init__(self): super(RumbaFormatter, self).__init__( - fmt='{asctime} | {levelname:3.3} | ' - '{name:11.11} | {message}', - style='{', + fmt='%(asctime)s | %(levelname)3.3s | ' + '%(name)11.11s | %(message)s', datefmt='%H:%M:%S') def format(self, record): @@ -95,11 +94,11 @@ def set_logging_level(level, name=None): """ Set the current logging level to <level> for logger named <name>. If name is not specified, sets the logging level for all rumba loggers. - Accepted levels are: - DEBUG == 10, - INFO == 20, - WARNING == 30, - ERROR == 40, + Accepted levels are: + DEBUG == 10, + INFO == 20, + WARNING == 30, + ERROR == 40, CRITICAL == 50, NOTSET == 0 (resets the logger: its level is set to the default or its parents' level) diff --git a/rumba/prototypes/ouroboros.py b/rumba/prototypes/ouroboros.py index 9ac1425..43cb1d5 100644 --- a/rumba/prototypes/ouroboros.py +++ b/rumba/prototypes/ouroboros.py @@ -63,13 +63,13 @@ class Experiment(mod.Experiment): else: cmd = "irm i c n " + ipcp.name - if type(ipcp.dif) is mod.ShimEthDIF: + if isinstance(ipcp.dif, mod.ShimEthDIF): # NOTE: Here to test with fake testbed if ipcp.ifname is None: ipcp.ifname = "eth0" cmd += " type shim-eth-llc if_name " + ipcp.ifname cmd += " dif " + ipcp.dif.name - elif type(ipcp.dif) is mod.NormalDIF: + elif isinstance(ipcp.dif, mod.NormalDIF): cmd += " type normal" if ipcp.dif_bootstrapper: cmd += " dif " + ipcp.dif.name @@ -83,7 +83,7 @@ class Experiment(mod.Experiment): for dif_b in node.dif_registrations[ipcp.dif]: cmd2 += " dif " + dif_b.name cmds2.append(cmd2) - elif type(ipcp.dif) is mod.ShimUDPDIF: + elif isinstance(ipcp.dif, mod.ShimUDPDIF): # FIXME: Will fail, since we don't keep IPs yet cmd += " type shim-udp" cmd += " dif " + ipcp.dif.name diff --git a/rumba/prototypes/rlite.py b/rumba/prototypes/rlite.py index cc38255..abab080 100644 --- a/rumba/prototypes/rlite.py +++ b/rumba/prototypes/rlite.py @@ -70,11 +70,11 @@ class Experiment(mod.Experiment): for ipcp in node.ipcps: # Generate the command to create the IPCP - if type(ipcp.dif) is mod.NormalDIF: + if isinstance(ipcp.dif, mod.NormalDIF): ipcp_type = 'normal' - elif type(ipcp.dif) is mod.ShimEthDIF: + elif isinstance(ipcp.dif, mod.ShimEthDIF): ipcp_type = 'shim-eth' - elif type(ipcp.dif) is mod.ShimUDPDIF: + elif isinstance(ipcp.dif, mod.ShimUDPDIF): ipcp_type = 'shim-udp4' else: logger.warning( @@ -87,7 +87,7 @@ class Experiment(mod.Experiment): # Generate the command to configure the interface # name for the shim-eth - if type(ipcp.dif) is mod.ShimEthDIF: + if isinstance(ipcp.dif, mod.ShimEthDIF): cmds.append("rlite-ctl ipcp-config %s netdev %s" % (ipcp.name, ipcp.ifname)) diff --git a/rumba/ssh_support.py b/rumba/ssh_support.py index a1e1ba4..b0970e1 100644 --- a/rumba/ssh_support.py +++ b/rumba/ssh_support.py @@ -40,7 +40,7 @@ def _print_stream(stream): o_array = o.split('\\n') for oi in o_array: logger.debug(oi) - return o + return o.rstrip() def execute_proxy_commands(testbed, ssh_config, commands, time_out=3): diff --git a/rumba/testbeds/jfed.py b/rumba/testbeds/jfed.py index 83fbce7..e158048 100644 --- a/rumba/testbeds/jfed.py +++ b/rumba/testbeds/jfed.py @@ -22,6 +22,8 @@ import subprocess import getpass import xml.dom.minidom as xml import os.path + +import time import wget import tarfile @@ -173,6 +175,9 @@ class Testbed(mod.Testbed): dir_path = os.path.dirname(os.path.abspath(__file__)) # Complete details of the nodes after swapin + logger.info("Sleeping for two seconds to avoid contacting jfed nodes " + "too soon.") + time.sleep(2) for xml_node in xml_nodes: n_name = xml_node.getAttribute("client_id") intfs = xml_node.getElementsByTagName("interface") @@ -215,8 +220,13 @@ class Testbed(mod.Testbed): if isinstance(ipcp, mod.ShimEthIPCP): if self.if_id[ipcp] == i_name: ipcp.ifname = ifname - logger.debug("Node %s interface %s has name %s." - % (node_n.name, mac, ifname)) + if ifname is None: + logger.error("Could not determine name of node" + "%s interface %s" + % (node_n.name, mac)) + else: + logger.debug("Node %s interface %s has name %s." + % (node_n.name, mac, ifname)) # comp_id = intf.getAttribute("component_id") # comp_arr = comp_id.split(":") # ipcp.ifname = comp_arr[-1] @@ -4,21 +4,15 @@ from setuptools import setup from codecs import open from os import path -here = path.abspath(path.dirname(__file__)) - -with open(path.join(here, 'README.md'), encoding='utf-8') as f: - long_description = f.read() - setup( name="Rumba", - version="0.3", + version="0.4", url="https://gitlab.com/arcfire/rumba", keywords="rina measurement testbed", author="Sander Vrijders", author_email="sander.vrijders@intec.ugent.be", license="LGPL", description="Rumba measurement framework for RINA", - long_description=long_description, packages=["rumba", "rumba.testbeds", "rumba.prototypes"], install_requires=["paramiko", "wheel", "wget"], scripts = ['tools/rumba-access'] |