diff options
author | Dimitri Staessens <[email protected]> | 2021-07-24 18:43:05 +0200 |
---|---|---|
committer | Dimitri Staessens <[email protected]> | 2021-07-24 18:43:05 +0200 |
commit | 9d07466cd0388ddece61d15f0abff5b89add5929 (patch) | |
tree | 28b2eefa4d3de9378a16e91858c46f97cd98a3a3 | |
parent | 1abd211bb7b58dc258570116af9403ecf0e28da9 (diff) | |
download | rumba-9d07466cd0388ddece61d15f0abff5b89add5929.tar.gz rumba-9d07466cd0388ddece61d15f0abff5b89add5929.zip |
prototypes: Fix experiment without influxDB
This fixes creating an experiment without influxDB defined (check for
None before iterating). Also fixes setting link rates to 1GbE, as this
requires link negotiation to be enabled.
-rw-r--r-- | rumba/prototypes/ouroboros.py | 16 | ||||
-rw-r--r-- | rumba/testbeds/jfed.py | 1 | ||||
-rw-r--r-- | rumba/testbeds/local.py | 1 |
3 files changed, 12 insertions, 6 deletions
diff --git a/rumba/prototypes/ouroboros.py b/rumba/prototypes/ouroboros.py index c8d286f..2c16ea5 100644 --- a/rumba/prototypes/ouroboros.py +++ b/rumba/prototypes/ouroboros.py @@ -130,10 +130,11 @@ class Experiment(mod.Experiment): server_decorator=OurServer ) - _required = ['ip', 'port', 'org', 'token'] - for field in _required: - if field not in influxdb: - raise(Exception("Missing field %s in influx_db: %s" % field)) + if influxdb is not None: + _required = ['ip', 'port', 'org', 'token'] + for field in _required: + if field not in influxdb: + raise (Exception("Missing field %s in influx_db: %s" % field)) self.r_ipcps = dict() self.irmd = None @@ -303,9 +304,14 @@ class Experiment(mod.Experiment): def _set_phy_link_rate_to(self, src, dst, megabit): + autoneg = 'off' + + if megabit == 1000: + autoneg = 'on' + commands = ["route | grep $(ping server -c 1 | head -n1 | cut -f3 -d' ' | head -c -3 | tail -c +2) | " "grep -o '[^ ]*$' > iface ".format(dst), - "sudo ethtool -s $(cat iface) speed {} duplex full autoneg off".format(megabit), + "sudo ethtool -s $(cat iface) speed {} duplex full autoneg {}".format(megabit, autoneg), "sudo ip link set $(cat iface) down", "sudo ip link set $(cat iface) up && sleep 10", "sudo ethtool $(cat iface) | grep '{}Mb/s'".format(megabit), diff --git a/rumba/testbeds/jfed.py b/rumba/testbeds/jfed.py index be914cd..e9e281d 100644 --- a/rumba/testbeds/jfed.py +++ b/rumba/testbeds/jfed.py @@ -28,7 +28,6 @@ import subprocess import getpass import xml.dom.minidom as xml import os.path -import time import tarfile import sys diff --git a/rumba/testbeds/local.py b/rumba/testbeds/local.py index 85e9e95..9326d94 100644 --- a/rumba/testbeds/local.py +++ b/rumba/testbeds/local.py @@ -31,6 +31,7 @@ from rumba.executors.local import LocalExecutor logger = log.get_logger(__name__) + class Testbed(mod.Testbed): """ Local testbed, does not do anything. In the case of the Ouroboros |