aboutsummaryrefslogtreecommitdiff
path: root/rumba/prototypes/ouroboros.py
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2021-07-24 18:43:05 +0200
committerDimitri Staessens <dimitri@ouroboros.rocks>2021-07-24 18:43:05 +0200
commit9d07466cd0388ddece61d15f0abff5b89add5929 (patch)
tree28b2eefa4d3de9378a16e91858c46f97cd98a3a3 /rumba/prototypes/ouroboros.py
parent1abd211bb7b58dc258570116af9403ecf0e28da9 (diff)
downloadrumba-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.
Diffstat (limited to 'rumba/prototypes/ouroboros.py')
-rw-r--r--rumba/prototypes/ouroboros.py16
1 files changed, 11 insertions, 5 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),