aboutsummaryrefslogtreecommitdiff
path: root/rumba/prototypes/ouroboros.py
diff options
context:
space:
mode:
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),