resent

On Fri, Sep 18, 2020 at 4:18 AM Jan Tluka <jtluka@redhat.com> wrote:
Thu, Sep 17, 2020 at 10:00:44PM CEST, pgagne@redhat.com wrote:
>From: Perry Gagne <pgagne@redhat.com>
>
>Added docstrings and sphinx configs.
>
>Signed-off-by: Perry Gagne <pgagne@redhat.com>
>---
> docs/source/specific_scenarios.rst |   1 +
> docs/source/team_recipe.rst        |   6 ++
> lnst/Recipes/ENRT/TeamRecipe.py    | 125 +++++++++++++++++++++++++++++
> 3 files changed, 132 insertions(+)
> create mode 100644 docs/source/team_recipe.rst
>
>diff --git a/docs/source/specific_scenarios.rst b/docs/source/specific_scenarios.rst
>index c3d8190..b78577c 100644
>--- a/docs/source/specific_scenarios.rst
>+++ b/docs/source/specific_scenarios.rst
>@@ -3,5 +3,6 @@ Specific ENRT scenarios
>
> .. toctree::
>     simple_network_recipe
>+    team_recipe
>     vlans_recipe
>     vlans_over_bond_recipe
>diff --git a/docs/source/team_recipe.rst b/docs/source/team_recipe.rst
>new file mode 100644
>index 0000000..b45df44
>--- /dev/null
>+++ b/docs/source/team_recipe.rst
>@@ -0,0 +1,6 @@
>+TeamRecipe
>+^^^^^^^^^^^^^^^^^^^
>+
>+.. autoclass:: lnst.Recipes.ENRT.TeamRecipe.TeamRecipe
>+    :members:
>+    :show-inheritance:
>diff --git a/lnst/Recipes/ENRT/TeamRecipe.py b/lnst/Recipes/ENRT/TeamRecipe.py
>index b8233c8..932e75f 100644
>--- a/lnst/Recipes/ENRT/TeamRecipe.py
>+++ b/lnst/Recipes/ENRT/TeamRecipe.py
>@@ -14,6 +14,38 @@ from lnst.Devices import TeamDevice
>
> class TeamRecipe(PerfReversibleFlowMixin, CommonHWSubConfigMixin, OffloadSubConfigMixin,
>     BaseEnrtRecipe):
>+    """
>+    This recipe implements Enrt testing for a network scenario that looks
>+    as follows
>+
>+    .. code-block:: none
>+
>+                                    .--------.
>+                   .----------------+        |
>+                   |        .-------+ switch +-------.
>+                   |        |       '--------'       |
>+             .-------------------.                   |
>+             |     | team0  |    |                   |
>+             | .---'--. .---'--. |               .---'--.
>+        .----|-| eth0 |-| eth1 |-|----.     .----| eth0 |----.
>+        |    | '------' '------' |    |     |    '------'    |
>+        |    '-------------------'    |     |                |
>+        |                             |     |                |
>+        |            host1            |     |      host2     |
>+        '-----------------------------'     '----------------'
>+
>+
>+    The recipe provides additional recipe parameters to configure the teaming
>+    device.
>+
>+        :param runner_name:
>+            (mandatory test parameter) the teamd runner to be use on
>+            the team0 device (ex. `activebackup`, `roundrobin`, etc)
>+
>+    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="tnet", driver=RecipeParam("driver"))
>     host1.eth1 = DeviceReq(label="tnet", driver=RecipeParam("driver"))
>@@ -30,6 +62,16 @@ class TeamRecipe(PerfReversibleFlowMixin, CommonHWSubConfigMixin, OffloadSubConf
>     runner_name = StrParam(mandatory=True)
>
>     def test_wide_configuration(self):
>+        """
>+        Test wide configuration for this recipe involves creating a team
>+        device using the two matched physical devices as ports on host1.
>+        The `teamd` daemon is configured with the `runner_name` according
>+        to the recipe parameters. IPv4 and IPv6 addresses are added to
>+        the teaming device and to the matched ethernet device on host2.
>+
>+        | host1.team0 = 192.168.10.1/24 and fc00:0:0:1::1/64
>+        | host2.eth0 = 192.168.10.2/24 and fc00:0:0:1::2/64
>+        """
>         host1, host2 = self.matched.host1, self.matched.host2
>
>         teamd_config = {'runner': {'name': self.params.runner_name}}
>@@ -56,6 +98,10 @@ class TeamRecipe(PerfReversibleFlowMixin, CommonHWSubConfigMixin, OffloadSubConf
>         return configuration
>
>     def generate_test_wide_description(self, config):
>+        """
>+        Test wide description is extended with the configured IP addresses, the
>+        configured team device ports, and runner name.
>+        """
>         host1, host2 = self.matched.host1, self.matched.host2
>         desc = super().generate_test_wide_description(config)
>         desc += [
>@@ -83,33 +129,112 @@ class TeamRecipe(PerfReversibleFlowMixin, CommonHWSubConfigMixin, OffloadSubConf
>         super().test_wide_deconfiguration(config)
>
>     def generate_ping_endpoints(self, config):
>+        """
>+        The ping endpoints for this recipe are the configured team device on
>+        host1 and the matched ethernet device on host2.
>+
>+        Returned as::
>+
>+            [PingEndpoints(self.matched.host1.team0, self.matched.host2.eth0),
>+            PingEndpoints(self.matched.host2.eth0, self.matched.host1.team0)]
>+        """
>         return [
>             PingEndpoints(self.matched.host1.team0, self.matched.host2.eth0),
>             PingEndpoints(self.matched.host2.eth0, self.matched.host1.team0)
>         ]
>
>     def generate_perf_endpoints(self, config):
>+        """
>+        The perf endpoints for this recipe are the configured team device on
>+        host1 and the matched ethernet device on host2. The traffic egresses
>+        the team device.
>+
>+        | host1.team0
>+        | host2.eth0
>+
>+        Returned as::
>+
>+            [(self.matched.host1.team0, self.matched.host2.eth0)]
>+
>+        """
>         return [(self.matched.host1.team0, self.matched.host2.eth0)]
>
>     @property
>     def offload_nics(self):
>+        """
>+        The `offload_nics` property value for this scenario is a list containing
>+        the configured team device on host1 and the matched ethernet device
>+        on host2.
>+
>+        | host1.team0
>+        | host2.eth0
>+
>+        For detailed explanation of this property see :any:`OffloadSubConfigMixin`
>+        class and :any:`OffloadSubConfigMixin.offload_nics`.
>+        """
>         return [self.matched.host1.team0, 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 teaming device on host1 and the matched ethernet
>+        device on host2.
>+
>+        | host1.team0
>+        | host2.eth0
>+
>+        For detailed explanation of this property see :any:`MTUHWConfigMixin`
>+        class and :any:`MTUHWConfigMixin.mtu_hw_config_dev_list`.
>+        """
>         return [self.matched.host1.team0, 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 teaming
>+        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`.
>+        """
>         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 containing the matched physical devices used to create the
>+        teaming 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`.

Copy paste error here. CoalescingHWConfigMixin -> DevInterruptHWConfigMixin

Otherwise looks ok.

-Jan

>+        """
>         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 containing the matched physical devices used to create
>+        the teaming 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`.
>+        """
>         host1, host2 = self.matched.host1, self.matched.host2
>         return [host1.eth0, host1.eth1, host2.eth0]
>--
>2.26.2
>_______________________________________________
>LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org
>To unsubscribe send an email to lnst-developers-leave@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.fedorahosted.org