commit 953dc47ec17116696e2dcb885bf8fff23b86cacf
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Fri May 22 14:12:48 2015 +0200
Add Controller support for NetEm.
This patch adds support for processing from XML recipe and sending to Slave
with other interface configuration. NetEm params for interface are stored
in dict with config, under key "netem" and the values from config are
parsed
on Slave. (see next commit)
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Acked-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/Machine.py | 6 +++++-
lnst/Controller/NetTestController.py | 3 +++
2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index dc30ef0..52e85e4 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -500,6 +500,7 @@ class Interface(object):
self._hwaddr = None
self._devname = None
self._network = None
+ self._netem = None
self._slaves = {}
self._slave_options = {}
@@ -550,6 +551,9 @@ class Interface(object):
def set_option(self, name, value):
self._options.append((name, value))
+ def set_netem(self, netem):
+ self._netem = netem
+
def add_master(self, master, primary=True):
if primary and self._master["primary"] != None:
msg = "Interface %s already has a primary master."\
@@ -642,7 +646,7 @@ class Interface(object):
"slave_options": self._slave_options,
"master": None, "other_masters": [],
"ovs_conf": self._ovs_conf, "netns": self._netns,
- "peer": self._peer}
+ "peer": self._peer, "netem" : self._netem}
if self._master["primary"] != None:
config["master"] = self._master["primary"].get_id()
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index efeeb92..eeb6426 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -326,6 +326,9 @@ class NetTestController:
for opt in iface_xml_data["options"]:
iface.set_option(opt["name"], opt["value"])
+ if "netem" in iface_xml_data:
+ iface.set_netem(iface_xml_data["netem"].to_dict())
+
if "ovs_conf" in iface_xml_data:
iface.set_ovs_conf(iface_xml_data["ovs_conf"].to_dict())
Show replies by date