[lnst] Add Slave methods for NetEm value parsing from interface config
by jtluka
commit 12c045aa7f8c3017548d5795035aaa89c40a6a08
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Fri May 22 14:13:24 2015 +0200
Add Slave methods for NetEm value parsing from interface config
This patch provides Slave methods for parsing values from NetEm
tag in config dict.
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/NetConfigCommon.py | 77 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 77 insertions(+), 0 deletions(-)
---
diff --git a/lnst/Slave/NetConfigCommon.py b/lnst/Slave/NetConfigCommon.py
index c60419b..ffcb0b4 100644
--- a/lnst/Slave/NetConfigCommon.py
+++ b/lnst/Slave/NetConfigCommon.py
@@ -35,3 +35,80 @@ def get_slave_option(netdev, slave_id, opt_name):
if option == opt_name:
return value
return None
+
+def get_netem_option(netem_tag, netem_name, opt_name):
+ try:
+ options = netem_tag[netem_name]
+ except KeyError:
+ return None
+ for opt in options:
+ if opt["name"] == opt_name:
+ return opt["value"]
+
+def parse_delay(config):
+ time = get_netem_option(config, "delay", "time")
+ jitter= get_netem_option(config, "delay", "jitter")
+ correlation = get_netem_option(config, "delay", "correlation")
+ distribution = get_netem_option(config, "delay", "distribution")
+ rv = "delay %s " % time
+ if jitter is not None:
+ rv = rv + "%s " % jitter
+ if correlation is not None:
+ rv = rv + "%s " % correlation
+ if distribution is not None:
+ rv = rv + "distribution %s " % distribution
+ return rv
+
+def parse_loss(config):
+ percent = get_netem_option(config, "loss", "percent")
+ correlation = get_netem_option(config, "loss", "correlation")
+ rv = "loss %s " % percent
+ if correlation is not None:
+ rv = rv + "%s " % correlation
+ return rv
+
+def parse_corrupt(config):
+ percent = get_netem_option(config, "corrupt", "percent")
+ correlation = get_netem_option(config, "corrupt", "correlation")
+ rv = "corrupt %s " % percent
+ if correlation is not None:
+ rv = rv + "%s " % correlation
+ return rv
+
+def parse_duplication(config):
+ percent = get_netem_option(config, "duplication", "percent")
+ correlation = get_netem_option(config, "duplication", "correlation")
+ rv = "duplicate %s " % percent
+ if correlation is not None:
+ rv = rv + "%s " % correlation
+ return rv
+
+def parse_reordering(config):
+ percent = get_netem_option(config, "reordering", "percent")
+ correlation = get_netem_option(config, "reordering", "correlation")
+ gap_distance = get_netem_option(config, "reordering", "gap_distance")
+ rv = "reorder %s " % percent
+ if correlation is not None:
+ rv = rv + "%s " % correlation
+ if gap_distance is not None:
+ rv = rv + "gap %s " % gap_distance
+ return rv
+
+def parse_netem(config):
+ rv = ""
+ # delay parsing
+ if "delay" in config:
+ rv = rv + parse_delay(config)
+ # loss parsing
+ if "loss" in config:
+ rv = rv + parse_loss(config)
+ # corrupt
+ if "corrupt" in config:
+ rv = rv + parse_corrupt(config)
+ # duplication
+ if "duplication" in config:
+ rv = rv + parse_duplication(config)
+ # reordering
+ if "reordering" in config:
+ rv = rv + parse_reordering(config)
+ return rv
8 years, 10 months
[lnst] Add Controller support for NetEm.
by jtluka
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())
8 years, 10 months
[lnst] Add NetEm XML recipe parsing support
by jtluka
commit 7b815c609bf7245a88cb16505fc672cfcfe1d8aa
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Fri May 22 14:12:33 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, 10 months
[lnst] Add NetEm support to schema-recipe.rng
by jtluka
commit 91bb13994dd1f7a954a5749dae8d764e85c4b9bf
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Fri May 22 14:12:09 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, 10 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, 10 months
[PATCH v2] recipes: add mtu configuration to phase1 and phase2 tests
by Jan Tluka
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 +
recipes/regression_tests/phase1/3_vlans_over_bond.py | 12 ++++++++++++
.../phase1/3_vlans_over_round_robin_bond.xml | 1 +
recipes/regression_tests/phase1/active_backup_bond.xml | 1 +
.../regression_tests/phase1/active_backup_double_bond.xml | 1 +
recipes/regression_tests/phase1/bonding_test.py | 6 ++++++
recipes/regression_tests/phase1/ping_flood.xml | 1 +
recipes/regression_tests/phase1/round_robin_bond.xml | 1 +
recipes/regression_tests/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 +
recipes/regression_tests/phase2/3_vlans_over_team.py | 13 +++++++++++++
.../regression_tests/phase2/active_backup_double_team.xml | 1 +
recipes/regression_tests/phase2/active_backup_team.xml | 1 +
.../phase2/active_backup_team_vs_active_backup_bond.xml | 1 +
.../phase2/active_backup_team_vs_round_robin_bond.xml | 1 +
recipes/regression_tests/phase2/round_robin_double_team.xml | 1 +
recipes/regression_tests/phase2/round_robin_team.xml | 1 +
.../phase2/round_robin_team_vs_active_backup_bond.xml | 1 +
.../phase2/round_robin_team_vs_round_robin_bond.xml | 1 +
recipes/regression_tests/phase2/team_test.py | 7 +++++++
24 files changed, 75 insertions(+)
diff --git a/recipes/regression_tests/phase1/3_vlans.py b/recipes/regression_tests/phase1/3_vlans.py
index 3ead92f..a52a829 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 f793ed6..7fcd80a 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 96d1be2..91160f7 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={
--
1.9.3
8 years, 10 months
[PATCH] recipes: add mtu configuration to phase1 and phase2 tests
by Jan Tluka
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.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
...ove-code-duplication-in-phase1-and-phase2.patch | 568 +++++++++++++++++++++
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 +
25 files changed, 643 insertions(+)
create mode 100644 0002-recipes-remove-code-duplication-in-phase1-and-phase2.patch
diff --git a/0002-recipes-remove-code-duplication-in-phase1-and-phase2.patch b/0002-recipes-remove-code-duplication-in-phase1-and-phase2.patch
new file mode 100644
index 0000000..18521bf
--- /dev/null
+++ b/0002-recipes-remove-code-duplication-in-phase1-and-phase2.patch
@@ -0,0 +1,568 @@
+From d9512210ad9491aca5218def6c1ad440f6b047cc Mon Sep 17 00:00:00 2001
+From: Jan Tluka <jtluka(a)redhat.com>
+Date: Wed, 20 May 2015 10:39:16 +0200
+Subject: [PATCH] recipes: remove code duplication in phase1 and phase2 tests
+
+Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
+---
+ recipes/regression_tests/phase1/3_vlans.py | 31 ++++----------------
+ .../regression_tests/phase1/3_vlans_over_bond.py | 31 ++++----------------
+ recipes/regression_tests/phase1/bonding_test.py | 18 ++----------
+ recipes/regression_tests/phase1/simple_ping.py | 10 +++----
+ .../phase1/virtual_bridge_2_vlans_over_bond.py | 26 ++---------------
+ .../phase1/virtual_bridge_vlan_in_guest.py | 19 ++----------
+ .../phase1/virtual_bridge_vlan_in_host.py | 19 ++----------
+ .../regression_tests/phase2/3_vlans_over_team.py | 30 ++++---------------
+ recipes/regression_tests/phase2/team_test.py | 34 +++-------------------
+ ...l_ovs_bridge_2_vlans_over_active_backup_bond.py | 26 ++---------------
+ .../phase2/virtual_ovs_bridge_vlan_in_guest.py | 19 ++----------
+ .../phase2/virtual_ovs_bridge_vlan_in_host.py | 19 ++----------
+ 12 files changed, 42 insertions(+), 240 deletions(-)
+
+diff --git a/recipes/regression_tests/phase1/3_vlans.py b/recipes/regression_tests/phase1/3_vlans.py
+index 8aa6a2b..3ead92f 100644
+--- a/recipes/regression_tests/phase1/3_vlans.py
++++ b/recipes/regression_tests/phase1/3_vlans.py
+@@ -106,7 +106,7 @@ for vlan1 in vlans:
+ offload, state))
+ m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
+ offload, state))
+- if ipv == 'ipv4':
++ if ipv in [ 'ipv4', 'both' ]:
+ # Ping test
+ m1.run(ping_mod)
+
+@@ -116,29 +116,12 @@ for vlan1 in vlans:
+ m2.run(netperf_cli_tcp, timeout=70)
+ m2.run(netperf_cli_udp, timeout=70)
+ srv_proc.intr()
+- elif ipv == 'ipv6':
+- # Ping test
+- m1.run(ping_mod6)
+
+- # Netperf test (both TCP and UDP)
+- srv_proc = m1.run(netperf_srv6, bg=True)
+- ctl.wait(2)
+- m2.run(netperf_cli_tcp6, timeout=70)
+- m2.run(netperf_cli_udp6, timeout=70)
+- srv_proc.intr()
+- else:
+- # Ping tests
+- m1.run(ping_mod)
++ if ipv in [ 'ipv6', 'both' ]:
++ # Ping test
+ m1.run(ping_mod6)
+
+ # Netperf test (both TCP and UDP)
+- srv_proc = m1.run(netperf_srv, bg=True)
+- ctl.wait(2)
+- m2.run(netperf_cli_tcp, timeout=70)
+- m2.run(netperf_cli_udp, timeout=70)
+- srv_proc.intr()
+-
+- # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=70)
+@@ -155,11 +138,9 @@ for vlan1 in vlans:
+ m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
+ offload, state))
+
+- if ipv == 'ipv4':
++ if ipv in [ 'ipv4', 'both' ]:
+ # Ping test
+ m1.run(ping_mod, expect="fail")
+- elif ipv == 'ipv6':
+- m1.run(ping_mod6, expect="fail")
+- else:
+- m1.run(ping_mod, 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 4cc0f41..f793ed6 100644
+--- a/recipes/regression_tests/phase1/3_vlans_over_bond.py
++++ b/recipes/regression_tests/phase1/3_vlans_over_bond.py
+@@ -108,7 +108,7 @@ for vlan1 in vlans:
+ offload, state))
+ m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
+ offload, state))
+- if ipv == 'ipv4':
++ if ipv in [ 'ipv4', 'both' ]:
+ # Ping test
+ m1.run(ping_mod)
+
+@@ -118,29 +118,12 @@ for vlan1 in vlans:
+ m2.run(netperf_cli_tcp, timeout=70)
+ m2.run(netperf_cli_udp, timeout=70)
+ srv_proc.intr()
+- elif ipv == 'ipv6':
+- # Ping test
+- m1.run(ping_mod6)
+
+- # Netperf test (both TCP and UDP)
+- srv_proc = m1.run(netperf_srv6, bg=True)
+- ctl.wait(2)
+- m2.run(netperf_cli_tcp6, timeout=70)
+- m2.run(netperf_cli_udp6, timeout=70)
+- srv_proc.intr()
+- else:
+- # Ping tests
+- m1.run(ping_mod)
++ if ipv in [ 'ipv6', 'both' ]:
++ # Ping test
+ m1.run(ping_mod6)
+
+ # Netperf test (both TCP and UDP)
+- srv_proc = m1.run(netperf_srv, bg=True)
+- ctl.wait(2)
+- m2.run(netperf_cli_tcp, timeout=70)
+- m2.run(netperf_cli_udp, timeout=70)
+- srv_proc.intr()
+-
+- # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=70)
+@@ -159,11 +142,9 @@ for vlan1 in vlans:
+ m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
+ offload, state))
+
+- if ipv == 'ipv4':
++ if ipv in [ 'ipv4', 'both' ]:
+ # Ping test
+ m1.run(ping_mod, expect="fail")
+- elif ipv == 'ipv6':
+- m1.run(ping_mod6, expect="fail")
+- else:
+- m1.run(ping_mod, expect="fail")
++
++ if ipv in [ 'ipv6', 'both' ]:
+ m1.run(ping_mod6, expect="fail")
+diff --git a/recipes/regression_tests/phase1/bonding_test.py b/recipes/regression_tests/phase1/bonding_test.py
+index 885c541..d0a18f4 100644
+--- a/recipes/regression_tests/phase1/bonding_test.py
++++ b/recipes/regression_tests/phase1/bonding_test.py
+@@ -95,28 +95,16 @@ for offload in offloads:
+ state))
+ m2.run("ethtool -K %s %s %s" % (m2.get_devname("test_if"), offload,
+ state))
+- if ipv == 'ipv4':
++ if ipv in [ 'ipv4', 'both' ]:
+ m1.run(ping_mod)
+ server_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=70)
+ m2.run(netperf_cli_udp, timeout=70)
+ server_proc.intr()
+- elif ipv == 'ipv6':
+- m1.run(ping_mod6)
+- server_proc = m1.run(netperf_srv6, bg=True)
+- ctl.wait(2)
+- m2.run(netperf_cli_tcp6, timeout=70)
+- m2.run(netperf_cli_udp6, timeout=70)
+- server_proc.intr()
+- else:
+- m1.run(ping_mod)
++
++ if ipv in [ 'ipv6', 'both' ]:
+ m1.run(ping_mod6)
+- server_proc = m1.run(netperf_srv, bg=True)
+- ctl.wait(2)
+- m2.run(netperf_cli_tcp, timeout=70)
+- m2.run(netperf_cli_udp, timeout=70)
+- server_proc.intr()
+ server_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=70)
+diff --git a/recipes/regression_tests/phase1/simple_ping.py b/recipes/regression_tests/phase1/simple_ping.py
+index d2bcdb6..dc961d7 100644
+--- a/recipes/regression_tests/phase1/simple_ping.py
++++ b/recipes/regression_tests/phase1/simple_ping.py
+@@ -24,12 +24,10 @@ ping_mod6 = ctl.get_module("Icmp6Ping",
+
+ ctl.wait(15)
+
+-if ctl.get_alias('ipv') == 'ipv6':
+- hostA.run(ping_mod6)
++ipv = ctl.get_alias('ipv')
+
+-elif ctl.get_alias('ipv') == 'ipv4':
+- hostA.run(ping_mod)
++if ipv in [ 'ipv6', 'both' ]:
++ hostA.run(ping_mod6)
+
+-else:
++if ipv in [ 'ipv4', 'both' ]:
+ hostA.run(ping_mod)
+- hostA.run(ping_mod6)
+diff --git a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
+index 907b3d5..141f4f0 100644
+--- a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
++++ b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
+@@ -164,7 +164,7 @@ for offload in offloads:
+ offload, state))
+ g4.run("ethtool -K %s %s %s" % (g4.get_devname("guestnic"),
+ offload, state))
+- if ipv == 'ipv4':
++ if ipv in [ 'ipv4', 'both' ]:
+ g1.run(ping_mod)
+ g4.run(ping_mod2)
+ g1.run(ping_mod_bad, expect="fail")
+@@ -175,30 +175,8 @@ for offload in offloads:
+ g3.run(netperf_cli_tcp, timeout=70)
+ g3.run(netperf_cli_udp, timeout=70)
+ server_proc.intr()
+- elif ipv == 'ipv6':
+- g1.run(ping_mod6)
+- g4.run(ping_mod62)
+- g1.run(ping_mod6_bad, expect="fail")
+- g3.run(ping_mod6_bad2, expect="fail")
+
+- server_proc = g1.run(netperf_srv6, bg=True)
+- ctl.wait(2)
+- g3.run(netperf_cli_tcp6, timeout=70)
+- g3.run(netperf_cli_udp6, timeout=70)
+- server_proc.intr()
+- else:
+- # IPv4
+- g1.run(ping_mod)
+- g4.run(ping_mod2)
+- g1.run(ping_mod_bad, expect="fail")
+- g3.run(ping_mod_bad2, expect="fail")
+-
+- server_proc = g1.run(netperf_srv, bg=True)
+- ctl.wait(2)
+- g3.run(netperf_cli_tcp, timeout=70)
+- g3.run(netperf_cli_udp, timeout=70)
+- server_proc.intr()
+- # IPv6
++ if ipv in [ 'ipv6', 'both' ]:
+ g1.run(ping_mod6)
+ g4.run(ping_mod62)
+ g1.run(ping_mod6_bad, expect="fail")
+diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
+index 6f93c14..1a2f911 100644
+--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
++++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
+@@ -102,7 +102,7 @@ for offload in offloads:
+ h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic"),
+ offload, state))
+
+- if ipv == 'ipv4':
++ if ipv in [ 'ipv4', 'both' ]:
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+@@ -110,25 +110,12 @@ for offload in offloads:
+ h2.run(netperf_cli_udp, timeout=70)
+
+ server_proc.intr()
+- elif ipv == 'ipv6':
+- g1.run(ping_mod6)
+- server_proc = g1.run(netperf_srv6, bg=True)
+- ctl.wait(2)
+- h2.run(netperf_cli_tcp6, timeout=70)
+- h2.run(netperf_cli_udp6, timeout=70)
+-
+- server_proc.intr()
+- else:
+- g1.run(ping_mod)
+- server_proc = g1.run(netperf_srv, bg=True)
+- ctl.wait(2)
+- h2.run(netperf_cli_tcp, timeout=70)
+- h2.run(netperf_cli_udp, timeout=70)
+- server_proc.intr()
+
++ if ipv in [ 'ipv6', 'both' ]:
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=70)
+ h2.run(netperf_cli_udp6, timeout=70)
++
+ server_proc.intr()
+diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
+index 0525ea5..0188686 100644
+--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
++++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
+@@ -101,23 +101,7 @@ for offload in offloads:
+ offload, state))
+ h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic"),
+ offload, state))
+- if ipv == 'ipv4':
+- g1.run(ping_mod)
+- server_proc = g1.run(netperf_srv, bg=True)
+- ctl.wait(2)
+- h2.run(netperf_cli_tcp, timeout=70)
+- h2.run(netperf_cli_udp, timeout=70)
+- server_proc.intr()
+-
+- elif ipv == 'ipv6':
+- g1.run(ping_mod6)
+- server_proc = g1.run(netperf_srv6, bg=True)
+- ctl.wait(2)
+- h2.run(netperf_cli_tcp6, timeout=70)
+- h2.run(netperf_cli_udp6, timeout=70)
+- server_proc.intr()
+-
+- else:
++ if ipv in [ 'ipv4', 'both' ]:
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+@@ -125,6 +109,7 @@ for offload in offloads:
+ h2.run(netperf_cli_udp, timeout=70)
+ server_proc.intr()
+
++ if ipv in [ 'ipv6', 'both' ]:
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+diff --git a/recipes/regression_tests/phase2/3_vlans_over_team.py b/recipes/regression_tests/phase2/3_vlans_over_team.py
+index dab21ac..96d1be2 100644
+--- a/recipes/regression_tests/phase2/3_vlans_over_team.py
++++ b/recipes/regression_tests/phase2/3_vlans_over_team.py
+@@ -110,7 +110,7 @@ for vlan1 in vlans:
+ m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
+ offload, state))
+
+- if ipv == 'ipv4':
++ if ipv in [ 'ipv4', 'both' ]:
+ # Ping test
+ m1.run(ping_mod)
+
+@@ -120,25 +120,8 @@ for vlan1 in vlans:
+ m2.run(netperf_cli_tcp, timeout=70)
+ m2.run(netperf_cli_udp, timeout=70)
+ srv_proc.intr()
+- elif ipv == 'ipv6':
+- m1.run(ping_mod6)
+-
+- # Netperf test (both TCP and UDP)
+- srv_proc = m1.run(netperf_srv6, bg=True)
+- ctl.wait(2)
+- m2.run(netperf_cli_tcp6, timeout=70)
+- m2.run(netperf_cli_udp6, timeout=70)
+- srv_proc.intr()
+- else:
+- m1.run(ping_mod)
+-
+- # Netperf test (both TCP and UDP)
+- srv_proc = m1.run(netperf_srv, bg=True)
+- ctl.wait(2)
+- m2.run(netperf_cli_tcp, timeout=70)
+- m2.run(netperf_cli_udp, timeout=70)
+- srv_proc.intr()
+
++ if ipv in [ 'ipv6', 'both' ]:
+ m1.run(ping_mod6)
+
+ # Netperf test (both TCP and UDP)
+@@ -162,11 +145,8 @@ for vlan1 in vlans:
+ m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
+ offload, state))
+ # Ping test
+- if ipv == 'ipv4':
+- m1.run(ping_mod, expect="fail")
+- elif ipv == 'ipv6':
+- m1.run(ping_mod6, expect="fail")
+- else:
++ if ipv in [ 'ipv4', 'both' ]:
+ m1.run(ping_mod, expect="fail")
+- m1.run(ping_mod6, expect="fail")
+
++ if ipv in [ 'ipv6', 'both' ]:
++ m1.run(ping_mod6, expect="fail")
+diff --git a/recipes/regression_tests/phase2/team_test.py b/recipes/regression_tests/phase2/team_test.py
+index 4c87613..776589a 100644
+--- a/recipes/regression_tests/phase2/team_test.py
++++ b/recipes/regression_tests/phase2/team_test.py
+@@ -94,21 +94,7 @@ for offload in offloads:
+ state))
+ m2.run("ethtool -K %s %s %s" % (m2.get_devname("test_if"), offload,
+ state))
+- if ipv == "ipv4":
+- m1.run(ping_mod)
+- server_proc = m1.run(netperf_srv, bg=True)
+- ctl.wait(2)
+- m2.run(netperf_cli_tcp, timeout=70)
+- m2.run(netperf_cli_udp, timeout=70)
+- server_proc.intr()
+- elif ipv == "ipv6":
+- m1.run(ping_mod6)
+- server_proc = m1.run(netperf_srv6, bg=True)
+- ctl.wait(2)
+- m2.run(netperf_cli_tcp6, timeout=70)
+- m2.run(netperf_cli_udp6, timeout=70)
+- server_proc.intr()
+- else:
++ if ipv in [ 'ipv4', 'both' ]:
+ m1.run(ping_mod)
+ server_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+@@ -116,6 +102,7 @@ for offload in offloads:
+ m2.run(netperf_cli_udp, timeout=70)
+ server_proc.intr()
+
++ if ipv in [ 'ipv6', 'both' ]:
+ m1.run(ping_mod6)
+ server_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+@@ -197,21 +184,7 @@ for offload in offloads:
+ state))
+ m2.run("ethtool -K %s %s %s" % (m2.get_devname("test_if"), offload,
+ state))
+- if ipv == 'ipv4':
+- m2.run(ping_mod)
+- server_proc = m2.run(netperf_srv, bg=True)
+- ctl.wait(2)
+- m1.run(netperf_cli_tcp, timeout=70)
+- m1.run(netperf_cli_udp, timeout=70)
+- server_proc.intr()
+- elif ipv == 'ipv6':
+- m2.run(ping_mod6)
+- server_proc = m2.run(netperf_srv6, bg=True)
+- ctl.wait(2)
+- m1.run(netperf_cli_tcp6, timeout=70)
+- m1.run(netperf_cli_udp6, timeout=70)
+- server_proc.intr()
+- else:
++ if ipv in [ 'ipv4', 'both' ]:
+ m2.run(ping_mod)
+ server_proc = m2.run(netperf_srv, bg=True)
+ ctl.wait(2)
+@@ -219,6 +192,7 @@ for offload in offloads:
+ m1.run(netperf_cli_udp, timeout=70)
+ server_proc.intr()
+
++ if ipv in [ 'ipv6', 'both' ]:
+ m2.run(ping_mod6)
+ server_proc = m2.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
+index f09ef36..8daa471 100644
+--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
++++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
+@@ -166,7 +166,7 @@ for offload in offloads:
+ offload, state))
+ g4.run("ethtool -K %s %s %s" % (g4.get_devname("guestnic"),
+ offload, state))
+- if ipv == 'ipv4':
++ if ipv in [ 'ipv4', 'both' ]:
+ g1.run(ping_mod)
+ g4.run(ping_mod2)
+ g1.run(ping_mod_bad, expect="fail")
+@@ -177,30 +177,8 @@ for offload in offloads:
+ g3.run(netperf_cli_tcp, timeout=70)
+ g3.run(netperf_cli_udp, timeout=70)
+ server_proc.intr()
+- elif ipv == 'ipv6':
+- g1.run(ping_mod6)
+- g4.run(ping_mod62)
+- g1.run(ping_mod6_bad, expect="fail")
+- g3.run(ping_mod6_bad2, expect="fail")
+
+- server_proc = g1.run(netperf_srv6, bg=True)
+- ctl.wait(2)
+- g3.run(netperf_cli_tcp6, timeout=70)
+- g3.run(netperf_cli_udp6, timeout=70)
+- server_proc.intr()
+- else:
+- # IPv4
+- g1.run(ping_mod)
+- g4.run(ping_mod2)
+- g1.run(ping_mod_bad, expect="fail")
+- g3.run(ping_mod_bad2, expect="fail")
+-
+- server_proc = g1.run(netperf_srv, bg=True)
+- ctl.wait(2)
+- g3.run(netperf_cli_tcp, timeout=70)
+- g3.run(netperf_cli_udp, timeout=70)
+- server_proc.intr()
+- # IPv6
++ if ipv in [ 'ipv6', 'both' ]:
+ g1.run(ping_mod6)
+ g4.run(ping_mod62)
+ g1.run(ping_mod6_bad, expect="fail")
+diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py
+index 2417c8a..662e888 100644
+--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py
++++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py
+@@ -101,7 +101,7 @@ for offload in offloads:
+ offload, state))
+ h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic"),
+ offload, state))
+- if ipv == 'ipv4':
++ if ipv in [ 'ipv4', 'both' ]:
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+@@ -109,25 +109,12 @@ for offload in offloads:
+ h2.run(netperf_cli_udp, timeout=70)
+
+ server_proc.intr()
+- elif ipv == 'ipv6':
+- g1.run(ping_mod6)
+- server_proc = g1.run(netperf_srv6, bg=True)
+- ctl.wait(2)
+- h2.run(netperf_cli_tcp6, timeout=70)
+- h2.run(netperf_cli_udp6, timeout=70)
+-
+- server_proc.intr()
+- else:
+- g1.run(ping_mod)
+- server_proc = g1.run(netperf_srv, bg=True)
+- ctl.wait(2)
+- h2.run(netperf_cli_tcp, timeout=70)
+- h2.run(netperf_cli_udp, timeout=70)
+- server_proc.intr()
+
++ if ipv in [ 'ipv6', 'both' ]:
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=70)
+ h2.run(netperf_cli_udp6, timeout=70)
++
+ server_proc.intr()
+diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py
+index cee4c49..15122c4 100644
+--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py
++++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py
+@@ -100,23 +100,7 @@ for offload in offloads:
+ offload, state))
+ h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic"),
+ offload, state))
+- if ipv == 'ipv4':
+- g1.run(ping_mod)
+- server_proc = g1.run(netperf_srv, bg=True)
+- ctl.wait(2)
+- h2.run(netperf_cli_tcp, timeout=65)
+- h2.run(netperf_cli_udp, timeout=65)
+- server_proc.intr()
+-
+- elif ipv == 'ipv6':
+- g1.run(ping_mod6)
+- server_proc = g1.run(netperf_srv6, bg=True)
+- ctl.wait(2)
+- h2.run(netperf_cli_tcp6, timeout=65)
+- h2.run(netperf_cli_udp6, timeout=65)
+- server_proc.intr()
+-
+- else:
++ if ipv in [ 'ipv4', 'both' ]:
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+@@ -124,6 +108,7 @@ for offload in offloads:
+ h2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+
++ if ipv in [ 'ipv6', 'both' ]:
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+--
+1.9.3
+
diff --git a/recipes/regression_tests/phase1/3_vlans.py b/recipes/regression_tests/phase1/3_vlans.py
index 3ead92f..a52a829 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 f793ed6..7fcd80a 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 96d1be2..91160f7 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={
--
1.9.3
8 years, 10 months
[PATCH] recipes: remove offload configuration for ping tests between different vlans
by Jan Tluka
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 a52a829..7e79a9f 100644
--- a/recipes/regression_tests/phase1/3_vlans.py
+++ b/recipes/regression_tests/phase1/3_vlans.py
@@ -108,10 +108,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"),
@@ -140,19 +140,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 7fcd80a..dde2359 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/3_vlans_over_bond.py
@@ -108,10 +108,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"),
@@ -142,21 +142,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 91160f7..74b5a5a 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_team.py
+++ b/recipes/regression_tests/phase2/3_vlans_over_team.py
@@ -108,10 +108,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"),
@@ -144,22 +144,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")
--
1.9.3
8 years, 10 months
[PATCH] Add example recipes from LNST wiki page about NetEm
by Jiri Prochazka
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
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(+)
create mode 100644 recipes/examples/netem/corruption.xml
create mode 100644 recipes/examples/netem/delay.xml
create mode 100644 recipes/examples/netem/duplication.xml
create mode 100644 recipes/examples/netem/loss.xml
create mode 100644 recipes/examples/netem/netem_test.py
create mode 100644 recipes/examples/netem/reordering.xml
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>
--
2.1.0
8 years, 10 months
[PATCH 1/2] Add netem to smoke tests variables config
by Jiri Prochazka
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>
---
recipes/smoke/lib/variables.conf | 4 ++++
1 file changed, 4 insertions(+)
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
--
2.1.0
8 years, 10 months