Mon, May 04, 2020 at 06:54:16PM CEST, aloughla(a)redhat.com wrote:
From: Aniss Loughlam <aloughla(a)redhat.com>
Signed-off-by: Aniss Loughlam <aloughla(a)redhat.com>
---
lnst/Recipes/ENRT/BondRecipe.py | 131 +++++++++++++++++++++++++++++++-
1 file changed, 130 insertions(+), 1 deletion(-)
diff --git a/lnst/Recipes/ENRT/BondRecipe.py b/lnst/Recipes/ENRT/BondRecipe.py
index 16b80e9..2d666b4 100644
--- a/lnst/Recipes/ENRT/BondRecipe.py
+++ b/lnst/Recipes/ENRT/BondRecipe.py
@@ -11,6 +11,31 @@ from lnst.Devices import BondDevice
class BondRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin,
BaseEnrtRecipe):
+ """
+ This recipe implements Enrt testing for a network scenario that looks
+ as follows
+
+ .. code-block:: none
+
+ .--------.
+ .----------------+ |
+ | .-------+ switch +-------.
+ | | '--------' |
+ .-------------------. |
+ | | bond0 | | |
+ | .---'--. .---'--. | .---'--.
+ .----|-| eth0 |-| eth1 |-|----. .----| eth0 |----.
+ | | '------' '------' | | | '------' |
+ | '-------------------' | | |
+ | | | |
+ | host1 | | host2 |
+ '-----------------------------' '----------------'
+
I have another suggestion here. Since this recipe has additional recipe
parameters compared to the BaseEnrtRecipe, they should be documented here.
So please add:
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"))
@@ -28,6 +53,17 @@ class BondRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin,
miimon_value = IntParam(mandatory=True)
def test_wide_configuration(self):
+ """
+ Test wide configuration for this recipe involves creating a bonding
+ device using the two matched physical devices on host1 as slaves and set
+ bonding parameters such bonding_mode and miiomon_value.
+ Add IPv4 and IPv6 addresses to the bonding device on host1 and to the
+ matched ethernet device on host2.
+
Hi, it's much better. The description contains everything relevant.
To improve on readability I recommend to keep the sentences short.
There are some typos and few grammar glitches, so, how about this:
"Test wide configuration for this recipe involves creating a bonding
device using the two matched physical devices as slaves on host1.
The bonding mode and miimon interval is configured on the bonding device
according to the recipe parameters. IPv4 and IPv6 addresses are added to
the bonding device and to the matched ethernet device on host2."
+ | host1.bond0 = 192.168.101.1/24 and fc00::1/64
+ | host2.eth0 = 192.168.101.2/24 and fc00::2/64
+ """
+
host1, host2 = self.matched.host1, self.matched.host2
host1.bond0 = BondDevice(mode=self.params.bonding_mode,
miimon=self.params.miimon_value)
@@ -53,6 +89,10 @@ class BondRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin,
return configuration
def generate_test_wide_description(self, config):
+ """
+ Test wide description is extended with the configured addresses.
+ """
+
The code contains more. The configured bonding slave interfaces, bonding
mode and the miimon interval.
host1, host2 = self.matched.host1, self.matched.host2
desc = super().generate_test_wide_description(config)
desc += [
@@ -84,35 +124,124 @@ class BondRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin,
super().test_wide_deconfiguration(config)
def generate_ping_endpoints(self, config):
+ """
+ The ping endpoints for this recipe are the matched bonding device on
+ host1 and the matched ethernet device on host2.
+
The bonding device is not matched (it is not selected by LNST matching
algorithm), only ethernet devices are. Maybe just use "configured" instead.
Please fix this here and in the perf endpoints as well.
The rest looks good.
Thanks!
Jan
+ Returned as::
+
+ [PingEndpoints(self.matched.host1.bond0, self.matched.host2.eth0)
+ """
return [PingEndpoints(self.matched.host1.bond0, self.matched.host2.eth0)]
def generate_perf_endpoints(self, config):
+ """
+ The perf endpoints for this recipe are the matched bonding device on
+ host1 and the matched ethernet device on host2. The traffic egresses
+ the bonding device.
+
+ | host1.bond0
+ | host2.eth0
+
+ Returned as::
+
+ [(self.matched.host1.bond0, self.matched.host2.eth0)]
+
+ """
return [(self.matched.host1.bond0, self.matched.host2.eth0)]
@property
def offload_nics(self):
+ """
+ The `offload_nics` property value for this scenario is a list containing
+ the configured bonding device on host1 and the matched ethernet device
+ on host2.
+
+ | host1.bond0
+ | host2.eth0
+
+ For detailed explanation of this property see :any:`OffloadSubConfigMixin`
+ class and :any:`OffloadSubConfigMixin.offload_nics`.
+ """
return [self.matched.host1.bond0, self.matched.host2.eth0]
@property
def mtu_hw_config_dev_list(self):
+ """
+ The `mtu_hw_config_dev_list` property value for this scenario is a list
+ containing the configured bonding device on host1 and the matched ethernet
+ device on host2.
+
+ | host1.bond0
+ | host2.eth0
+
+ For detailed explanation of this property see :any:`MTUHWConfigMixin`
+ class and :any:`MTUHWConfigMixin.mtu_hw_config_dev_list`.
+ """
return [self.matched.host1.bond0, self.matched.host2.eth0]
@property
def coalescing_hw_config_dev_list(self):
+ """
+ The `coalescing_hw_config_dev_list` property value for this scenario is a
+ list containing the matched physical devices used to create the bonding
+ device on host1 and the matched ethernet device on host2.
+
+ | host1.eth0, host.eth1
+ | host2.eth0
+
+ For detailed explanation of this property see :any:`CoalescingHWConfigMixin`
+ class and :any:`CoalescingHWConfigMixin.coalescing_hw_config_dev_list`.
+ """
return [self.matched.host1.eth0, self.matched.host1.eth1,
self.matched.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 containing the matched physical devices used to create the
+ bonding device on host1 and the matched ethernet device on host2.
+
+ | host1.eth0, host1.eth1
+ | host2.eth0
+
+ For detailed explanation of this property see
+ :any:`DevInterruptHWConfigMixin` class and
+ :any:`CoalescingHWConfigMixin.coalescing_hw_config_dev_list`.
+ """
return [self.matched.host1.eth0, self.matched.host1.eth1,
self.matched.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 containing the matched physical devices used to create
+ the bonding device on host1 and the matched ethernet device on host2.
+
+ | host1.eth0, host.eth1
+ | host2.eth0
+
+ For detailed explanation of this property see
+ :any:`ParallelStreamQDiscHWConfigMixin` class and
+
:any:`ParallelStreamQDiscHWConfigMixin.parallel_stream_qdisc_hw_config_dev_list`.
+ """
return [self.matched.host1.eth0, self.matched.host1.eth1,
self.matched.host2.eth0]
@property
def no_pause_frames_dev_list(self):
+ """
+ The `parallel_stream_qdisc_hw_config_dev_list` property value for this
+ scenario is a list containing the matched physical devices used to create
+ the bonding device on host1 and the matched ethernet device on host2.
+
+ | host1.eth0, host.eth1
+ | host2.eth0
+
+ For detailed explanation of this property see
+ :any:`class DisablePauseFramesHWConfigMixin`.
+ """
return [self.matched.host1.eth0, self.matched.host1.eth1,
- self.matched.host2.eth0]
+ self.matched.host2.eth0]
--
2.25.4
_______________________________________________
LNST-developers mailing list -- lnst-developers(a)lists.fedorahosted.org
To unsubscribe send an email to lnst-developers-leave(a)lists.fedorahosted.org
Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives:
https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedora...