[PATCH] Recipes.ENRT: add pause_frames_dev_list to
VlansOverBondRecipe
by Jan Tluka
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Recipes/ENRT/VlansOverBondRecipe.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/lnst/Recipes/ENRT/VlansOverBondRecipe.py b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
index a2e9947d..f703bcf9 100644
--- a/lnst/Recipes/ENRT/VlansOverBondRecipe.py
+++ b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
@@ -291,3 +291,18 @@ class VlansOverBondRecipe(VlanPingEvaluatorMixin,
"""
host1, host2 = self.matched.host1, self.matched.host2
return [host1.eth0, host1.eth1, host2.eth0]
+
+ @property
+ def pause_frames_dev_list(self):
+ """
+ The `pause_frames_dev_list` property value for this scenario is a list
+ of the physical devices carrying data of the configured VLAN tunnels:
+
+ host1.eth0, host1.eth1 and host2.eth0
+
+ For detailed explanation of this property see
+ :any:`PauseFramesHWConfigMixin` and
+ :any:`PauseFramesHWConfigMixin.pause_frames_dev_list`.
+ """
+ host1, host2 = self.matched.host1, self.matched.host2
+ return [host1.eth0, host1.eth1, host2.eth0]
--
2.21.3
3 years, 6 months
[PATCH] Fixed reversed perf flow
by pgagne@redhat.com
From: Perry Gagne <pgagne(a)redhat.com>
redefined the perf_reverse parameter.
Added mixin for recipes that which to be able to run their flows
in reverse.
Signed-off-by: Perry Gagne <pgagne(a)redhat.com>
---
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 61 ++++++++-----------
.../ConfigMixins/PerfReversibleFlowMixin.py | 36 +++++++++++
lnst/Recipes/ENRT/TeamRecipe.py | 8 +--
3 files changed, 64 insertions(+), 41 deletions(-)
create mode 100644 lnst/Recipes/ENRT/ConfigMixins/PerfReversibleFlowMixin.py
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
index f7bb588..6a287ad 100644
--- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py
+++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
@@ -143,13 +143,6 @@ class BaseEnrtRecipe(BaseSubConfigMixin, PingTestAndEvaluate, PerfRecipe):
separate performance measurement.
:type perf_msg_sizes: List[Int] (default [123])
- :param perf_reverse:
- Parameter used by the :any:`generate_flow_combinations` generator. To
- specify that both directions between the endpoints of a network flow
- should be measured for the same test.
- :type perf_reverse: :any:`BoolParam` (default False)
-
-
:param net_perf_tool:
Parameter used by the :any:`generate_perf_configurations` generator to
create a PerfRecipeConf object.
@@ -185,7 +178,6 @@ class BaseEnrtRecipe(BaseSubConfigMixin, PingTestAndEvaluate, PerfRecipe):
perf_iterations = IntParam(default=5)
perf_parallel_streams = IntParam(default=1)
perf_msg_sizes = ListParam(default=[123])
- perf_reverse = BoolParam(default=False)
net_perf_tool = Param(default=IperfFlowMeasurement)
cpu_perf_tool = Param(default=StatCPUMeasurement)
@@ -499,22 +491,29 @@ class BaseEnrtRecipe(BaseSubConfigMixin, PingTestAndEvaluate, PerfRecipe):
for perf_test in self.params.perf_tests:
for size in self.params.perf_msg_sizes:
- flow = PerfFlow(
- type = perf_test,
- generator = client_nic.netns,
- generator_bind = client_bind,
- receiver = server_nic.netns,
- receiver_bind = server_bind,
- msg_size = size,
- duration = self.params.perf_duration,
- parallel_streams = self.params.perf_parallel_streams,
- cpupin = self.params.perf_tool_cpu if "perf_tool_cpu" in self.params else None
- )
- yield [flow]
-
- if self.params.perf_reverse:
- reverse_flow = self._create_reverse_flow(flow)
- yield [reverse_flow]
+ yield [self._create_perf_flow(perf_test,
+ client_nic,
+ client_bind,
+ server_nic,
+ server_bind,
+ size,
+ )]
+
+ def _create_perf_flow(self, perf_test, client_nic, client_bind, server_nic,
+ server_bind, msg_size) -> PerfFlow:
+ """
+ Wrapper to create a PerfFlow. Mixins that want to change this behavior (for example, to reverse the direction)
+ can override this method as an alternative to overriding :any:`generate_flow_combinations`
+ """
+ cpupin = self.params.perf_tool_cpu if "perf_tool_cpu" in self.params else None
+ return PerfFlow(type=perf_test,
+ generator=client_nic.netns, generator_bind=client_bind,
+ receiver=server_nic.netns, receiver_bind=server_bind,
+ msg_size=msg_size,
+ duration=self.params.perf_duration,
+ parallel_streams=self.params.perf_parallel_streams,
+ cpupin=cpupin,
+ )
def generate_perf_endpoints(self, config):
"""Generator for perf endpoints
@@ -558,19 +557,7 @@ class BaseEnrtRecipe(BaseSubConfigMixin, PingTestAndEvaluate, PerfRecipe):
self.ctl.wait_for_condition(condition, timeout=5)
- def _create_reverse_flow(self, flow):
- rev_flow = PerfFlow(
- type = flow.type,
- generator = flow.receiver,
- generator_bind = flow.receiver_bind,
- receiver = flow.generator,
- receiver_bind = flow.generator_bind,
- msg_size = flow.msg_size,
- duration = flow.duration,
- parallel_streams = flow.parallel_streams,
- cpupin = flow.cpupin
- )
- return rev_flow
+
def _create_reverse_ping(self, pconf):
return PingConf(
diff --git a/lnst/Recipes/ENRT/ConfigMixins/PerfReversibleFlowMixin.py b/lnst/Recipes/ENRT/ConfigMixins/PerfReversibleFlowMixin.py
new file mode 100644
index 0000000..a5bcfad
--- /dev/null
+++ b/lnst/Recipes/ENRT/ConfigMixins/PerfReversibleFlowMixin.py
@@ -0,0 +1,36 @@
+from lnst.Common.Parameters import BoolParam
+from lnst.RecipeCommon.Perf.Measurements import Flow as PerfFlow
+
+
+class PerfReversibleFlowMixin(object):
+ """ Mixin class for reversing the performance test flows
+
+ This only really makes sense for recipes that have asymmetric endpoints.
+
+ For example:
+
+ SimpleNetworkRecipe is symmetrical since both endpoints are of the same type
+ (both plain interfaces).
+
+ TeamRecipe is asymmetrical because one endpoint is a team device and the
+ other is a plain interface.
+
+ So TeamRecipe could use this mixin to indicate that is can be reversed.
+
+ This can be controlled by the perf_reverse parameter:
+
+ :param perf_reverse:
+ Parameter used by the :any:`generate_flow_combinations` generator. To
+ specify that the flow of traffic between the endpoints should be reversed.
+ :type perf_reverse: :any:`BoolParam` (default False)
+ """
+ perf_reverse = BoolParam(default=False)
+
+ def _create_perf_flow(self, perf_test, client_nic, client_bind, server_nic,
+ server_bind, msg_size) -> PerfFlow:
+ if self.params.perf_reverse:
+ return super()._create_perf_flow(perf_test, server_nic, server_bind,
+ client_nic, client_bind, msg_size)
+ else:
+ return super()._create_perf_flow(perf_test, client_nic, client_bind,
+ server_nic, server_bind, msg_size)
diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py
index e97a10b..b8233c8 100644
--- a/lnst/Recipes/ENRT/TeamRecipe.py
+++ b/lnst/Recipes/ENRT/TeamRecipe.py
@@ -6,11 +6,13 @@ from lnst.Recipes.ENRT.ConfigMixins.OffloadSubConfigMixin import (
OffloadSubConfigMixin)
from lnst.Recipes.ENRT.ConfigMixins.CommonHWSubConfigMixin import (
CommonHWSubConfigMixin)
+from lnst.Recipes.ENRT.ConfigMixins.PerfReversibleFlowMixin import (
+ PerfReversibleFlowMixin)
from lnst.RecipeCommon.Ping.PingEndpoints import PingEndpoints
from lnst.Devices import TeamDevice
-class TeamRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin,
+class TeamRecipe(PerfReversibleFlowMixin, CommonHWSubConfigMixin, OffloadSubConfigMixin,
BaseEnrtRecipe):
host1 = HostReq()
host1.eth0 = DeviceReq(label="tnet", driver=RecipeParam("driver"))
@@ -25,7 +27,6 @@ class TeamRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin,
dict(gro="on", gso="off", tso="off", tx="on"),
dict(gro="on", gso="on", tso="off", tx="off")))
- perf_reverse = BoolParam(default=True)
runner_name = StrParam(mandatory=True)
def test_wide_configuration(self):
@@ -88,8 +89,7 @@ class TeamRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin,
]
def generate_perf_endpoints(self, config):
- return [(self.matched.host1.team0, self.matched.host2.eth0),
- (self.matched.host2.eth0, self.matched.host1.team0)]
+ return [(self.matched.host1.team0, self.matched.host2.eth0)]
@property
def offload_nics(self):
--
2.26.2
3 years, 6 months
[PATCH v3 01/12] Recipes.ENRT.ConfigMixins: remove logic from configure_dev_attribute
by Jan Tluka
The configure_dev_attribute should do whatever caller wants and the
logic should be move from this method to caller level.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
.../ENRT/ConfigMixins/BaseHWConfigMixin.py | 42 ++++++++++---------
1 file changed, 22 insertions(+), 20 deletions(-)
diff --git a/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py
index 633a0fe6..29854ee6 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py
@@ -10,29 +10,31 @@ class BaseHWConfigMixin(object):
def _configure_dev_attribute(self, config, dev_list, attr_name, value):
hw_config = config.hw_config
- if value:
- attr_cfg = hw_config[attr_name + "_configuration"] = {}
- for dev in dev_list:
- attr_cfg[dev] = {}
- attr_cfg[dev]["original"] = getattr(dev, attr_name)
- setattr(dev, attr_name, value)
- attr_cfg[dev]["configured"] = getattr(dev, attr_name)
+ attr_cfg = hw_config[attr_name + "_configuration"] = {}
+ for dev in dev_list:
+ attr_cfg[dev] = {}
+ attr_cfg[dev]["original"] = getattr(dev, attr_name)
+ setattr(dev, attr_name, value)
+ attr_cfg[dev]["configured"] = getattr(dev, attr_name)
def _describe_dev_attribute(self, config, attr_name):
hw_config = config.hw_config
res = []
- attr = hw_config.get(attr_name + "_configuration", None)
- if attr:
- for dev, info in attr.items():
- res.append(
- "{}.{}.{} configured to {}, original value {}".format(
- dev.host.hostid,
- dev.name,
- attr_name,
- info["configured"],
- info["original"],
- )
- )
- else:
+ try:
+ attr = hw_config[attr_name + "_configuration"]
+ except:
res.append("{} configuration skipped.".format(attr_name))
+ return res
+
+ for dev, info in attr.items():
+ res.append(
+ "{}.{}.{} configured to {}, original value {}".format(
+ dev.host.hostid,
+ dev.name,
+ attr_name,
+ info["configured"],
+ info["original"],
+ )
+ )
+
return res
--
2.21.1
3 years, 6 months
[PATCH] Recipes.ENRT: remove cross-vlan ping test from Vlans recipes
by Jan Tluka
The current implementation of the vlan isolation test is not accurate.
In particular for the VlansRecipe, VlansOverBondRecipe and VlansOverTeamRecipe,
where under certain conditions (e.g. rp_filter=2 or IPv6) the vlans are
expected to be reachable.
Before we find a better way to test this I removed the relevant PingEndpoints
in these tests.
I kept the similar test in virtual tests because in these topologies
the test makes sense. The virtual guests are isolated at the hypervisor
level and must not be be able to access the other network.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Recipes/ENRT/VlansOverBondRecipe.py | 10 ++++------
lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 10 ++++------
lnst/Recipes/ENRT/VlansRecipe.py | 21 +++++++++------------
3 files changed, 17 insertions(+), 24 deletions(-)
diff --git a/lnst/Recipes/ENRT/VlansOverBondRecipe.py b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
index 45c3e185..7ca8d63d 100644
--- a/lnst/Recipes/ENRT/VlansOverBondRecipe.py
+++ b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
@@ -129,12 +129,10 @@ class VlansOverBondRecipe(VlanPingEvaluatorMixin,
def generate_ping_endpoints(self, config):
host1, host2 = self.matched.host1, self.matched.host2
- result = []
- for src in [host1.vlan0, host1.vlan1, host1.vlan2]:
- for dst in [host2.vlan0, host2.vlan1, host2.vlan2]:
- result += [PingEndpoints(src, dst,
- reachable=(src.vlan_id == dst.vlan_id))]
- return result
+
+ return [PingEndpoints(host1.vlan0, host2.vlan0),
+ PingEndpoints(host1.vlan1, host2.vlan1),
+ PingEndpoints(host1.vlan2, host2.vlan2)]
def generate_perf_endpoints(self, config):
return [(self.matched.host1.vlan0, self.matched.host2.vlan0)]
diff --git a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
index 5ef430bf..cc00c3cd 100644
--- a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
+++ b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
@@ -127,12 +127,10 @@ class VlansOverTeamRecipe(VlanPingEvaluatorMixin,
def generate_ping_endpoints(self, config):
host1, host2 = self.matched.host1, self.matched.host2
- result = []
- for src in [host1.vlan0, host1.vlan1, host1.vlan2]:
- for dst in [host2.vlan0, host2.vlan1, host2.vlan2]:
- result += [PingEndpoints(src, dst,
- reachable=(src.vlan_id == dst.vlan_id))]
- return result
+
+ return [PingEndpoints(host1.vlan0, host2.vlan0),
+ PingEndpoints(host1.vlan1, host2.vlan1),
+ PingEndpoints(host1.vlan2, host2.vlan2)]
def generate_perf_endpoints(self, config):
return [(self.matched.host1.vlan0, self.matched.host2.vlan0)]
diff --git a/lnst/Recipes/ENRT/VlansRecipe.py b/lnst/Recipes/ENRT/VlansRecipe.py
index eef60ef1..1f822451 100644
--- a/lnst/Recipes/ENRT/VlansRecipe.py
+++ b/lnst/Recipes/ENRT/VlansRecipe.py
@@ -145,22 +145,19 @@ class VlansRecipe(VlanPingEvaluatorMixin,
def generate_ping_endpoints(self, config):
"""
- The ping endpoints for this recipe are all combinations of the VLAN
- tunnel endpoints of the hosts. Depending on the VLAN id match of each
- tunnel endpoint combination the *reachable* flag is set.
+ The ping endpoints for this recipe are the matching VLAN tunnel
+ endpoints of the hosts.
Returned as::
-
- # list of PingEndpoints with the following pattern
- [PingEndpoints(src, dst, reachable=(src.vlan_id == dst.vlan_id)), ...]
+ [PingEndpoints(host1.vlan0, host2.vlan0),
+ PingEndpoints(host1.vlan1, host2.vlan1),
+ PingEndpoints(host1.vlan2, host2.vlan2)]
"""
host1, host2 = self.matched.host1, self.matched.host2
- result = []
- for src in [host1.vlan0, host1.vlan1, host1.vlan2]:
- for dst in [host2.vlan0, host2.vlan1, host2.vlan2]:
- result += [PingEndpoints(src, dst,
- reachable=(src.vlan_id == dst.vlan_id))]
- return result
+
+ return [PingEndpoints(host1.vlan0, host2.vlan0),
+ PingEndpoints(host1.vlan1, host2.vlan1),
+ PingEndpoints(host1.vlan2, host2.vlan2)]
def generate_perf_endpoints(self, config):
"""
--
2.21.1
3 years, 6 months
[PATCH 1/2] docs: update repository urls
by olichtne@redhat.com
From: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
README.md | 2 +-
docs/source/installation.rst | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index dec9aba..7932f74 100644
--- a/README.md
+++ b/README.md
@@ -55,7 +55,7 @@ Documentation is available in the `docs/` directory, you can build it with
## How to contact us
-* Git Source Tree: https://github.com/jpirko/lnst
+* Git Source Tree: https://github.com/LNST-project/lnst
* Mailing List: <lnst-developers(a)lists.fedorahosted.org>
* IRC channel: #lnst @ freenode.net
diff --git a/docs/source/installation.rst b/docs/source/installation.rst
index e7a8156..38df777 100644
--- a/docs/source/installation.rst
+++ b/docs/source/installation.rst
@@ -15,7 +15,7 @@ installation involves the following steps:
.. code-block:: bash
- git clone https://github.com/jpirko/lnst
+ git clone https://github.com/LNST-project/lnst
cd lnst
pip3 install --requirement requirements.txt
pip3 install .
--
2.26.2
3 years, 6 months
[PATCH v2 1/7] Recipes.ENRT.ConfigMixins: remove logic from configure_dev_attribute
by Jan Tluka
The configure_dev_attribute should do whatever caller wants and the
logic should be move from this method to caller level.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
.../ENRT/ConfigMixins/BaseHWConfigMixin.py | 42 ++++++++++---------
1 file changed, 22 insertions(+), 20 deletions(-)
diff --git a/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py
index 633a0fe6..29854ee6 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py
@@ -10,29 +10,31 @@ class BaseHWConfigMixin(object):
def _configure_dev_attribute(self, config, dev_list, attr_name, value):
hw_config = config.hw_config
- if value:
- attr_cfg = hw_config[attr_name + "_configuration"] = {}
- for dev in dev_list:
- attr_cfg[dev] = {}
- attr_cfg[dev]["original"] = getattr(dev, attr_name)
- setattr(dev, attr_name, value)
- attr_cfg[dev]["configured"] = getattr(dev, attr_name)
+ attr_cfg = hw_config[attr_name + "_configuration"] = {}
+ for dev in dev_list:
+ attr_cfg[dev] = {}
+ attr_cfg[dev]["original"] = getattr(dev, attr_name)
+ setattr(dev, attr_name, value)
+ attr_cfg[dev]["configured"] = getattr(dev, attr_name)
def _describe_dev_attribute(self, config, attr_name):
hw_config = config.hw_config
res = []
- attr = hw_config.get(attr_name + "_configuration", None)
- if attr:
- for dev, info in attr.items():
- res.append(
- "{}.{}.{} configured to {}, original value {}".format(
- dev.host.hostid,
- dev.name,
- attr_name,
- info["configured"],
- info["original"],
- )
- )
- else:
+ try:
+ attr = hw_config[attr_name + "_configuration"]
+ except:
res.append("{} configuration skipped.".format(attr_name))
+ return res
+
+ for dev, info in attr.items():
+ res.append(
+ "{}.{}.{} configured to {}, original value {}".format(
+ dev.host.hostid,
+ dev.name,
+ attr_name,
+ info["configured"],
+ info["original"],
+ )
+ )
+
return res
--
2.21.1
3 years, 6 months
[PATCH] Recipes.ENRT: make ip address strings more readable in Vlans-like recipes
by Jan Tluka
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Recipes/ENRT/VlansOverBondRecipe.py | 18 ++++++------------
lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 18 ++++++------------
lnst/Recipes/ENRT/VlansRecipe.py | 18 ++++++------------
3 files changed, 18 insertions(+), 36 deletions(-)
diff --git a/lnst/Recipes/ENRT/VlansOverBondRecipe.py b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
index 5b1ee267..a2e9947d 100644
--- a/lnst/Recipes/ENRT/VlansOverBondRecipe.py
+++ b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
@@ -114,18 +114,12 @@ class VlansOverBondRecipe(VlanPingEvaluatorMixin,
net_addr6 = "fc00:0:0"
for i, host in enumerate([host1, host2]):
- host.vlan0.ip_add(ipaddress(net_addr + '.10' + '.' + str(i+1)
- + "/24"))
- host.vlan0.ip_add(ipaddress(net_addr6 + ":1::" + str(i+1) +
- "/64"))
- host.vlan1.ip_add(ipaddress(net_addr + '.20' + '.' + str(i+1) +
- "/24"))
- host.vlan1.ip_add(ipaddress(net_addr6 + ":2::" + str(i+1) +
- "/64"))
- host.vlan2.ip_add(ipaddress(net_addr + '.30' + '.' + str(i+1) +
- "/24"))
- host.vlan2.ip_add(ipaddress(net_addr6 + ":3::" + str(i+1) +
- "/64"))
+ host.vlan0.ip_add(ipaddress('{}.10.{}/24'.format(net_addr, i+1)))
+ host.vlan1.ip_add(ipaddress('{}.20.{}/24'.format(net_addr, i+1)))
+ host.vlan2.ip_add(ipaddress('{}.30.{}/24'.format(net_addr, i+1)))
+ host.vlan0.ip_add(ipaddress('{}:1::{}/64'.format(net_addr6, i+1)))
+ host.vlan1.ip_add(ipaddress('{}:2::{}/64'.format(net_addr6, i+1)))
+ host.vlan2.ip_add(ipaddress('{}:3::{}/64'.format(net_addr6, i+1)))
for dev in [host1.eth0, host1.eth1, host1.bond0, host1.vlan0,
host1.vlan1, host1.vlan2, host2.eth0, host2.vlan0,
diff --git a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
index b51047cf..ed1e6d53 100644
--- a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
+++ b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
@@ -57,18 +57,12 @@ class VlansOverTeamRecipe(VlanPingEvaluatorMixin,
net_addr6 = "fc00:0:0"
for i, host in enumerate([host1, host2]):
- host.vlan0.ip_add(ipaddress(net_addr + '.10' + '.' + str(i+1)
- + "/24"))
- host.vlan0.ip_add(ipaddress(net_addr6 + ":1::" + str(i+1) +
- "/64"))
- host.vlan1.ip_add(ipaddress(net_addr + '.20' + '.' + str(i+1)
- + "/24"))
- host.vlan1.ip_add(ipaddress(net_addr6 + ":2::" + str(i+1) +
- "/64"))
- host.vlan2.ip_add(ipaddress(net_addr + '.30' + '.' + str(i+1)
- + "/24"))
- host.vlan2.ip_add(ipaddress(net_addr6 + ":3::" + str(i+1) +
- "/64"))
+ host.vlan0.ip_add(ipaddress('{}.10.{}/24'.format(net_addr, i+1)))
+ host.vlan1.ip_add(ipaddress('{}.20.{}/24'.format(net_addr, i+1)))
+ host.vlan2.ip_add(ipaddress('{}.30.{}/24'.format(net_addr, i+1)))
+ host.vlan0.ip_add(ipaddress('{}:1::{}/64'.format(net_addr6, i+1)))
+ host.vlan1.ip_add(ipaddress('{}:2::{}/64'.format(net_addr6, i+1)))
+ host.vlan2.ip_add(ipaddress('{}:3::{}/64'.format(net_addr6, i+1)))
for dev in [host1.eth0, host1.eth1, host1.team0, host1.vlan0,
host1.vlan1, host1.vlan2, host2.eth0, host2.vlan0, host2.vlan1,
diff --git a/lnst/Recipes/ENRT/VlansRecipe.py b/lnst/Recipes/ENRT/VlansRecipe.py
index d38663d5..6cf50d57 100644
--- a/lnst/Recipes/ENRT/VlansRecipe.py
+++ b/lnst/Recipes/ENRT/VlansRecipe.py
@@ -88,18 +88,12 @@ class VlansRecipe(VlanPingEvaluatorMixin,
net_addr6 = "fc00:0:0"
for i, host in enumerate([host1, host2]):
- host.vlan0.ip_add(ipaddress(net_addr + '.10' + '.' + str(i+1) +
- "/24"))
- host.vlan0.ip_add(ipaddress(net_addr6 + ":1::" + str(i+1) +
- "/64"))
- host.vlan1.ip_add(ipaddress(net_addr + '.20' + '.' + str(i+1) +
- "/24"))
- host.vlan1.ip_add(ipaddress(net_addr6 + ":2::" + str(i+1) +
- "/64"))
- host.vlan2.ip_add(ipaddress(net_addr + '.30' + '.' + str(i+1) +
- "/24"))
- host.vlan2.ip_add(ipaddress(net_addr6 + ":3::" + str(i+1) +
- "/64"))
+ host.vlan0.ip_add(ipaddress('{}.10.{}/24'.format(net_addr, i+1)))
+ host.vlan1.ip_add(ipaddress('{}.20.{}/24'.format(net_addr, i+1)))
+ host.vlan2.ip_add(ipaddress('{}.30.{}/24'.format(net_addr, i+1)))
+ host.vlan0.ip_add(ipaddress('{}:1::{}/64'.format(net_addr6, i+1)))
+ host.vlan1.ip_add(ipaddress('{}:2::{}/64'.format(net_addr6, i+1)))
+ host.vlan2.ip_add(ipaddress('{}:3::{}/64'.format(net_addr6, i+1)))
for dev in [host.eth0, host.vlan0, host.vlan1, host.vlan2]:
dev.up()
--
2.21.1
3 years, 6 months
[PATCH] Recipes.ENRT.VlansOverBondRecipe: add documentation
by Jan Tluka
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
docs/source/specific_scenarios.rst | 1 +
docs/source/vlans_over_bond_recipe.rst | 6 ++
lnst/Recipes/ENRT/VlansOverBondRecipe.py | 131 +++++++++++++++++++++++
3 files changed, 138 insertions(+)
create mode 100644 docs/source/vlans_over_bond_recipe.rst
diff --git a/docs/source/specific_scenarios.rst b/docs/source/specific_scenarios.rst
index 08d62c9c..c3d81905 100644
--- a/docs/source/specific_scenarios.rst
+++ b/docs/source/specific_scenarios.rst
@@ -4,3 +4,4 @@ Specific ENRT scenarios
.. toctree::
simple_network_recipe
vlans_recipe
+ vlans_over_bond_recipe
diff --git a/docs/source/vlans_over_bond_recipe.rst b/docs/source/vlans_over_bond_recipe.rst
new file mode 100644
index 00000000..5fcee13c
--- /dev/null
+++ b/docs/source/vlans_over_bond_recipe.rst
@@ -0,0 +1,6 @@
+VlansOverBondRecipe
+^^^^^^^^^^^^^^^^^^^
+
+.. autoclass:: lnst.Recipes.ENRT.VlansOverBondRecipe.VlansOverBondRecipe
+ :members:
+ :show-inheritance:
diff --git a/lnst/Recipes/ENRT/VlansOverBondRecipe.py b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
index 7ca8d63d..5b1ee267 100644
--- a/lnst/Recipes/ENRT/VlansOverBondRecipe.py
+++ b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
@@ -15,6 +15,43 @@ from lnst.RecipeCommon.Ping.PingEndpoints import PingEndpoints
class VlansOverBondRecipe(VlanPingEvaluatorMixin,
CommonHWSubConfigMixin, OffloadSubConfigMixin,
BaseEnrtRecipe):
+ """
+ This recipe implements Enrt testing for a network scenario that looks
+ as follows
+
+ .. code-block:: none
+
+ .--------.
+ .-------------+ switch +--------.
+ | .---+ | |
+ | | '--------' |
+ .-----|---------|----. |
+ | .---'--. .---'--. | .--'---.
+ .-|-| eth0 |--| eth1 |-|-. .-------| eth0 |------.
+ | | '------' '------' | | | '------' |
+ | | bond0 | | | / | \ |
+ | '-------/--|--\------' | | vlan0 vlan1 vlan2 |
+ | / | \ | | id=10 id=20 id=30 |
+ | vlan0 vlan1 vlan2 | | |
+ | id=10 id=20 id=30 | | |
+ | | | |
+ | host1 | | host2 |
+ '------------------------' '---------------------'
+
+ The recipe provides additional recipe parameters to configure the bonding
+ device.
+
+ :param bonding_mode:
+ (mandatory test parameter) the bonding mode to be configured on
+ the bond0 device
+ :param miimon_value:
+ (mandatory test parameter) the miimon interval to be configured
+ on the bond0 device
+
+ All sub configurations are included via Mixin classes.
+
+ The actual test machinery is implemented in the :any:`BaseEnrtRecipe` class.
+ """
host1 = HostReq()
host1.eth0 = DeviceReq(label="net1", driver=RecipeParam("driver"))
host1.eth1 = DeviceReq(label="net1", driver=RecipeParam("driver"))
@@ -32,6 +69,25 @@ class VlansOverBondRecipe(VlanPingEvaluatorMixin,
miimon_value = IntParam(mandatory=True)
def test_wide_configuration(self):
+ """
+ Test wide configuration for this recipe involves creating one bonding
+ device on the first host. This device bonds two NICs matched by the
+ recipe. The bonding mode and miimon interval is configured on the
+ bonding device according to the recipe parameters. Then three
+ VLAN (802.1Q) tunnels are created on top of the bonding device on the
+ first host and on the matched NIC on the second host. The tunnels are
+ configured with ids 10, 20, 30.
+
+ An IPv4 and IPv6 address is configured on each tunnel endpoint.
+
+ | host1.vlan0 = 192.168.10.1/24 and fc00:0:0:1::1/64
+ | host1.vlan1 = 192.168.20.1/24 and fc00:0:0:2::1/64
+ | host1.vlan2 = 192.168.30.1/24 and fc00:0:0:3::1/64
+
+ | host2.vlan0 = 192.168.10.2/24 and fc00:0:0:1::2/64
+ | host2.vlan1 = 192.168.20.2/24 and fc00:0:0:2::2/64
+ | host2.vlan2 = 192.168.30.2/24 and fc00:0:0:3::2/64
+ """
host1, host2 = self.matched.host1, self.matched.host2
host1.bond0 = BondDevice(mode=self.params.bonding_mode,
@@ -81,6 +137,10 @@ class VlansOverBondRecipe(VlanPingEvaluatorMixin,
return configuration
def generate_test_wide_description(self, config):
+ """
+ Test wide description is extended with the configured VLAN tunnels,
+ their IP addresses and the bonding device configuration.
+ """
host1, host2 = self.matched.host1, self.matched.host2
desc = super().generate_test_wide_description(config)
desc += [
@@ -128,6 +188,16 @@ class VlansOverBondRecipe(VlanPingEvaluatorMixin,
super().test_wide_deconfiguration(config)
def generate_ping_endpoints(self, config):
+ """
+ The ping endpoints for this recipe are the matching VLAN tunnel
+ endpoints of the hosts.
+
+ Returned as::
+
+ [PingEndpoints(host1.vlan0, host2.vlan0),
+ PingEndpoints(host1.vlan1, host2.vlan1),
+ PingEndpoints(host1.vlan2, host2.vlan2)]
+ """
host1, host2 = self.matched.host1, self.matched.host2
return [PingEndpoints(host1.vlan0, host2.vlan0),
@@ -135,15 +205,45 @@ class VlansOverBondRecipe(VlanPingEvaluatorMixin,
PingEndpoints(host1.vlan2, host2.vlan2)]
def generate_perf_endpoints(self, config):
+ """
+ The perf endpoints for this recipe are the VLAN tunnel endpoints with
+ VLAN id 10:
+
+ host1.vlan0 and host2.vlan0
+
+ Returned as::
+
+ [(self.matched.host1.vlan0, self.matched.host2.vlan0)]
+ """
return [(self.matched.host1.vlan0, self.matched.host2.vlan0)]
@property
def offload_nics(self):
+ """
+ The `offload_nics` property value for this scenario is a list of the
+ physical devices carrying data of the configured VLAN tunnels:
+
+ host1.eth0, host1.eth1 and host2.eth0
+
+ For detailed explanation of this property see :any:`OffloadSubConfigMixin`
+ class and :any:`OffloadSubConfigMixin.offload_nics`.
+ """
host1, host2 = self.matched.host1, self.matched.host2
return [host1.eth0, host1.eth1, host2.eth0]
@property
def mtu_hw_config_dev_list(self):
+ """
+ The `mtu_hw_config_dev_list` property value for this scenario is a
+ list of all configured VLAN tunnel devices and the underlying bonding
+ or physical devices:
+
+ | host1.bond0, host1.vlan0, host1.vlan1, host1.vlan2
+ | host2.eth0, host2.vlan0, host2.vlan1, host2.vlan2
+
+ For detailed explanation of this property see :any:`MTUHWConfigMixin`
+ class and :any:`MTUHWConfigMixin.mtu_hw_config_dev_list`.
+ """
host1, host2 = self.matched.host1, self.matched.host2
result = []
for host in [host1, host2]:
@@ -154,15 +254,46 @@ class VlansOverBondRecipe(VlanPingEvaluatorMixin,
@property
def coalescing_hw_config_dev_list(self):
+ """
+ The `coalescing_hw_config_dev_list` property value for this scenario
+ is a list of the physical devices carrying data of the configured
+ VLAN tunnels:
+
+ host1.eth0, host1.eth1 and host2.eth0
+
+ For detailed explanation of this property see :any:`CoalescingHWConfigMixin`
+ class and :any:`CoalescingHWConfigMixin.coalescing_hw_config_dev_list`.
+ """
host1, host2 = self.matched.host1, self.matched.host2
return [host1.eth0, host1.eth1, host2.eth0]
@property
def dev_interrupt_hw_config_dev_list(self):
+ """
+ The `dev_interrupt_hw_config_dev_list` property value for this scenario
+ is a list of the physical devices carrying data of the configured
+ VLAN tunnels:
+
+ host1.eth0, host1.eth1 and host2.eth0
+
+ For detailed explanation of this property see :any:`DevInterruptHWConfigMixin`
+ class and :any:`DevInterruptHWConfigMixin.dev_interrupt_hw_config_dev_list`.
+ """
host1, host2 = self.matched.host1, self.matched.host2
return [host1.eth0, host1.eth1, host2.eth0]
@property
def parallel_stream_qdisc_hw_config_dev_list(self):
+ """
+ The `parallel_stream_qdisc_hw_config_dev_list` property value for
+ this scenario is a list of the physical devices carrying data of the
+ configured VLAN tunnels:
+
+ host1.eth0, host1.eth1 and host2.eth0
+
+ For detailed explanation of this property see
+ :any:`ParallelStreamQDiscHWConfigMixin` class and
+ :any:`ParallelStreamQDiscHWConfigMixin.parallel_stream_qdisc_hw_config_dev_list`.
+ """
host1, host2 = self.matched.host1, self.matched.host2
return [host1.eth0, host1.eth1, host2.eth0]
--
2.21.1
3 years, 6 months
[PATCH] Recipes.ENRT.VlansRecipe: add newline to generate ping_endpoints docstring
by Jan Tluka
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Recipes/ENRT/VlansRecipe.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/lnst/Recipes/ENRT/VlansRecipe.py b/lnst/Recipes/ENRT/VlansRecipe.py
index 1f822451..d38663d5 100644
--- a/lnst/Recipes/ENRT/VlansRecipe.py
+++ b/lnst/Recipes/ENRT/VlansRecipe.py
@@ -149,6 +149,7 @@ class VlansRecipe(VlanPingEvaluatorMixin,
endpoints of the hosts.
Returned as::
+
[PingEndpoints(host1.vlan0, host2.vlan0),
PingEndpoints(host1.vlan1, host2.vlan1),
PingEndpoints(host1.vlan2, host2.vlan2)]
--
2.21.1
3 years, 6 months