[lnst: 2/10] Add NetEm XML recipe parsing support
by jtluka
commit 8e5294cd0842da4aef1e41db12ff1dc1b0c105d2
Author: Jiri Prochazka <jprochaz(a)redhat.com>
Date: Thu May 21 14:24:17 2015 +0200
Add NetEm XML recipe parsing support
This patch adds parsing of XML elements identifying NetEm parameters.
Along with parsing, basic syntax check is executed, checking if
mandatory attributes are correctly entered.
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/RecipeParser.py | 63 +++++++++++++++++++++++++++++++++++++++
1 files changed, 63 insertions(+), 0 deletions(-)
---
diff --git a/lnst/Controller/RecipeParser.py b/lnst/Controller/RecipeParser.py
index 7269820..73422f1 100644
--- a/lnst/Controller/RecipeParser.py
+++ b/lnst/Controller/RecipeParser.py
@@ -111,6 +111,11 @@ class RecipeParser(XmlParser):
if self._has_attribute(iface_tag, "netns"):
iface["netns"] = self._get_attribute(iface_tag, "netns")
+ # netem
+ netem_tag = iface_tag.find("netem")
+ if netem_tag is not None:
+ iface["netem"] = self._process_netem(netem_tag)
+
# params
params_tag = iface_tag.find("params")
params = self._process_params(params_tag)
@@ -269,6 +274,64 @@ class RecipeParser(XmlParser):
return options
+ def _validate_netem(self, options, netem_op, netem_tag):
+ if netem_op == "delay":
+ valid = False
+ jitter = False
+ correlation = False
+ distribution = False
+ valid_distributions = ["normal", "uniform", "pareto", "paretonormal"]
+ for opt in options:
+ if "time" in opt.values():
+ valid = True
+ elif "distribution" in opt.values():
+ if opt["value"] not in valid_distributions:
+ raise RecipeError("netem: invalid distribution type", netem_tag)
+ else:
+ distribution = True
+ elif "jitter" in opt.values():
+ jitter = True
+ elif "correlation" in opt.values():
+ correlation = True
+ if not jitter:
+ if correlation or distribution:
+ raise RecipeError("netem: jitter option is mandatory when using <correlation> or <distribution>", netem_tag)
+ if not valid:
+ raise RecipeError("netem: time option is mandatory for <delay>", netem_tag)
+ elif netem_op == "loss":
+ for opt in options:
+ if "percent" in opt.values():
+ return
+ raise RecipeError("netem: percent option is mandatory for <loss>", netem_tag)
+ elif netem_op == "duplication":
+ for opt in options:
+ if "percent" in opt.values():
+ return
+ raise RecipeError("netem: percent option is mandatory for <duplication>", netem_tag)
+ elif netem_op == "corrupt":
+ for opt in options:
+ if "percent" in opt.values():
+ return
+ raise RecipeError("netem: percent option is mandatory for <corrupt>", netem_tag)
+ elif netem_op == "reordering":
+ for opt in options:
+ if "percent" in opt.values():
+ return
+ raise RecipeError("netem: percent option is mandatory for <reordering>", netem_tag)
+
+ def _process_netem(self, netem_tag):
+ interface = XmlData(netem_tag)
+ # params
+ for netem_op in ["delay", "loss", "duplication", "corrupt", "reordering"]:
+ netem_op_tag = netem_tag.find(netem_op)
+ if netem_op_tag is not None:
+ options_tag = netem_op_tag.find("options")
+ options = self._process_options(options_tag)
+ if len(options) > 0:
+ self._validate_netem(options, netem_op, netem_tag)
+ interface[netem_op] = options
+ return interface
+
def _process_task(self, task_tag):
task = XmlData(task_tag)
8 years, 11 months
[lnst: 1/10] Add NetEm support to schema-recipe.rng
by jtluka
commit 7f8111843bf5d57ae14070303b61306cc47f5eeb
Author: Jiri Prochazka <jprochaz(a)redhat.com>
Date: Thu May 21 14:24:16 2015 +0200
Add NetEm support to schema-recipe.rng
This patch updates RelaxNG recipe schema with new NetEm implementation.
For more info about the format of NetEm options in recipe, please visit
corresponding page on LNST wiki pages.
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>
schema-recipe.rng | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 46 insertions(+), 0 deletions(-)
---
diff --git a/schema-recipe.rng b/schema-recipe.rng
index 81a60aa..4cb0e9e 100644
--- a/schema-recipe.rng
+++ b/schema-recipe.rng
@@ -164,6 +164,10 @@
<optional>
<ref name="addresses"/>
</optional>
+
+ <optional>
+ <ref name="netem"/>
+ </optional>
</interleave>
</element>
</define>
@@ -449,6 +453,48 @@
</element>
</define>
+ <define name="netem">
+ <element name="netem">
+ <interleave>
+ <optional>
+ <element name="delay">
+ <optional>
+ <ref name="options"/>
+ </optional>
+ </element>
+ </optional>
+ <optional>
+ <element name="loss">
+ <optional>
+ <ref name="options"/>
+ </optional>
+ </element>
+ </optional>
+ <optional>
+ <element name="duplication">
+ <optional>
+ <ref name="options"/>
+ </optional>
+ </element>
+ </optional>
+ <optional>
+ <element name="corrupt">
+ <optional>
+ <ref name="options"/>
+ </optional>
+ </element>
+ </optional>
+ <optional>
+ <element name="reordering">
+ <optional>
+ <ref name="options"/>
+ </optional>
+ </element>
+ </optional>
+ </interleave>
+ </element>
+ </define>
+
<define name="params">
<element name="params">
<interleave>
8 years, 11 months
[lnst] (10 commits) Non-fast-forward update to branch master
by jtluka
The branch 'master' was changed in a way that was not a fast-forward update.
NOTE: This may cause problems for people pulling from the branch. For more information,
please see:
http://live.gnome.org/Git/Help/NonFastForward
Commits removed from the branch:
91bb139... Add NetEm support to schema-recipe.rng
7b815c6... Add NetEm XML recipe parsing support
953dc47... Add Controller support for NetEm.
12c045a... Add Slave methods for NetEm value parsing from interface co
2736652... Add Slave NetEm param configuration and deconfiguration sup
fd67c36... Add netem to smoke tests variables config
12f2606... Add netem variant to smoke tests
66bea12... Add example recipes from LNST wiki page about NetEm
ddbf666... recipes: remove offload configuration for ping tests betwee
e198117... recipes: add mtu configuration to phase1 and phase2 tests
Commits added to the branch:
7f81118... Add NetEm support to schema-recipe.rng
8e5294c... Add NetEm XML recipe parsing support
8887f07... Add Controller support for NetEm.
742d405... Add Slave methods for NetEm value parsing from interface co
acae499... Add Slave NetEm param configuration and deconfiguration sup
7f6794c... Add netem to smoke tests variables config
21893e8... Add netem variant to smoke tests
f4a2a77... Add example recipes from LNST wiki page about NetEm
a75f261... recipes: remove offload configuration for ping tests betwee
81dd198... recipes: add mtu configuration to phase1 and phase2 tests
8 years, 11 months
[lnst] recipes: add mtu configuration to phase1 and phase2 tests
by jtluka
commit e19811779fa5ac1e1bc0112923c6c2729f2af3d3
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Fri May 22 13:45:59 2015 +0200
recipes: add mtu configuration to phase1 and phase2 tests
Recipes in phase1 and phase2 directories can now be run with user
specified MTU, for example:
lnst-ctl -A mtu=8000 recipes/regression_tests/phase1/3_vlans.xml
If it is not set the default MTU of 1500 bytes is used.
Version 2: removed the patch file
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
recipes/regression_tests/phase1/3_vlans.py | 12 ++++++++++++
recipes/regression_tests/phase1/3_vlans.xml | 1 +
.../phase1/3_vlans_over_active_backup_bond.xml | 1 +
.../regression_tests/phase1/3_vlans_over_bond.py | 12 ++++++++++++
.../phase1/3_vlans_over_round_robin_bond.xml | 1 +
.../regression_tests/phase1/active_backup_bond.xml | 1 +
.../phase1/active_backup_double_bond.xml | 1 +
recipes/regression_tests/phase1/bonding_test.py | 6 ++++++
recipes/regression_tests/phase1/ping_flood.xml | 1 +
.../regression_tests/phase1/round_robin_bond.xml | 1 +
.../phase1/round_robin_double_bond.xml | 1 +
recipes/regression_tests/phase1/simple_ping.py | 7 +++++++
.../phase2/3_vlans_over_active_backup_team.xml | 1 +
.../phase2/3_vlans_over_round_robin_team.xml | 1 +
.../regression_tests/phase2/3_vlans_over_team.py | 13 +++++++++++++
.../phase2/active_backup_double_team.xml | 1 +
.../regression_tests/phase2/active_backup_team.xml | 1 +
.../active_backup_team_vs_active_backup_bond.xml | 1 +
.../active_backup_team_vs_round_robin_bond.xml | 1 +
.../phase2/round_robin_double_team.xml | 1 +
.../regression_tests/phase2/round_robin_team.xml | 1 +
.../round_robin_team_vs_active_backup_bond.xml | 1 +
.../round_robin_team_vs_round_robin_bond.xml | 1 +
recipes/regression_tests/phase2/team_test.py | 7 +++++++
24 files changed, 75 insertions(+), 0 deletions(-)
---
diff --git a/recipes/regression_tests/phase1/3_vlans.py b/recipes/regression_tests/phase1/3_vlans.py
index a034870..7e79a9f 100644
--- a/recipes/regression_tests/phase1/3_vlans.py
+++ b/recipes/regression_tests/phase1/3_vlans.py
@@ -18,6 +18,18 @@ vlans = ["vlan10", "vlan20", "vlan30"]
offloads = ["gso", "gro", "tso"]
ipv = ctl.get_alias('ipv')
+mtu = ctl.get_alias('mtu')
+
+m1_phy1 = m1.get_interface("eth1")
+m1_phy1.set_mtu(mtu)
+m2_phy1 = m2.get_interface("eth1")
+m2_phy1.set_mtu(mtu)
+
+for vlan in vlans:
+ vlan_if1 = m1.get_interface(vlan)
+ vlan_if1.set_mtu(mtu)
+ vlan_if2 = m2.get_interface(vlan)
+ vlan_if2.set_mtu(mtu)
ctl.wait(15)
diff --git a/recipes/regression_tests/phase1/3_vlans.xml b/recipes/regression_tests/phase1/3_vlans.xml
index 2262b6d..ba0455c 100644
--- a/recipes/regression_tests/phase1/3_vlans.xml
+++ b/recipes/regression_tests/phase1/3_vlans.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase1/3_vlans_over_active_backup_bond.xml b/recipes/regression_tests/phase1/3_vlans_over_active_backup_bond.xml
index a4ce2a6..60b2efd 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_active_backup_bond.xml
+++ b/recipes/regression_tests/phase1/3_vlans_over_active_backup_bond.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase1/3_vlans_over_bond.py b/recipes/regression_tests/phase1/3_vlans_over_bond.py
index 2db63cd..dde2359 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/3_vlans_over_bond.py
@@ -18,6 +18,18 @@ vlans = ["vlan10", "vlan20", "vlan30"]
offloads = ["gso", "gro", "tso"]
ipv = ctl.get_alias('ipv')
+mtu = ctl.get_alias('mtu')
+
+m1_bond = m1.get_interface("test_bond")
+m1_bond.set_mtu(mtu)
+m2_phy1 = m2.get_interface("eth1")
+m2_phy1.set_mtu(mtu)
+
+for vlan in vlans:
+ vlan_if1 = m1.get_interface(vlan)
+ vlan_if1.set_mtu(mtu)
+ vlan_if2 = m2.get_interface(vlan)
+ vlan_if2.set_mtu(mtu)
ctl.wait(15)
diff --git a/recipes/regression_tests/phase1/3_vlans_over_round_robin_bond.xml b/recipes/regression_tests/phase1/3_vlans_over_round_robin_bond.xml
index d8b2f6a..1aa0149 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_round_robin_bond.xml
+++ b/recipes/regression_tests/phase1/3_vlans_over_round_robin_bond.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase1/active_backup_bond.xml b/recipes/regression_tests/phase1/active_backup_bond.xml
index 9121af7..596dec5 100644
--- a/recipes/regression_tests/phase1/active_backup_bond.xml
+++ b/recipes/regression_tests/phase1/active_backup_bond.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase1/active_backup_double_bond.xml b/recipes/regression_tests/phase1/active_backup_double_bond.xml
index a3d89d9..dec15df 100644
--- a/recipes/regression_tests/phase1/active_backup_double_bond.xml
+++ b/recipes/regression_tests/phase1/active_backup_double_bond.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase1/bonding_test.py b/recipes/regression_tests/phase1/bonding_test.py
index d0a18f4..d2d6378 100644
--- a/recipes/regression_tests/phase1/bonding_test.py
+++ b/recipes/regression_tests/phase1/bonding_test.py
@@ -18,6 +18,12 @@ m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
offloads = ["tso", "gro", "gso"]
ipv = ctl.get_alias('ipv')
+mtu = ctl.get_alias('mtu')
+
+test_if1 = m1.get_interface("test_if")
+test_if1.set_mtu(mtu)
+test_if2 = m2.get_interface("test_if")
+test_if2.set_mtu(mtu)
ping_mod = ctl.get_module("IcmpPing",
options={
diff --git a/recipes/regression_tests/phase1/ping_flood.xml b/recipes/regression_tests/phase1/ping_flood.xml
index 3423a22..9409227 100644
--- a/recipes/regression_tests/phase1/ping_flood.xml
+++ b/recipes/regression_tests/phase1/ping_flood.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="machine1">
diff --git a/recipes/regression_tests/phase1/round_robin_bond.xml b/recipes/regression_tests/phase1/round_robin_bond.xml
index a33f2ca..516bf5b 100644
--- a/recipes/regression_tests/phase1/round_robin_bond.xml
+++ b/recipes/regression_tests/phase1/round_robin_bond.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase1/round_robin_double_bond.xml b/recipes/regression_tests/phase1/round_robin_double_bond.xml
index c3313c6..51a871e 100644
--- a/recipes/regression_tests/phase1/round_robin_double_bond.xml
+++ b/recipes/regression_tests/phase1/round_robin_double_bond.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase1/simple_ping.py b/recipes/regression_tests/phase1/simple_ping.py
index dc961d7..0882fed 100644
--- a/recipes/regression_tests/phase1/simple_ping.py
+++ b/recipes/regression_tests/phase1/simple_ping.py
@@ -25,6 +25,13 @@ ping_mod6 = ctl.get_module("Icmp6Ping",
ctl.wait(15)
ipv = ctl.get_alias('ipv')
+mtu = ctl.get_alias('mtu')
+
+test_if1 = hostA.get_interface("testiface")
+test_if1.set_mtu(mtu)
+test_if2 = hostB.get_interface("testiface")
+test_if2.set_mtu(mtu)
+
if ipv in [ 'ipv6', 'both' ]:
hostA.run(ping_mod6)
diff --git a/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml b/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml
index 12910fd..4d27752 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml
+++ b/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml b/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml
index aaab95e..d8115b5 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml
+++ b/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/3_vlans_over_team.py b/recipes/regression_tests/phase2/3_vlans_over_team.py
index 8be39b4..74b5a5a 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_team.py
+++ b/recipes/regression_tests/phase2/3_vlans_over_team.py
@@ -18,6 +18,19 @@ vlans = ["vlan10", "vlan20", "vlan30"]
offloads = ["gso", "gro", "tso"]
ipv = ctl.get_alias('ipv')
+mtu = ctl.get_alias('mtu')
+
+m1_team = m1.get_interface("test_if")
+m1_team.set_mtu(mtu)
+m2_phy1 = m2.get_interface("eth1")
+m2_phy1.set_mtu(mtu)
+
+for vlan in vlans:
+ vlan_if1 = m1.get_interface(vlan)
+ vlan_if1.set_mtu(mtu)
+ vlan_if2 = m2.get_interface(vlan)
+ vlan_if2.set_mtu(mtu)
+
ctl.wait(15)
diff --git a/recipes/regression_tests/phase2/active_backup_double_team.xml b/recipes/regression_tests/phase2/active_backup_double_team.xml
index f7b76c4..387937a 100644
--- a/recipes/regression_tests/phase2/active_backup_double_team.xml
+++ b/recipes/regression_tests/phase2/active_backup_double_team.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/active_backup_team.xml b/recipes/regression_tests/phase2/active_backup_team.xml
index ade4a4c..b798f5b 100644
--- a/recipes/regression_tests/phase2/active_backup_team.xml
+++ b/recipes/regression_tests/phase2/active_backup_team.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml b/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml
index cf2359d..b1cdbfe 100644
--- a/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml
+++ b/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml b/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml
index 830ee74..6905721 100644
--- a/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml
+++ b/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/round_robin_double_team.xml b/recipes/regression_tests/phase2/round_robin_double_team.xml
index 0642acc..8fcedca 100644
--- a/recipes/regression_tests/phase2/round_robin_double_team.xml
+++ b/recipes/regression_tests/phase2/round_robin_double_team.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/round_robin_team.xml b/recipes/regression_tests/phase2/round_robin_team.xml
index a3a1031..d9d277b 100644
--- a/recipes/regression_tests/phase2/round_robin_team.xml
+++ b/recipes/regression_tests/phase2/round_robin_team.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml b/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml
index fae0d9f..76513da 100644
--- a/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml
+++ b/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml b/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml
index 3c406da..e91558c 100644
--- a/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml
+++ b/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml
@@ -1,6 +1,7 @@
<lnstrecipe>
<define>
<alias name="ipv" value="both" />
+ <alias name="mtu" value="1500" />
</define>
<network>
<host id="testmachine1">
diff --git a/recipes/regression_tests/phase2/team_test.py b/recipes/regression_tests/phase2/team_test.py
index 776589a..88cbb8c 100644
--- a/recipes/regression_tests/phase2/team_test.py
+++ b/recipes/regression_tests/phase2/team_test.py
@@ -17,6 +17,13 @@ m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
offloads = ["tso", "gro", "gso"]
ipv = ctl.get_alias('ipv')
+mtu = ctl.get_alias('mtu')
+
+test_if1 = m1.get_interface("test_if")
+test_if1.set_mtu(mtu)
+test_if2 = m2.get_interface("test_if")
+test_if2.set_mtu(mtu)
+
ping_mod = ctl.get_module("IcmpPing",
options={
8 years, 11 months
[lnst] recipes: remove offload configuration for ping tests between different vlans
by jtluka
commit ddbf66615e23b3edc4fdb71aa212640e80263759
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Fri May 22 13:34:13 2015 +0200
recipes: remove offload configuration for ping tests between different vlans
For ICMP/ICMP6 ping tests between different vlans that are deemed to fail,
we don't need to iterate over offload turning on and off. This is also to
speed up the regression tests.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
recipes/regression_tests/phase1/3_vlans.py | 26 ++++++-----------
.../regression_tests/phase1/3_vlans_over_bond.py | 28 ++++++-------------
.../regression_tests/phase2/3_vlans_over_team.py | 29 ++++++-------------
3 files changed, 27 insertions(+), 56 deletions(-)
---
diff --git a/recipes/regression_tests/phase1/3_vlans.py b/recipes/regression_tests/phase1/3_vlans.py
index 3ead92f..a034870 100644
--- a/recipes/regression_tests/phase1/3_vlans.py
+++ b/recipes/regression_tests/phase1/3_vlans.py
@@ -96,10 +96,10 @@ for vlan1 in vlans:
"-L %s -6" % m2.get_ip(vlan1, 1)
})
- for offload in offloads:
+ if vlan1 == vlan2:
# These tests should pass
# Ping between same VLANs
- if vlan1 == vlan2:
+ for offload in offloads:
for state in ["off", "on"]:
# Offload setup
m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth1"),
@@ -128,19 +128,11 @@ for vlan1 in vlans:
m2.run(netperf_cli_udp6, timeout=70)
srv_proc.intr()
- # These tests should fail
- # Ping across different VLAN
- elif vlan1 != vlan2:
- for state in ["off", "on"]:
- # Offload setup
- m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth1"),
- offload, state))
- m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
- offload, state))
+ # These tests should fail
+ # Ping across different VLAN
+ else:
+ if ipv in [ 'ipv4', 'both' ]:
+ m1.run(ping_mod, expect="fail")
- if ipv in [ 'ipv4', 'both' ]:
- # Ping test
- m1.run(ping_mod, expect="fail")
-
- if ipv in [ 'ipv6', 'both' ]:
- m1.run(ping_mod6, expect="fail")
+ if ipv in [ 'ipv6', 'both' ]:
+ m1.run(ping_mod6, expect="fail")
diff --git a/recipes/regression_tests/phase1/3_vlans_over_bond.py b/recipes/regression_tests/phase1/3_vlans_over_bond.py
index f793ed6..2db63cd 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/3_vlans_over_bond.py
@@ -96,10 +96,10 @@ for vlan1 in vlans:
"-L %s -6" % m2.get_ip(vlan1, 1)
})
- for offload in offloads:
+ if vlan1 == vlan2:
# These tests should pass
# Ping between same VLANs
- if vlan1 == vlan2:
+ for offload in offloads:
for state in ["off", "on"]:
# Offload setup
m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth1"),
@@ -130,21 +130,11 @@ for vlan1 in vlans:
m2.run(netperf_cli_udp6, timeout=70)
srv_proc.intr()
- # These tests should fail
- # Ping across different VLAN
- elif vlan1 != vlan2:
- for state in ["off", "on"]:
- # Offload setup
- m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth1"),
- offload, state))
- m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth2"),
- offload, state))
- m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
- offload, state))
+ # These tests should fail
+ # Ping across different VLAN
+ else:
+ if ipv in [ 'ipv4', 'both' ]:
+ m1.run(ping_mod, expect="fail")
- if ipv in [ 'ipv4', 'both' ]:
- # Ping test
- m1.run(ping_mod, expect="fail")
-
- if ipv in [ 'ipv6', 'both' ]:
- m1.run(ping_mod6, expect="fail")
+ if ipv in [ 'ipv6', 'both' ]:
+ m1.run(ping_mod6, expect="fail")
diff --git a/recipes/regression_tests/phase2/3_vlans_over_team.py b/recipes/regression_tests/phase2/3_vlans_over_team.py
index 96d1be2..8be39b4 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_team.py
+++ b/recipes/regression_tests/phase2/3_vlans_over_team.py
@@ -95,10 +95,10 @@ for vlan1 in vlans:
"-L %s -6" % m2.get_ip(vlan1, 1)
})
- for offload in offloads:
+ if vlan1 == vlan2:
# These tests should pass
# Ping between same VLANs
- if vlan1 == vlan2:
+ for offload in offloads:
for state in ["off", "on"]:
# Offload setup
m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth1"),
@@ -131,22 +131,11 @@ for vlan1 in vlans:
m2.run(netperf_cli_udp6, timeout=70)
srv_proc.intr()
- # These tests should fail
- # Ping across different VLAN
- elif vlan1 != vlan2:
- for state in ["off", "on"]:
- # Offload setup
- m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth1"),
- offload, state))
- m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth2"),
- offload, state))
- m1.run("ethtool -K %s %s %s" % (m1.get_devname("eth3"),
- offload, state))
- m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
- offload, state))
- # Ping test
- if ipv in [ 'ipv4', 'both' ]:
- m1.run(ping_mod, expect="fail")
+ # These tests should fail
+ # Ping across different VLAN
+ else:
+ if ipv in [ 'ipv4', 'both' ]:
+ m1.run(ping_mod, expect="fail")
- if ipv in [ 'ipv6', 'both' ]:
- m1.run(ping_mod6, expect="fail")
+ if ipv in [ 'ipv6', 'both' ]:
+ m1.run(ping_mod6, expect="fail")
8 years, 11 months
[PATCH] Fix KeyError exception when netem tag is not present in recipe
by Jiri Prochazka
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Slave/NetConfigDevice.py | 2 +-
lnst/Slave/NmConfigDevice.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lnst/Slave/NetConfigDevice.py b/lnst/Slave/NetConfigDevice.py
index 6569410..eb9013d 100644
--- a/lnst/Slave/NetConfigDevice.py
+++ b/lnst/Slave/NetConfigDevice.py
@@ -86,7 +86,7 @@ class NetConfigDeviceEth(NetConfigDeviceGeneric):
config = self._dev_config
exec_cmd("ip addr flush %s" % config["name"])
exec_cmd("ethtool -A %s rx off tx off" % config["name"], die_on_err=False, log_outputs=False)
- if config["netem"] is not None:
+ if "netem" in config:
cmd = "tc qdisc add dev %s root netem %s" % (config["name"], parse_netem(config["netem"]))
exec_cmd(cmd)
config["netem_cmd"] = cmd
diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py
index 8e2f1dd..cc06f90 100644
--- a/lnst/Slave/NmConfigDevice.py
+++ b/lnst/Slave/NmConfigDevice.py
@@ -371,7 +371,7 @@ class NmConfigDeviceEth(NmConfigDeviceGeneric):
self._connection = connection
self._nm_add_connection()
- if config["netem"] is not None:
+ if "netem" in config:
cmd = "tc qdisc add dev %s root netem %s" % (config["name"], parse_netem(config["netem"]))
exec_cmd(cmd)
config["netem_cmd"] = cmd
--
2.1.0
8 years, 11 months
[lnst] Add example recipes from LNST wiki page about NetEm
by jtluka
commit 66bea120d9805f6017648022668c66fe19ee75e4
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Fri May 22 14:14:32 2015 +0200
Add example recipes from LNST wiki page about NetEm
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>
recipes/examples/netem/corruption.xml | 39 +++++++++++++++++++++++++
recipes/examples/netem/delay.xml | 43 ++++++++++++++++++++++++++++
recipes/examples/netem/duplication.xml | 39 +++++++++++++++++++++++++
recipes/examples/netem/loss.xml | 39 +++++++++++++++++++++++++
recipes/examples/netem/netem_test.py | 41 ++++++++++++++++++++++++++
recipes/examples/netem/reordering.xml | 49 ++++++++++++++++++++++++++++++++
6 files changed, 250 insertions(+), 0 deletions(-)
---
diff --git a/recipes/examples/netem/corruption.xml b/recipes/examples/netem/corruption.xml
new file mode 100644
index 0000000..7d2b645
--- /dev/null
+++ b/recipes/examples/netem/corruption.xml
@@ -0,0 +1,39 @@
+<lnstrecipe>
+ <network>
+ <host id="machine1">
+ <interfaces>
+ <eth id="testiface" label="testnet">
+ <netem>
+ <corrupt>
+ <options>
+ <option name="percent" value="10%" />
+ <option name="correlation" value="50%" />
+ </options>
+ </corrupt>
+ </netem>
+ <addresses>
+ <address>192.168.101.10/24</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="machine2">
+ <interfaces>
+ <eth id="testiface" label="testnet">
+ <netem>
+ <corrupt>
+ <options>
+ <option name="percent" value="10%" />
+ <option name="correlation" value="50%" />
+ </options>
+ </corrupt>
+ </netem>
+ <addresses>
+ <address>192.168.101.11/24</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ </network>
+ <task python="netem_test.py"/>
+</lnstrecipe>
diff --git a/recipes/examples/netem/delay.xml b/recipes/examples/netem/delay.xml
new file mode 100644
index 0000000..aad5cb9
--- /dev/null
+++ b/recipes/examples/netem/delay.xml
@@ -0,0 +1,43 @@
+<lnstrecipe>
+ <network>
+ <host id="machine1">
+ <interfaces>
+ <eth id="testiface" label="testnet">
+ <netem>
+ <delay>
+ <options>
+ <option name="time" value="10ms" />
+ <option name="jitter" value="1ms" />
+ <option name="correlation" value="50%" />
+ <option name="distribution" value="normal" />
+ </options>
+ </delay>
+ </netem>
+ <addresses>
+ <address>192.168.101.10/24</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="machine2">
+ <interfaces>
+ <eth id="testiface" label="testnet">
+ <netem>
+ <delay>
+ <options>
+ <option name="time" value="10ms" />
+ <option name="jitter" value="1ms" />
+ <option name="correlation" value="50%" />
+ <option name="distribution" value="normal" />
+ </options>
+ </delay>
+ </netem>
+ <addresses>
+ <address>192.168.101.11/24</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ </network>
+ <task python="netem_test.py"/>
+</lnstrecipe>
diff --git a/recipes/examples/netem/duplication.xml b/recipes/examples/netem/duplication.xml
new file mode 100644
index 0000000..9b43183
--- /dev/null
+++ b/recipes/examples/netem/duplication.xml
@@ -0,0 +1,39 @@
+<lnstrecipe>
+ <network>
+ <host id="machine1">
+ <interfaces>
+ <eth id="testiface" label="testnet">
+ <netem>
+ <duplication>
+ <options>
+ <option name="percent" value="10%" />
+ <option name="correlation" value="50%" />
+ </options>
+ </duplication>
+ </netem>
+ <addresses>
+ <address>192.168.101.10/24</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="machine2">
+ <interfaces>
+ <eth id="testiface" label="testnet">
+ <netem>
+ <duplication>
+ <options>
+ <option name="percent" value="10%" />
+ <option name="correlation" value="50%" />
+ </options>
+ </duplication>
+ </netem>
+ <addresses>
+ <address>192.168.101.11/24</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ </network>
+ <task python="netem_test.py"/>
+</lnstrecipe>
diff --git a/recipes/examples/netem/loss.xml b/recipes/examples/netem/loss.xml
new file mode 100644
index 0000000..2ec6cb9
--- /dev/null
+++ b/recipes/examples/netem/loss.xml
@@ -0,0 +1,39 @@
+<lnstrecipe>
+ <network>
+ <host id="machine1">
+ <interfaces>
+ <eth id="testiface" label="testnet">
+ <netem>
+ <loss>
+ <options>
+ <option name="percent" value="10%" />
+ <option name="correlation" value="50%" />
+ </options>
+ </loss>
+ </netem>
+ <addresses>
+ <address>192.168.101.10/24</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="machine2">
+ <interfaces>
+ <eth id="testiface" label="testnet">
+ <netem>
+ <loss>
+ <options>
+ <option name="percent" value="10%" />
+ <option name="correlation" value="50%" />
+ </options>
+ </loss>
+ </netem>
+ <addresses>
+ <address>192.168.101.11/24</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ </network>
+ <task python="netem_test.py"/>
+</lnstrecipe>
diff --git a/recipes/examples/netem/netem_test.py b/recipes/examples/netem/netem_test.py
new file mode 100644
index 0000000..2405f11
--- /dev/null
+++ b/recipes/examples/netem/netem_test.py
@@ -0,0 +1,41 @@
+from lnst.Controller.Task import ctl
+
+hostA = ctl.get_host("machine1")
+hostB = ctl.get_host("machine2")
+
+hostA.sync_resources(modules=["IcmpPing", "Netperf"])
+hostB.sync_resources(modules=["IcmpPing", "Netperf"])
+
+ping_mod = ctl.get_module("IcmpPing",
+ options={
+ "addr": hostB.get_ip("testiface", 0),
+ "count": 1000,
+ "interval": 0.1,
+ "iface" : hostA.get_devname("testiface")})
+
+netserver = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : hostA.get_ip("testiface")})
+
+netperf_tcp = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" : hostA.get_ip("testiface"),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" : "-L %s" % hostB.get_ip("testiface")})
+
+netperf_udp= ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" : hostA.get_ip("testiface"),
+ "duration" : 60,
+ "testname" : "UDP_STREAM"})
+
+hostA.run(ping_mod, timeout=500)
+server_proc = hostA.run(netserver, bg=True)
+ctl.wait(2)
+hostB.run(netperf_tcp, timeout=100)
+hostB.run(netperf_udp, timeout=100)
+server_proc.intr()
diff --git a/recipes/examples/netem/reordering.xml b/recipes/examples/netem/reordering.xml
new file mode 100644
index 0000000..5f96893
--- /dev/null
+++ b/recipes/examples/netem/reordering.xml
@@ -0,0 +1,49 @@
+<lnstrecipe>
+ <network>
+ <host id="machine1">
+ <interfaces>
+ <eth id="testiface" label="testnet">
+ <netem>
+ <delay>
+ <options>
+ <option name="time" value="10ms" />
+ </options>
+ </delay>
+ <reordering>
+ <options>
+ <option name="percent" value="10%" />
+ <option name="correlation" value="50%" />
+ </options>
+ </reordering>
+ </netem>
+ <addresses>
+ <address>192.168.101.10/24</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="machine2">
+ <interfaces>
+ <eth id="testiface" label="testnet">
+ <netem>
+ <delay>
+ <options>
+ <option name="time" value="10ms" />
+ </options>
+ </delay>
+ <reordering>
+ <options>
+ <option name="percent" value="10%" />
+ <option name="correlation" value="50%" />
+ </options>
+ </reordering>
+ </netem>
+ <addresses>
+ <address>192.168.101.11/24</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ </network>
+ <task python="netem_test.py"/>
+</lnstrecipe>
8 years, 11 months
[lnst] Add netem variant to smoke tests
by jtluka
commit 12f26067aea0694cd8fca47b7a56154d993a53f1
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Fri May 22 14:14:15 2015 +0200
Add netem variant to smoke tests
In this variant all five (delay, loss, corrupt, duplication, reordering)
netem params are used
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>
recipes/smoke/lib/conf-netem.xml | 42 ++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
---
diff --git a/recipes/smoke/lib/conf-netem.xml b/recipes/smoke/lib/conf-netem.xml
new file mode 100644
index 0000000..6163ab4
--- /dev/null
+++ b/recipes/smoke/lib/conf-netem.xml
@@ -0,0 +1,42 @@
+<interfaces>
+ <eth id="testiface" label="net">
+ <netem>
+ <delay>
+ <options>
+ <option name="time" value="10ms" />
+ <option name="jitter" value="1ms" />
+ <option name="correlation" value="50%" />
+ <option name="distribution" value="normal" />
+ </options>
+ </delay>
+ <loss>
+ <options>
+ <option name="percent" value="1%" />
+ <option name="correlation" value="15%" />
+ </options>
+ </loss>
+ <corrupt>
+ <options>
+ <option name="percent" value="1%" />
+ <option name="correlation" value="25%" />
+ </options>
+ </corrupt>
+ <duplication>
+ <options>
+ <option name="percent" value="1%" />
+ <option name="correlation" value="25%" />
+ </options>
+ </duplication>
+ <reordering>
+ <options>
+ <option name="percent" value="1%" />
+ <option name="correlation" value="25%" />
+ <option name="gap_distance" value="5" />
+ </options>
+ </reordering>
+ </netem>
+ <addresses>
+ <address value="{$testip}"/>
+ </addresses>
+ </eth>
+</interfaces>
8 years, 11 months
[lnst] Add netem to smoke tests variables config
by jtluka
commit fd67c36882b879ed2c095f055eaa447654f96fce
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Fri May 22 14:14:01 2015 +0200
Add netem to smoke tests variables config
netem-vlan and vlan-netem ICMP test will fail, this needs to be specified in
variables config
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>
recipes/smoke/lib/variables.conf | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/recipes/smoke/lib/variables.conf b/recipes/smoke/lib/variables.conf
index 0c9b066..b4dd344 100644
--- a/recipes/smoke/lib/variables.conf
+++ b/recipes/smoke/lib/variables.conf
@@ -12,3 +12,7 @@ icmp_result=fail
icmp_result=fail
[vlan-eth]
icmp_result=fail
+[vlan-netem]
+icmp_result=fail
+[netem-vlan]
+icmp_result=fail
8 years, 11 months
[lnst] Add Slave NetEm param configuration and deconfiguration support
by jtluka
commit 273665226d6aeb002ac03233c4ce3aecf3f86c7e
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Fri May 22 14:13:45 2015 +0200
Add Slave NetEm param configuration and deconfiguration support
This patch provides support for compiling and tc command with NetEm
params for both configuration and deconfiguration. Supported are
both NetworkManager and non-NetworkManager variants.
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/Slave/NetConfigDevice.py | 11 ++++++++++-
lnst/Slave/NmConfigDevice.py | 9 ++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/lnst/Slave/NetConfigDevice.py b/lnst/Slave/NetConfigDevice.py
index 4ac2899..6569410 100644
--- a/lnst/Slave/NetConfigDevice.py
+++ b/lnst/Slave/NetConfigDevice.py
@@ -15,7 +15,7 @@ import logging
import re
import sys
from lnst.Common.ExecCmd import exec_cmd
-from lnst.Slave.NetConfigCommon import get_slaves, get_option, get_slave_option
+from lnst.Slave.NetConfigCommon import get_slaves, get_option, get_slave_option, parse_netem
from lnst.Common.Utils import kmod_in_use, bool_it
from lnst.Slave.NmConfigDevice import type_class_mapping as nm_type_class_mapping
from lnst.Slave.NmConfigDevice import is_nm_managed
@@ -86,6 +86,15 @@ class NetConfigDeviceEth(NetConfigDeviceGeneric):
config = self._dev_config
exec_cmd("ip addr flush %s" % config["name"])
exec_cmd("ethtool -A %s rx off tx off" % config["name"], die_on_err=False, log_outputs=False)
+ if config["netem"] is not None:
+ cmd = "tc qdisc add dev %s root netem %s" % (config["name"], parse_netem(config["netem"]))
+ exec_cmd(cmd)
+ config["netem_cmd"] = cmd
+
+ def deconfigure(self):
+ config = self._dev_config
+ if "netem_cmd" in config:
+ exec_cmd(config["netem_cmd"].replace("add", "del"))
class NetConfigDeviceLoopback(NetConfigDeviceGeneric):
def configure(self):
diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py
index c3824cb..8e2f1dd 100644
--- a/lnst/Slave/NmConfigDevice.py
+++ b/lnst/Slave/NmConfigDevice.py
@@ -19,7 +19,7 @@ import uuid
import socket, struct
import time
from lnst.Common.ExecCmd import exec_cmd
-from lnst.Slave.NetConfigCommon import get_slaves, get_option, get_slave_option
+from lnst.Slave.NetConfigCommon import get_slaves, get_option, get_slave_option, parse_netem
from lnst.Common.Utils import kmod_in_use, bool_it
from lnst.Common.NetUtils import scan_netdevs
from lnst.Common.Utils import check_process_running
@@ -371,8 +371,15 @@ class NmConfigDeviceEth(NmConfigDeviceGeneric):
self._connection = connection
self._nm_add_connection()
+ if config["netem"] is not None:
+ cmd = "tc qdisc add dev %s root netem %s" % (config["name"], parse_netem(config["netem"]))
+ exec_cmd(cmd)
+ config["netem_cmd"] = cmd
def deconfigure(self):
+ config = self._dev_config
+ if "netem_cmd" in config:
+ exec_cmd(config["netem_cmd"].replace("add", "del"))
if self._con_obj_path != None:
self._nm_rm_connection()
8 years, 11 months