[PATCH] docs: add documentation on SubConfigMixin specifics of
VlansRecipe
by Jan Tluka
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Recipes/ENRT/VlansRecipe.py | 51 ++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/lnst/Recipes/ENRT/VlansRecipe.py b/lnst/Recipes/ENRT/VlansRecipe.py
index f4917365..eef60ef1 100644
--- a/lnst/Recipes/ENRT/VlansRecipe.py
+++ b/lnst/Recipes/ENRT/VlansRecipe.py
@@ -177,10 +177,30 @@ class VlansRecipe(VlanPingEvaluatorMixin,
@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 and host2.eth0
+
+ For detailed explanation of this property see :any:`OffloadSubConfigMixin`
+ class and :any:`OffloadSubConfigMixin.offload_nics`.
+ """
return [self.matched.host1.eth0, 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 all configured VLAN tunnel devices and the underlying physical
+ devices:
+
+ | host1.eth0, 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`.
+ """
result = []
for host in [self.matched.host1, self.matched.host2]:
for dev in [host.eth0, host.vlan0, host.vlan1, host.vlan2]:
@@ -189,12 +209,43 @@ class VlansRecipe(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 and 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.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 and 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.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 and 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.host2.eth0]
--
2.21.1
3 years, 11 months
[PATCH v2 1/4] docs: add Recipes.ENRT.ConfigMixins documentation
by Jan Tluka
version 2:
* split config mixins into separate rst files
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
.../base_subconfig_mixin.rst | 5 +++++
.../config_mixin_classes/coalescing_mixin.rst | 6 ++++++
.../config_mixin_classes/common_hw_mixin.rst | 6 ++++++
.../dev_interrupt_mixin.rst | 6 ++++++
.../disable_pause_frames_mixin.rst | 6 ++++++
docs/source/config_mixin_classes/mtu_mixin.rst | 6 ++++++
.../config_mixin_classes/offload_mixin.rst | 6 ++++++
.../parallel_stream_qdisc_mixin.rst | 6 ++++++
docs/source/config_mixins.rst | 10 ++++++++++
.../ConfigMixins/CoalescingHWConfigMixin.py | 18 ++++++++++++++++++
.../ConfigMixins/CommonHWSubConfigMixin.py | 6 ++++++
.../ConfigMixins/DevInterruptHWConfigMixin.py | 16 ++++++++++++++++
.../DisablePauseFramesHWConfigMixin.py | 10 ++++++++++
.../ENRT/ConfigMixins/MTUHWConfigMixin.py | 13 +++++++++++++
.../ENRT/ConfigMixins/OffloadSubConfigMixin.py | 13 +++++++++++++
.../ParallelStreamQDiscHWConfigMixin.py | 14 ++++++++++++++
16 files changed, 147 insertions(+)
create mode 100644 docs/source/config_mixin_classes/base_subconfig_mixin.rst
create mode 100644 docs/source/config_mixin_classes/coalescing_mixin.rst
create mode 100644 docs/source/config_mixin_classes/common_hw_mixin.rst
create mode 100644 docs/source/config_mixin_classes/dev_interrupt_mixin.rst
create mode 100644 docs/source/config_mixin_classes/disable_pause_frames_mixin.rst
create mode 100644 docs/source/config_mixin_classes/mtu_mixin.rst
create mode 100644 docs/source/config_mixin_classes/offload_mixin.rst
create mode 100644 docs/source/config_mixin_classes/parallel_stream_qdisc_mixin.rst
diff --git a/docs/source/config_mixin_classes/base_subconfig_mixin.rst b/docs/source/config_mixin_classes/base_subconfig_mixin.rst
new file mode 100644
index 00000000..0996960d
--- /dev/null
+++ b/docs/source/config_mixin_classes/base_subconfig_mixin.rst
@@ -0,0 +1,5 @@
+BaseSubConfigMixin
+==================
+
+.. autoclass:: lnst.Recipes.ENRT.ConfigMixins.BaseSubConfigMixin.BaseSubConfigMixin
+ :members:
diff --git a/docs/source/config_mixin_classes/coalescing_mixin.rst b/docs/source/config_mixin_classes/coalescing_mixin.rst
new file mode 100644
index 00000000..6432ef17
--- /dev/null
+++ b/docs/source/config_mixin_classes/coalescing_mixin.rst
@@ -0,0 +1,6 @@
+CoalescingHWConfigMixin
+=======================
+
+.. autoclass:: lnst.Recipes.ENRT.ConfigMixins.CoalescingHWConfigMixin.CoalescingHWConfigMixin
+ :members:
+ :show-inheritance:
diff --git a/docs/source/config_mixin_classes/common_hw_mixin.rst b/docs/source/config_mixin_classes/common_hw_mixin.rst
new file mode 100644
index 00000000..9f08093e
--- /dev/null
+++ b/docs/source/config_mixin_classes/common_hw_mixin.rst
@@ -0,0 +1,6 @@
+CommonHWSubConfigMixin
+======================
+
+.. autoclass:: lnst.Recipes.ENRT.ConfigMixins.CommonHWSubConfigMixin.CommonHWSubConfigMixin
+ :members:
+ :show-inheritance:
diff --git a/docs/source/config_mixin_classes/dev_interrupt_mixin.rst b/docs/source/config_mixin_classes/dev_interrupt_mixin.rst
new file mode 100644
index 00000000..72ff4dbb
--- /dev/null
+++ b/docs/source/config_mixin_classes/dev_interrupt_mixin.rst
@@ -0,0 +1,6 @@
+DevInterruptHWConfigMixin
+=========================
+
+.. autoclass:: lnst.Recipes.ENRT.ConfigMixins.DevInterruptHWConfigMixin.DevInterruptHWConfigMixin
+ :members:
+ :show-inheritance:
diff --git a/docs/source/config_mixin_classes/disable_pause_frames_mixin.rst b/docs/source/config_mixin_classes/disable_pause_frames_mixin.rst
new file mode 100644
index 00000000..edd649fc
--- /dev/null
+++ b/docs/source/config_mixin_classes/disable_pause_frames_mixin.rst
@@ -0,0 +1,6 @@
+DisablePauseFramesHWConfigMixin
+===============================
+
+.. autoclass:: lnst.Recipes.ENRT.ConfigMixins.DisablePauseFramesHWConfigMixin.DisablePauseFramesHWConfigMixin
+ :members:
+ :show-inheritance:
diff --git a/docs/source/config_mixin_classes/mtu_mixin.rst b/docs/source/config_mixin_classes/mtu_mixin.rst
new file mode 100644
index 00000000..782dab31
--- /dev/null
+++ b/docs/source/config_mixin_classes/mtu_mixin.rst
@@ -0,0 +1,6 @@
+MTUHWConfigMixin
+================
+
+.. autoclass:: lnst.Recipes.ENRT.ConfigMixins.MTUHWConfigMixin.MTUHWConfigMixin
+ :members:
+ :show-inheritance:
diff --git a/docs/source/config_mixin_classes/offload_mixin.rst b/docs/source/config_mixin_classes/offload_mixin.rst
new file mode 100644
index 00000000..9942e4b0
--- /dev/null
+++ b/docs/source/config_mixin_classes/offload_mixin.rst
@@ -0,0 +1,6 @@
+OffloadSubConfigMixin
+=====================
+
+.. autoclass:: lnst.Recipes.ENRT.ConfigMixins.OffloadSubConfigMixin.OffloadSubConfigMixin
+ :members:
+ :show-inheritance:
diff --git a/docs/source/config_mixin_classes/parallel_stream_qdisc_mixin.rst b/docs/source/config_mixin_classes/parallel_stream_qdisc_mixin.rst
new file mode 100644
index 00000000..a792e254
--- /dev/null
+++ b/docs/source/config_mixin_classes/parallel_stream_qdisc_mixin.rst
@@ -0,0 +1,6 @@
+ParallelStreamQDiscHWConfigMixin
+================================
+
+.. autoclass:: lnst.Recipes.ENRT.ConfigMixins.ParallelStreamQDiscHWConfigMixin.ParallelStreamQDiscHWConfigMixin
+ :members:
+ :show-inheritance:
diff --git a/docs/source/config_mixins.rst b/docs/source/config_mixins.rst
index 66119b6e..65f7746f 100644
--- a/docs/source/config_mixins.rst
+++ b/docs/source/config_mixins.rst
@@ -1,3 +1,13 @@
.. ENRT Config Mixins
.. automodule:: lnst.Recipes.ENRT.ConfigMixins
+
+.. toctree::
+ config_mixin_classes/base_subconfig_mixin
+ config_mixin_classes/offload_mixin
+ config_mixin_classes/common_hw_mixin
+ config_mixin_classes/mtu_mixin
+ config_mixin_classes/coalescing_mixin
+ config_mixin_classes/dev_interrupt_mixin
+ config_mixin_classes/parallel_stream_qdisc_mixin
+ config_mixin_classes/disable_pause_frames_mixin
diff --git a/lnst/Recipes/ENRT/ConfigMixins/CoalescingHWConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/CoalescingHWConfigMixin.py
index 23fb2085..0e8807af 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/CoalescingHWConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/CoalescingHWConfigMixin.py
@@ -4,11 +4,29 @@ from lnst.Recipes.ENRT.ConfigMixins.BaseHWConfigMixin import BaseHWConfigMixin
class CoalescingHWConfigMixin(BaseHWConfigMixin):
+ """
+ This class is an extension to the :any:`BaseEnrtRecipe` class that enables
+ adaptive coalescing configuration on the devices defined by
+ :attr:`coalescing_hw_config_dev_list` property.
+
+ :param adaptive_tx_coalescing:
+ (optional test parameter) boolean to enable/disable TX adaptive
+ coalescing on the devices
+ :param adaptive_rx_coalescing:
+ (optional test parameter) boolean to enable/disable RX adaptive
+ coalescing on the devices
+ """
+
adaptive_rx_coalescing = BoolParam(mandatory=False)
adaptive_tx_coalescing = BoolParam(mandatory=False)
@property
def coalescing_hw_config_dev_list(self):
+ """
+ The value of this property is a list of devices for which the
+ adaptive coalescing features should be configured. It has to be
+ defined by a derived class.
+ """
return []
def hw_config(self, config):
diff --git a/lnst/Recipes/ENRT/ConfigMixins/CommonHWSubConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/CommonHWSubConfigMixin.py
index c73f8ea7..f1f9599d 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/CommonHWSubConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/CommonHWSubConfigMixin.py
@@ -22,6 +22,12 @@ class CommonHWSubConfigMixin(
MTUHWConfigMixin,
BaseSubConfigMixin,
):
+ """
+ This class groups few related :any:`BaseSubConfigMixin` s for user's
+ convenience. For more details, see the documentation of the individual
+ ancestor classes.
+ """
+
def apply_sub_configuration(self, config):
super().apply_sub_configuration(config)
self.hw_config(config)
diff --git a/lnst/Recipes/ENRT/ConfigMixins/DevInterruptHWConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/DevInterruptHWConfigMixin.py
index 57f2543c..1f8f5e8e 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/DevInterruptHWConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/DevInterruptHWConfigMixin.py
@@ -7,10 +7,26 @@ from lnst.Recipes.ENRT.ConfigMixins.BaseHWConfigMixin import BaseHWConfigMixin
class DevInterruptHWConfigMixin(BaseHWConfigMixin):
+ """
+ This class is an extension to the :any:`BaseEnrtRecipe` class that enables
+ the CPU affinity (CPU pinning) of the test device IRQs. The test devices
+ are defined by :attr:`dev_interrupt_hw_config_dev_list` property.
+
+ .. note::
+ Note that this Mixin also stops the irqbalance service.
+
+ :param dev_intr_cpu:
+ (optional test parameter) CPU id to which the device IRQs should be pinned
+ """
+
dev_intr_cpu = IntParam(mandatory=False)
@property
def dev_interrupt_hw_config_dev_list(self):
+ """
+ The value of this property is a list of devices for which the IRQ CPU
+ affinity should be configured. It has to be defined by a derived class.
+ """
return []
def hw_config(self, config):
diff --git a/lnst/Recipes/ENRT/ConfigMixins/DisablePauseFramesHWConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/DisablePauseFramesHWConfigMixin.py
index 72857cff..a08e324e 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/DisablePauseFramesHWConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/DisablePauseFramesHWConfigMixin.py
@@ -3,8 +3,18 @@ from lnst.Recipes.ENRT.ConfigMixins.BaseHWConfigMixin import BaseHWConfigMixin
class DisablePauseFramesHWConfigMixin(BaseHWConfigMixin):
+ """
+ This class is an extension to the :any:`BaseEnrtRecipe` class to turn off
+ the Ethernet pause frames on the devices defined by
+ the :attr:`no_pause_frames_dev_list` property.
+ """
+
@property
def no_pause_frames_dev_list(self):
+ """
+ The value of this property is a list of devices for which the pause
+ frames should be disabled. It has to be defined by a derived class.
+ """
return []
def hw_config(self, config):
diff --git a/lnst/Recipes/ENRT/ConfigMixins/MTUHWConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/MTUHWConfigMixin.py
index 143c0eaf..cbd7d62e 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/MTUHWConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/MTUHWConfigMixin.py
@@ -4,10 +4,23 @@ from lnst.Recipes.ENRT.ConfigMixins.BaseHWConfigMixin import BaseHWConfigMixin
class MTUHWConfigMixin(BaseHWConfigMixin):
+ """
+ This class is an extension to the :any:`BaseEnrtRecipe` class that enables
+ MTU configuration on the devices defined by the :attr:`mtu_hw_config_dev_list`
+ property.
+
+ :param mtu:
+ (optional test parameter) MTU value to be configured on the devices
+ """
+
mtu = IntParam(mandatory=False)
@property
def mtu_hw_config_dev_list(self):
+ """
+ The value of this property is a list of devices for which the MTU
+ should be configured. It has to be defined by a derived class.
+ """
return []
def hw_config(self, config):
diff --git a/lnst/Recipes/ENRT/ConfigMixins/OffloadSubConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/OffloadSubConfigMixin.py
index f50a165e..989743a8 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/OffloadSubConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/OffloadSubConfigMixin.py
@@ -6,12 +6,25 @@ from lnst.Recipes.ENRT.ConfigMixins.BaseSubConfigMixin import BaseSubConfigMixin
class OffloadSubConfigMixin(BaseSubConfigMixin):
+ """
+ This class is an extension to the :any:`BaseEnrtRecipe` class that enables
+ offload configuration on the devices defined by :attr:`offload_nics`.
+
+ :param offload_combinations:
+ (optional test parameter) defines the offload features to be enabled
+ or disabled on the devices
+ """
+
offload_combinations = Param(
default=(dict(gro="on", gso="on", tso="on", tx="on", rx="on"),)
)
@property
def offload_nics(self):
+ """
+ The value of this property is a list of devices for which the offload
+ settings should be configured. It has to be defined by a derived class.
+ """
raise NotImplementedError("Subclass must implement this property")
def generate_sub_configurations(self, config):
diff --git a/lnst/Recipes/ENRT/ConfigMixins/ParallelStreamQDiscHWConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/ParallelStreamQDiscHWConfigMixin.py
index dc6e0116..63b697be 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/ParallelStreamQDiscHWConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/ParallelStreamQDiscHWConfigMixin.py
@@ -2,8 +2,22 @@ from lnst.Recipes.ENRT.ConfigMixins.BaseHWConfigMixin import BaseHWConfigMixin
class ParallelStreamQDiscHWConfigMixin(BaseHWConfigMixin):
+ """
+ This class is an extension to the :any:`BaseEnrtRecipe` class that enables
+ the mq (multiqueing) qdisc configuration on the devices defined by
+ :attr:`parallel_stream_qdisc_hw_config_dev_list` property.
+
+ The qdisc is configured when the :any:`BaseEnrtRecipe`'s *perf_parallel_streams*
+ test parameter is set.
+
+ """
+
@property
def parallel_stream_qdisc_hw_config_dev_list(self):
+ """
+ The value of this property is a list of devices for which the
+ mq qdisc should be configured. It has to be defined by a derived class.
+ """
return []
def hw_config(self, config):
--
2.21.1
3 years, 11 months
[PATCH] docs: add Recipes.ENRT.ConfigMixins documentation
by Jan Tluka
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
docs/source/config_mixins.rst | 28 +++++++++++++++++++
.../ConfigMixins/CoalescingHWConfigMixin.py | 18 ++++++++++++
.../ConfigMixins/CommonHWSubConfigMixin.py | 6 ++++
.../ConfigMixins/DevInterruptHWConfigMixin.py | 16 +++++++++++
.../DisablePauseFramesHWConfigMixin.py | 10 +++++++
.../ENRT/ConfigMixins/MTUHWConfigMixin.py | 13 +++++++++
.../ConfigMixins/OffloadSubConfigMixin.py | 13 +++++++++
.../ParallelStreamQDiscHWConfigMixin.py | 14 ++++++++++
8 files changed, 118 insertions(+)
diff --git a/docs/source/config_mixins.rst b/docs/source/config_mixins.rst
index 66119b6e..57ef199d 100644
--- a/docs/source/config_mixins.rst
+++ b/docs/source/config_mixins.rst
@@ -1,3 +1,31 @@
.. ENRT Config Mixins
.. automodule:: lnst.Recipes.ENRT.ConfigMixins
+
+.. autoclass:: lnst.Recipes.ENRT.ConfigMixins.OffloadSubConfigMixin.OffloadSubConfigMixin
+ :members:
+ :show-inheritance:
+
+.. autoclass:: lnst.Recipes.ENRT.ConfigMixins.CommonHWSubConfigMixin.CommonHWSubConfigMixin
+ :members:
+ :show-inheritance:
+
+.. autoclass:: lnst.Recipes.ENRT.ConfigMixins.MTUHWConfigMixin.MTUHWConfigMixin
+ :members:
+ :show-inheritance:
+
+.. autoclass:: lnst.Recipes.ENRT.ConfigMixins.CoalescingHWConfigMixin.CoalescingHWConfigMixin
+ :members:
+ :show-inheritance:
+
+.. autoclass:: lnst.Recipes.ENRT.ConfigMixins.DevInterruptHWConfigMixin.DevInterruptHWConfigMixin
+ :members:
+ :show-inheritance:
+
+.. autoclass:: lnst.Recipes.ENRT.ConfigMixins.ParallelStreamQDiscHWConfigMixin.ParallelStreamQDiscHWConfigMixin
+ :members:
+ :show-inheritance:
+
+.. autoclass:: lnst.Recipes.ENRT.ConfigMixins.DisablePauseFramesHWConfigMixin.DisablePauseFramesHWConfigMixin
+ :members:
+ :show-inheritance:
diff --git a/lnst/Recipes/ENRT/ConfigMixins/CoalescingHWConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/CoalescingHWConfigMixin.py
index 23fb2085..0e8807af 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/CoalescingHWConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/CoalescingHWConfigMixin.py
@@ -4,11 +4,29 @@ from lnst.Recipes.ENRT.ConfigMixins.BaseHWConfigMixin import BaseHWConfigMixin
class CoalescingHWConfigMixin(BaseHWConfigMixin):
+ """
+ This class is an extension to the :any:`BaseEnrtRecipe` class that enables
+ adaptive coalescing configuration on the devices defined by
+ :attr:`coalescing_hw_config_dev_list` property.
+
+ :param adaptive_tx_coalescing:
+ (optional test parameter) boolean to enable/disable TX adaptive
+ coalescing on the devices
+ :param adaptive_rx_coalescing:
+ (optional test parameter) boolean to enable/disable RX adaptive
+ coalescing on the devices
+ """
+
adaptive_rx_coalescing = BoolParam(mandatory=False)
adaptive_tx_coalescing = BoolParam(mandatory=False)
@property
def coalescing_hw_config_dev_list(self):
+ """
+ The value of this property is a list of devices for which the
+ adaptive coalescing features should be configured. It has to be
+ defined by a derived class.
+ """
return []
def hw_config(self, config):
diff --git a/lnst/Recipes/ENRT/ConfigMixins/CommonHWSubConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/CommonHWSubConfigMixin.py
index c73f8ea7..f1f9599d 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/CommonHWSubConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/CommonHWSubConfigMixin.py
@@ -22,6 +22,12 @@ class CommonHWSubConfigMixin(
MTUHWConfigMixin,
BaseSubConfigMixin,
):
+ """
+ This class groups few related :any:`BaseSubConfigMixin` s for user's
+ convenience. For more details, see the documentation of the individual
+ ancestor classes.
+ """
+
def apply_sub_configuration(self, config):
super().apply_sub_configuration(config)
self.hw_config(config)
diff --git a/lnst/Recipes/ENRT/ConfigMixins/DevInterruptHWConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/DevInterruptHWConfigMixin.py
index 57f2543c..1f8f5e8e 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/DevInterruptHWConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/DevInterruptHWConfigMixin.py
@@ -7,10 +7,26 @@ from lnst.Recipes.ENRT.ConfigMixins.BaseHWConfigMixin import BaseHWConfigMixin
class DevInterruptHWConfigMixin(BaseHWConfigMixin):
+ """
+ This class is an extension to the :any:`BaseEnrtRecipe` class that enables
+ the CPU affinity (CPU pinning) of the test device IRQs. The test devices
+ are defined by :attr:`dev_interrupt_hw_config_dev_list` property.
+
+ .. note::
+ Note that this Mixin also stops the irqbalance service.
+
+ :param dev_intr_cpu:
+ (optional test parameter) CPU id to which the device IRQs should be pinned
+ """
+
dev_intr_cpu = IntParam(mandatory=False)
@property
def dev_interrupt_hw_config_dev_list(self):
+ """
+ The value of this property is a list of devices for which the IRQ CPU
+ affinity should be configured. It has to be defined by a derived class.
+ """
return []
def hw_config(self, config):
diff --git a/lnst/Recipes/ENRT/ConfigMixins/DisablePauseFramesHWConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/DisablePauseFramesHWConfigMixin.py
index 72857cff..a08e324e 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/DisablePauseFramesHWConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/DisablePauseFramesHWConfigMixin.py
@@ -3,8 +3,18 @@ from lnst.Recipes.ENRT.ConfigMixins.BaseHWConfigMixin import BaseHWConfigMixin
class DisablePauseFramesHWConfigMixin(BaseHWConfigMixin):
+ """
+ This class is an extension to the :any:`BaseEnrtRecipe` class to turn off
+ the Ethernet pause frames on the devices defined by
+ the :attr:`no_pause_frames_dev_list` property.
+ """
+
@property
def no_pause_frames_dev_list(self):
+ """
+ The value of this property is a list of devices for which the pause
+ frames should be disabled. It has to be defined by a derived class.
+ """
return []
def hw_config(self, config):
diff --git a/lnst/Recipes/ENRT/ConfigMixins/MTUHWConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/MTUHWConfigMixin.py
index 143c0eaf..cbd7d62e 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/MTUHWConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/MTUHWConfigMixin.py
@@ -4,10 +4,23 @@ from lnst.Recipes.ENRT.ConfigMixins.BaseHWConfigMixin import BaseHWConfigMixin
class MTUHWConfigMixin(BaseHWConfigMixin):
+ """
+ This class is an extension to the :any:`BaseEnrtRecipe` class that enables
+ MTU configuration on the devices defined by the :attr:`mtu_hw_config_dev_list`
+ property.
+
+ :param mtu:
+ (optional test parameter) MTU value to be configured on the devices
+ """
+
mtu = IntParam(mandatory=False)
@property
def mtu_hw_config_dev_list(self):
+ """
+ The value of this property is a list of devices for which the MTU
+ should be configured. It has to be defined by a derived class.
+ """
return []
def hw_config(self, config):
diff --git a/lnst/Recipes/ENRT/ConfigMixins/OffloadSubConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/OffloadSubConfigMixin.py
index f50a165e..989743a8 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/OffloadSubConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/OffloadSubConfigMixin.py
@@ -6,12 +6,25 @@ from lnst.Recipes.ENRT.ConfigMixins.BaseSubConfigMixin import BaseSubConfigMixin
class OffloadSubConfigMixin(BaseSubConfigMixin):
+ """
+ This class is an extension to the :any:`BaseEnrtRecipe` class that enables
+ offload configuration on the devices defined by :attr:`offload_nics`.
+
+ :param offload_combinations:
+ (optional test parameter) defines the offload features to be enabled
+ or disabled on the devices
+ """
+
offload_combinations = Param(
default=(dict(gro="on", gso="on", tso="on", tx="on", rx="on"),)
)
@property
def offload_nics(self):
+ """
+ The value of this property is a list of devices for which the offload
+ settings should be configured. It has to be defined by a derived class.
+ """
raise NotImplementedError("Subclass must implement this property")
def generate_sub_configurations(self, config):
diff --git a/lnst/Recipes/ENRT/ConfigMixins/ParallelStreamQDiscHWConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/ParallelStreamQDiscHWConfigMixin.py
index dc6e0116..63b697be 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/ParallelStreamQDiscHWConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/ParallelStreamQDiscHWConfigMixin.py
@@ -2,8 +2,22 @@ from lnst.Recipes.ENRT.ConfigMixins.BaseHWConfigMixin import BaseHWConfigMixin
class ParallelStreamQDiscHWConfigMixin(BaseHWConfigMixin):
+ """
+ This class is an extension to the :any:`BaseEnrtRecipe` class that enables
+ the mq (multiqueing) qdisc configuration on the devices defined by
+ :attr:`parallel_stream_qdisc_hw_config_dev_list` property.
+
+ The qdisc is configured when the :any:`BaseEnrtRecipe`'s *perf_parallel_streams*
+ test parameter is set.
+
+ """
+
@property
def parallel_stream_qdisc_hw_config_dev_list(self):
+ """
+ The value of this property is a list of devices for which the
+ mq qdisc should be configured. It has to be defined by a derived class.
+ """
return []
def hw_config(self, config):
--
2.21.1
3 years, 12 months
[PATCH] Fixed issues with team device configuration.
by pgagne@redhat.com
From: Perry Gagne <pgagne(a)redhat.com>
Team devices now are created with a config dict that gets converted to json when configuring them on the host.
Signed-off-by: Perry Gagne <pgagne(a)redhat.com>
---
lnst/Devices/TeamDevice.py | 54 ++++++++++++++++++---------------
lnst/Recipes/ENRT/TeamRecipe.py | 7 ++---
2 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/lnst/Devices/TeamDevice.py b/lnst/Devices/TeamDevice.py
index 4f6eee5..fc05de4 100644
--- a/lnst/Devices/TeamDevice.py
+++ b/lnst/Devices/TeamDevice.py
@@ -9,44 +9,46 @@ published by the Free Software Foundation; see COPYING for details.
__author__ = """
olichtne(a)redhat.com (Ondrej Lichtner)
"""
-
-import re
+import json
from lnst.Common.ExecCmd import exec_cmd
-from lnst.Common.Utils import bool_it
+from lnst.Common.DeviceError import DeviceError, DeviceConfigError
from lnst.Devices.MasterDevice import MasterDevice
-def prepare_json_str(json_str):
- if not json_str:
- return "{}"
- json_str = json_str.replace('"', '\\"')
- json_str = re.sub('\s+', ' ', json_str)
- return json_str
-#TODO rework with pyroute2? don't know how json and teamd works with that...
+# TODO Rework with pyroute2 if thats possible.
+# See https://github.com/svinota/pyroute2/issues/699#issuecomment-615367686
class TeamDevice(MasterDevice):
_name_template = "t_team"
def __init__(self, ifmanager, *args, **kwargs):
+ self._config = {}
+ self._dbus = False
super(TeamDevice, self).__init__(ifmanager, *args, **kwargs)
- self._config = kwargs.get("config", None)
- self._dbus = not bool_it(kwargs.get("disable_dbus", False))
-
@property
def config(self):
return self._config
+ @config.setter
+ def config(self, v: dict):
+ if not isinstance(v, dict):
+ raise DeviceConfigError("team device config must be dict")
+ self._config = v
+
@property
def dbus(self):
return self._dbus
- def _create(self):
- teamd_config = prepare_json_str(self.config)
+ @dbus.setter
+ def dbus(self, v: bool):
+ if not isinstance(v, bool):
+ raise DeviceConfigError("team dbus setting must be bool")
+ self._dbus = v
- exec_cmd("teamd -r -d -c \"%s\" -t %s %s" %\
- (teamd_config,
- self.name,
- " -D" if self.dbus else ""))
+ def _create(self):
+ teamd_json = json.dumps(self.config)
+ exec_cmd(f"teamd -r -d -c '{teamd_json}' -t {self.name}"
+ " -D" if self.dbus else "")
retry = 0
while self._nl_msg is None and retry < 5:
@@ -56,11 +58,13 @@ class TeamDevice(MasterDevice):
def destroy(self):
exec_cmd("teamd -k -t %s" % self.name)
- def slave_add(self, dev, port_config=None):
- exec_cmd("teamdctl %s %s port config update %s \"%s\"" %\
- (" -D" if self.dbus else "",
- self.name,
- dev.name,
- prepare_json_str(port_config)))
+ def slave_add(self, dev, port_config={}):
+ if not isinstance(port_config, dict):
+ raise DeviceConfigError(f"team link {dev.name} port config must be dict")
+
+ port_json = json.dumps(port_config)
+ opts = "-D" if self.dbus else ""
+ exec_cmd(f"teamdctl {opts} {self.name} port config "
+ f"update {dev.name} '{port_json}'")
dev.master = self
diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py
index e083b90..e97a10b 100644
--- a/lnst/Recipes/ENRT/TeamRecipe.py
+++ b/lnst/Recipes/ENRT/TeamRecipe.py
@@ -9,6 +9,7 @@ from lnst.Recipes.ENRT.ConfigMixins.CommonHWSubConfigMixin import (
from lnst.RecipeCommon.Ping.PingEndpoints import PingEndpoints
from lnst.Devices import TeamDevice
+
class TeamRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin,
BaseEnrtRecipe):
host1 = HostReq()
@@ -30,10 +31,8 @@ class TeamRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin,
def test_wide_configuration(self):
host1, host2 = self.matched.host1, self.matched.host2
- #The config argument needs to be used with a team device normally
- #(e.g to specify the runner mode), but it is not used here due to
- #a bug in the TeamDevice module
- host1.team0 = TeamDevice()
+ teamd_config = {'runner': {'name': self.params.runner_name}}
+ host1.team0 = TeamDevice(config=teamd_config)
configuration = super().test_wide_configuration()
configuration.test_wide_devices = [host1.team0, host2.eth0]
--
2.21.1
3 years, 12 months
[PATCH] Devices.BondDevice: fix miimon setter
by Jan Tluka
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Reported-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Devices/BondDevice.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst/Devices/BondDevice.py b/lnst/Devices/BondDevice.py
index ce014272..0965fe92 100644
--- a/lnst/Devices/BondDevice.py
+++ b/lnst/Devices/BondDevice.py
@@ -232,7 +232,7 @@ class BondDevice(MasterDevice):
@miimon.setter
def miimon(self, val):
- self._set_linkinfo_data_attr("IFLA_BOND_LACP_RATE", int(val))
+ self._set_linkinfo_data_attr("IFLA_BOND_MIIMON", int(val))
self._nl_link_sync("set")
@property
--
2.21.1
4 years
[[PATCH] Fix TeamDevice configuration] Fixed issues with team device configuration. Team devices now are created with a config dict that gets converted to json when configuring them on the host.
by pgagne@redhat.com
From: Perry Gagne <pgagne(a)redhat.com>
Signed-off-by: Perry Gagne <pgagne(a)redhat.com>
---
lnst/Devices/TeamDevice.py | 49 ++++++++++++++++-----------------
lnst/Recipes/ENRT/TeamRecipe.py | 11 ++++----
2 files changed, 29 insertions(+), 31 deletions(-)
diff --git a/lnst/Devices/TeamDevice.py b/lnst/Devices/TeamDevice.py
index 4f6eee5..3a60125 100644
--- a/lnst/Devices/TeamDevice.py
+++ b/lnst/Devices/TeamDevice.py
@@ -9,44 +9,43 @@ published by the Free Software Foundation; see COPYING for details.
__author__ = """
olichtne(a)redhat.com (Ondrej Lichtner)
"""
-
-import re
+import json
from lnst.Common.ExecCmd import exec_cmd
-from lnst.Common.Utils import bool_it
+from lnst.Common.DeviceError import DeviceError, DeviceConfigError
from lnst.Devices.MasterDevice import MasterDevice
-def prepare_json_str(json_str):
- if not json_str:
- return "{}"
- json_str = json_str.replace('"', '\\"')
- json_str = re.sub('\s+', ' ', json_str)
- return json_str
-#TODO rework with pyroute2? don't know how json and teamd works with that...
class TeamDevice(MasterDevice):
_name_template = "t_team"
def __init__(self, ifmanager, *args, **kwargs):
+ self._config = {}
+ self._dbus = False
super(TeamDevice, self).__init__(ifmanager, *args, **kwargs)
- self._config = kwargs.get("config", None)
- self._dbus = not bool_it(kwargs.get("disable_dbus", False))
-
@property
def config(self):
return self._config
+ @config.setter
+ def config(self, v: dict):
+ if not isinstance(v, dict):
+ raise DeviceConfigError("team device config must be dict")
+ self._config = v
+
@property
def dbus(self):
return self._dbus
- def _create(self):
- teamd_config = prepare_json_str(self.config)
+ @dbus.setter
+ def dbus(self, v: bool):
+ if not isinstance(v, bool):
+ raise DeviceConfigError("team dbus setting must be bool")
+ self._dbus = v
- exec_cmd("teamd -r -d -c \"%s\" -t %s %s" %\
- (teamd_config,
- self.name,
- " -D" if self.dbus else ""))
+ def _create(self):
+ teamd_json = json.dumps(self.config)
+ exec_cmd(f"teamd -r -d -c '{teamd_json}' -t {self.name} {'-D' if self.dbus else ''}")
retry = 0
while self._nl_msg is None and retry < 5:
@@ -56,11 +55,11 @@ class TeamDevice(MasterDevice):
def destroy(self):
exec_cmd("teamd -k -t %s" % self.name)
- def slave_add(self, dev, port_config=None):
- exec_cmd("teamdctl %s %s port config update %s \"%s\"" %\
- (" -D" if self.dbus else "",
- self.name,
- dev.name,
- prepare_json_str(port_config)))
+ def slave_add(self, dev, port_config={}):
+ if not isinstance(port_config, dict):
+ raise DeviceConfigError(f"team link {dev.name} port config must be dict")
+
+ port_json = json.dumps(port_config)
+ exec_cmd(f"teamdctl {'-D' if self.dbus else ''} {self.name} port config update {dev.name} '{port_json}'")
dev.master = self
diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py
index e083b90..ccad5e7 100644
--- a/lnst/Recipes/ENRT/TeamRecipe.py
+++ b/lnst/Recipes/ENRT/TeamRecipe.py
@@ -9,8 +9,9 @@ from lnst.Recipes.ENRT.ConfigMixins.CommonHWSubConfigMixin import (
from lnst.RecipeCommon.Ping.PingEndpoints import PingEndpoints
from lnst.Devices import TeamDevice
+
class TeamRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin,
- BaseEnrtRecipe):
+ BaseEnrtRecipe):
host1 = HostReq()
host1.eth0 = DeviceReq(label="tnet", driver=RecipeParam("driver"))
host1.eth1 = DeviceReq(label="tnet", driver=RecipeParam("driver"))
@@ -30,10 +31,8 @@ class TeamRecipe(CommonHWSubConfigMixin, OffloadSubConfigMixin,
def test_wide_configuration(self):
host1, host2 = self.matched.host1, self.matched.host2
- #The config argument needs to be used with a team device normally
- #(e.g to specify the runner mode), but it is not used here due to
- #a bug in the TeamDevice module
- host1.team0 = TeamDevice()
+ teamd_config = {'runner': {'name': self.params.runner_name}}
+ host1.team0 = TeamDevice(config=teamd_config)
configuration = super().test_wide_configuration()
configuration.test_wide_devices = [host1.team0, host2.eth0]
@@ -90,7 +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)]
+ (self.matched.host2.eth0, self.matched.host1.team0)]
@property
def offload_nics(self):
--
2.21.1
4 years
[PATCH] docs: add documentation for ENRT.VlansRecipe
by Jan Tluka
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
docs/source/specific_scenarios.rst | 1 +
docs/source/vlans_recipe.rst | 6 +++
lnst/Recipes/ENRT/VlansRecipe.py | 64 ++++++++++++++++++++++++++++++
3 files changed, 71 insertions(+)
create mode 100644 docs/source/vlans_recipe.rst
diff --git a/docs/source/specific_scenarios.rst b/docs/source/specific_scenarios.rst
index aea32304..08d62c9c 100644
--- a/docs/source/specific_scenarios.rst
+++ b/docs/source/specific_scenarios.rst
@@ -3,3 +3,4 @@ Specific ENRT scenarios
.. toctree::
simple_network_recipe
+ vlans_recipe
diff --git a/docs/source/vlans_recipe.rst b/docs/source/vlans_recipe.rst
new file mode 100644
index 00000000..3cdfdb23
--- /dev/null
+++ b/docs/source/vlans_recipe.rst
@@ -0,0 +1,6 @@
+VlansRecipe
+^^^^^^^^^^^^^^^^^^^
+
+.. autoclass:: lnst.Recipes.ENRT.VlansRecipe.VlansRecipe
+ :members:
+ :show-inheritance:
diff --git a/lnst/Recipes/ENRT/VlansRecipe.py b/lnst/Recipes/ENRT/VlansRecipe.py
index e6cf599a..f4917365 100644
--- a/lnst/Recipes/ENRT/VlansRecipe.py
+++ b/lnst/Recipes/ENRT/VlansRecipe.py
@@ -13,6 +13,29 @@ from lnst.Devices import VlanDevice
class VlansRecipe(VlanPingEvaluatorMixin,
CommonHWSubConfigMixin, OffloadSubConfigMixin,
BaseEnrtRecipe):
+ """
+ This recipe implements Enrt testing for a network scenario that looks
+ as follows
+
+ .. code-block:: none
+
+ .--------.
+ .--------+ switch +-------.
+ | '--------' |
+ .---'--. .--'---.
+ .-------| eth0 |------. .-------| eth0 |------.
+ | '------' | | '------' |
+ | / | \ | | / | \ |
+ | vlan0 vlan1 vlan2 | | vlan0 vlan1 vlan2 |
+ | id=10 id=20 id=30 | | id=10 id=20 id=30 |
+ | | | |
+ | 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"))
@@ -27,6 +50,22 @@ class VlansRecipe(VlanPingEvaluatorMixin,
dict(gro="on", gso="on", tso="on", tx="on", rx="off")))
def test_wide_configuration(self):
+ """
+ Test wide configuration for this recipe involves creating three
+ VLAN (802.1Q) tunnels on top of the matched host's NIC with vlan
+ ids 10, 20, 30. The same tunnels are configured on the second host.
+
+ 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.eth0.down()
@@ -69,6 +108,10 @@ class VlansRecipe(VlanPingEvaluatorMixin,
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 += [
@@ -95,11 +138,22 @@ class VlansRecipe(VlanPingEvaluatorMixin,
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 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.
+
+ Returned as::
+
+ # list of PingEndpoints with the following pattern
+ [PingEndpoints(src, dst, reachable=(src.vlan_id == dst.vlan_id)), ...]
+ """
host1, host2 = self.matched.host1, self.matched.host2
result = []
for src in [host1.vlan0, host1.vlan1, host1.vlan2]:
@@ -109,6 +163,16 @@ class VlansRecipe(VlanPingEvaluatorMixin,
return result
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
--
2.21.1
4 years
pgkill(SIGINT) not causing OSError of waited-for server in Python 3
by Petr Machata
Hello!
I'm porting an ancient fork that we use internally to Python 3. So far
the conversion was mostly mechanical, and I took your own 2to3 patch as
a basis / inspiration (it doesn't apply cleanly to our fork). However I
hit a weird issue around Netperf. The issue goes like this:
- machine1 starts Netperf as a server. Thus it forks and exec's /bin/sh
-c netserver (ShellProcess.py), and then waitpids (Netperf.py) for the
shell process in the primary process.
- machine2 starts Netperf as a client, so it just launches it, and after
10 seconds the client is done and the machine sends back results.
- The controller eventually sends an intr request to machine1, which in
NetTestCommand.py:interrupt calls pgkill(forked process, SIGINT). In
Python2, this SIGINT causes the waitpid to presumably end with -EINTR,
which causes the Python2 runtime to raise OSError. The waiting process
handles it by sending sigkill, and then sends back the result (in
NetTestCommand::_run). The controller gets the result and happily
proceeds.
In Python3 however, the SIGINT does not cause the OSError. (SIGKILL
doesn't either BTW.) The process ends up stuck waiting forever, until
the controller loses patience, declares timeout, reports a FAIL, and
then proceeds normally again.
Now this is an ancient fork, so maybe you haven't seen this issue in
your development, but then again maybe you have :) If it rings any
bells, or if you have any hints as to where to look, any help would be
appreciated.
Thanks!
Petr
4 years
[PATCH] Recipes.ENRT.BaseEnrtRecipe: skip cross-vlan ping for IPv6
by Jan Tluka
With the current implementation of ping6 there's no way to test
a ping from one vlan to a different one in a similar way to IPv4.
When ping6 -I <ip> makes a bind(sockfd, &ipv6address) the bind is only
a hint so it tries to use the address but if it fails it uses the other
address from the vlan interface.
We had the same issue in legacy LNST and conclusion was to disable
this test for IPv6.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
index 9a35cd44..f7bb5886 100644
--- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py
+++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
@@ -367,6 +367,9 @@ class BaseEnrtRecipe(BaseSubConfigMixin, PingTestAndEvaluate, PerfRecipe):
"""
for endpoints in self.generate_ping_endpoints(config):
for ipv in self.params.ip_versions:
+ if ipv == "ipv6" and not endpoints.reachable:
+ continue
+
ip_filter = {}
if ipv == "ipv4":
ip_filter.update(family = AF_INET)
--
2.21.1
4 years
[PATCH 1/5] lnst.Common.ConnectionHandler: don't pass connections as a reference
by olichtne@redhat.com
From: Ondrej Lichtner <olichtne(a)redhat.com>
Passing self._connections directly like this means that the list object
is passed as a reference. This is potentially dangerous as the
_check_connections method loop as well as updates this list. We should
instead pass a copy of the list.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Common/ConnectionHandler.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst/Common/ConnectionHandler.py b/lnst/Common/ConnectionHandler.py
index 91a94aa..29d4b19 100644
--- a/lnst/Common/ConnectionHandler.py
+++ b/lnst/Common/ConnectionHandler.py
@@ -48,7 +48,7 @@ class ConnectionHandler(object):
self._connection_mapping = {}
def check_connections(self, timeout=None):
- return self._check_connections(self._connections, timeout)
+ return self._check_connections(list(self._connections), timeout)
def check_connections_by_id(self, connection_ids, timeout=None):
connections = []
--
2.26.0
4 years