From: Aniss Loughlam <aloughla(a)redhat.com>
Signed-off-by: Aniss Loughlam <aloughla(a)redhat.com>
---
lnst/Recipes/ENRT/BondRecipe.py | 111 ++++++++++++++++++++++++++++++++
1 file changed, 111 insertions(+)
diff --git a/lnst/Recipes/ENRT/BondRecipe.py b/lnst/Recipes/ENRT/BondRecipe.py
index 07d7cfc..0941100 100644
--- a/lnst/Recipes/ENRT/BondRecipe.py
+++ b/lnst/Recipes/ENRT/BondRecipe.py
@@ -11,6 +11,33 @@ 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 |
+ '-----------------------------' '----------------'
+
+ 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 +55,10 @@ class BondRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin,
miimon_value = IntParam(mandatory=True)
def test_wide_configuration(self):
+ """
+ Test wide configuration for this recipe involves creating a bond0
+ device using two slave device eth0 and eth1 on host1
+ """
host1, host2 = self.matched.host1, self.matched.host2
host1.bond0 = BondDevice(mode=self.params.bonding_mode,
miimon=self.params.miimon_value)
@@ -53,6 +84,10 @@ class BondRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin,
return configuration
def generate_test_wide_description(self, config):
+ """
+ Test wide description is extended with the configured VLAN tunnels
+ and their IP addresses
+ """
host1, host2 = self.matched.host1, self.matched.host2
desc = super().generate_test_wide_description(config)
desc += [
@@ -79,39 +114,115 @@ class BondRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin,
return desc
def test_wide_deconfiguration(self, config):
+ "" # overriding the parent docstring
del config.test_wide_devices
super().test_wide_deconfiguration(config)
def generate_ping_endpoints(self, config):
+ """
+ The ping endpoints are host1.bond0 and host2.eht0
+ """
return [PingEndpoints(self.matched.host1.bond0, self.matched.host2.eth0)]
def generate_perf_endpoints(self, config):
+ """
+ The perf endpoints for this recipe are the host1.bond0 and 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 of the physical
+ devices carrying data of the configured bond:
+
+ | host1.eth0, host.eth1
+ | 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 of the configured bond device and the underlying physical
+ devices:
+
+ | host1.eth0, host1.eth1, 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 `mtu_hw_config_dev_list` property value for this scenario is a
+ is a list of the physical devices carrying data of the configured
+ bond:
+
+ | 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 of the physical devices carrying data of the configured bond:
+
+ | host1.eth0, host.eth1
+ | host2.eth0
+
+ For detailed explanation of this property see :any:`DevInterruptHWConfigMixin`
+ class and :any:`DevInterruptHWConfigMixin.dev_interrupt_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 of the physical devices carrying data of the
+ configured bond:
+
+ | 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 `no pause frames dev list` property value for this scenario is a list of
+ the physical devices carrying data of the configured bond:
+
+ | host1.eth0, host1.eht1
+ | 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]
--
2.24.1