aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/autogen/Testcase.py
diff options
context:
space:
mode:
authorViliam Luc <vluc@cisco.com>2021-08-02 14:25:26 +0200
committerViliam Luc <vluc@cisco.com>2021-09-10 10:26:24 +0200
commitec467277744783015a2da6713298b35d13d92e6f (patch)
tree57b1bb084f5ae9c6346be5a92f8fe5fac38f1cd4 /resources/libraries/python/autogen/Testcase.py
parent9cceefae3248e9a1e9e5586391c9263cf114a753 (diff)
back-to-back tests: add TG tests
Change-Id: I9d028294deb1e31b6d185deb1c7523e0226a0ada Signed-off-by: Viliam Luc <vluc@cisco.com>
Diffstat (limited to 'resources/libraries/python/autogen/Testcase.py')
-rw-r--r--resources/libraries/python/autogen/Testcase.py27
1 files changed, 24 insertions, 3 deletions
diff --git a/resources/libraries/python/autogen/Testcase.py b/resources/libraries/python/autogen/Testcase.py
index 643d32a3cb..32fc5014cc 100644
--- a/resources/libraries/python/autogen/Testcase.py
+++ b/resources/libraries/python/autogen/Testcase.py
@@ -33,16 +33,17 @@ class Testcase:
"""
self.template = Template(template_string)
- def generate(self, frame_size, phy_cores):
+ def generate(self, frame_size, phy_cores=None):
"""Return string of test case code with placeholders filled.
Fail if there are placeholders left unfilled.
It is not required for all placeholders to be present in template.
:param frame_size: Imix string or numeric frame size. Example: 74.
- :param phy_cores: Number of physical cores to use. Example: 2.
+ :param phy_cores: Number of physical cores to use. Example: 2. It can
+ be None in n2n testcases.
:type frame_size: str or int
- :type phy_cores: int or str
+ :type phy_cores: int, str or None
:returns: Filled template, usable as test case code.
:rtype: str
"""
@@ -57,6 +58,8 @@ class Testcase:
u"frame_num": str(frame_size),
u"frame_str": u"IMIX"
}
+ if phy_cores is None:
+ return self.template.substitute(subst_dict)
cores_str = str(phy_cores)
cores_num = int(cores_str)
subst_dict.update(
@@ -136,3 +139,21 @@ class Testcase:
| | frame_size=${{frame_num}} | phy_cores=${{cores_num}}
'''
return cls(template_string)
+
+ @classmethod
+ def trex(cls, suite_id):
+ """Factory method for creating "trex" testcase objects.
+
+ Testcase name will contain frame size, but not core count.
+
+ :param suite_id: Part of suite name to distinguish from other suites.
+ :type suite_id: str
+ :returns: Instance for generating testcase text of this type.
+ :rtype: Testcase
+ """
+ template_string = f'''
+| ${{frame_str}}--{suite_id}
+| | [Tags] | ${{frame_str}}
+| | frame_size=${{frame_num}}
+'''
+ return cls(template_string)
color: #ae81ff } /* Literal.Number.Float */ .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ .highlight .sa { color: #e6db74 } /* Literal.String.Affix */ .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ .highlight .sc { color: #e6db74 } /* Literal.String.Char */ .highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */ .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ .highlight .se { color: #ae81ff } /* Literal.String.Escape */ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
.. raw:: latex

    \clearpage

.. raw:: html

    <script type="text/javascript">

        function getDocHeight(doc) {
            doc = doc || document;
            var body = doc.body, html = doc.documentElement;
            var height = Math.max( body.scrollHeight, body.offsetHeight,
                html.clientHeight, html.scrollHeight, html.offsetHeight );
            return height;
        }

        function setIframeHeight(id) {
            var ifrm = document.getElementById(id);
            var doc = ifrm.contentDocument? ifrm.contentDocument:
                ifrm.contentWindow.document;
            ifrm.style.visibility = 'hidden';
            ifrm.style.height = "10px"; // reset to minimal height ...
            // IE opt. for bing/msn needs a bit added or scrollbar appears
            ifrm.style.height = getDocHeight( doc ) + 4 + "px";
            ifrm.style.visibility = 'visible';
        }

    </script>

VSAP with ldpreload
~~~~~~~~~~~~~~~~~~~

.. todo::
    Add introduction

.. raw:: latex

    \clearpage

2t1c-e810cq-base-scale-cps
--------------------------

.. raw:: html

    <iframe id="ifrm01" onload="setIframeHeight(this.id)" width="700" frameborder="0" scrolling="no" src="../../../_static/vpp/2n-clx-e810cg-0b-2t1c-eth-ip4tcphttp-ldpreload-nginx-cps.html"></iframe>

.. raw:: latex

    \begin{figure}[H]
        \centering
            \graphicspath{{../_build/_static/vpp/}}
            \includegraphics[clip, trim=0cm 0cm 5cm 0cm, width=0.70\textwidth]{2n-clx-e810cg-0b-2t1c-eth-ip4tcphttp-ldpreload-nginx-cps}
            \label{fig:2n-clx-e810cg-0b-2t1c-eth-ip4tcphttp-ldpreload-nginx-cps}
    \end{figure}

.. raw:: latex

    \clearpage

.. raw:: html

    <iframe id="ifrm02" onload="setIframeHeight(this.id)" width="700" frameborder="0" scrolling="no" src="../../../_static/vpp/2n-clx-e810cg-64b-2t1c-eth-ip4tcphttp-ldpreload-nginx-cps.html"></iframe>

.. raw:: latex

    \begin{figure}[H]
        \centering
            \graphicspath{{../_build/_static/vpp/}}
            \includegraphics[clip, trim=0cm 0cm 5cm 0cm, width=0.70\textwidth]{2n-clx-e810cg-64b-2t1c-eth-ip4tcphttp-ldpreload-nginx-cps}
            \label{fig:2n-clx-e810cg-64b-2t1c-eth-ip4tcphttp-ldpreload-nginx-cps}
    \end{figure}

.. raw:: latex

    \clearpage

.. raw:: html

    <iframe id="ifrm03" onload="setIframeHeight(this.id)" width="700" frameborder="0" scrolling="no" src="../../../_static/vpp/2n-clx-e810cg-1024b-2t1c-eth-ip4tcphttp-ldpreload-nginx-cps.html"></iframe>

.. raw:: latex

    \begin{figure}[H]
        \centering
            \graphicspath{{../_build/_static/vpp/}}
            \includegraphics[clip, trim=0cm 0cm 5cm 0cm, width=0.70\textwidth]{2n-clx-e810cg-1024b-2t1c-eth-ip4tcphttp-ldpreload-nginx-cps}
            \label{fig:2n-clx-e810cg-1024b-2t1c-eth-ip4tcphttp-ldpreload-nginx-cps}
    \end{figure}

.. raw:: latex

    \clearpage

.. raw:: html

    <iframe id="ifrm04" onload="setIframeHeight(this.id)" width="700" frameborder="0" scrolling="no" src="../../../_static/vpp/2n-clx-e810cg-2048b-2t1c-eth-ip4tcphttp-ldpreload-nginx-cps.html"></iframe>

.. raw:: latex

    \begin{figure}[H]
        \centering
            \graphicspath{{../_build/_static/vpp/}}
            \includegraphics[clip, trim=0cm 0cm 5cm 0cm, width=0.70\textwidth]{2n-clx-e810cg-2048b-2t1c-eth-ip4tcphttp-ldpreload-nginx-cps}
            \label{fig:2n-clx-e810cg-2048b-2t1c-eth-ip4tcphttp-ldpreload-nginx-cps}
    \end{figure}

.. raw:: latex

    \clearpage

2t1c-e810cq-base-scale-rps
--------------------------

.. raw:: html

    <iframe id="ifrm01r" onload="setIframeHeight(this.id)" width="700" frameborder="0" scrolling="no" src="../../../_static/vpp/2n-clx-e810cg-0b-2t1c-eth-ip4tcphttp-ldpreload-nginx-rps.html"></iframe>

.. raw:: latex

    \begin{figure}[H]
        \centering
            \graphicspath{{../_build/_static/vpp/}}
            \includegraphics[clip, trim=0cm 0cm 5cm 0cm, width=0.70\textwidth]{2n-clx-e810cg-0b-2t1c-eth-ip4tcphttp-ldpreload-nginx-rps}
            \label{fig:2n-clx-e810cg-0b-2t1c-eth-ip4tcphttp-ldpreload-nginx-rps}
    \end{figure}

.. raw:: latex

    \clearpage

.. raw:: html

    <iframe id="ifrm02r" onload="setIframeHeight(this.id)" width="700" frameborder="0" scrolling="no" src="../../../_static/vpp/2n-clx-e810cg-64b-2t1c-eth-ip4tcphttp-ldpreload-nginx-rps.html"></iframe>

.. raw:: latex

    \begin{figure}[H]
        \centering
            \graphicspath{{../_build/_static/vpp/}}
            \includegraphics[clip, trim=0cm 0cm 5cm 0cm, width=0.70\textwidth]{2n-clx-e810cg-64b-2t1c-eth-ip4tcphttp-ldpreload-nginx-rps}
            \label{fig:2n-clx-e810cg-64b-2t1c-eth-ip4tcphttp-ldpreload-nginx-rps}
    \end{figure}

.. raw:: latex

    \clearpage

.. raw:: html

    <iframe id="ifrm03r" onload="setIframeHeight(this.id)" width="700" frameborder="0" scrolling="no" src="../../../_static/vpp/2n-clx-e810cg-1024b-2t1c-eth-ip4tcphttp-ldpreload-nginx-rps.html"></iframe>

.. raw:: latex

    \begin{figure}[H]
        \centering
            \graphicspath{{../_build/_static/vpp/}}
            \includegraphics[clip, trim=0cm 0cm 5cm 0cm, width=0.70\textwidth]{2n-clx-e810cg-1024b-2t1c-eth-ip4tcphttp-ldpreload-nginx-rps}
            \label{fig:2n-clx-e810cg-1024b-2t1c-eth-ip4tcphttp-ldpreload-nginx-rps}
    \end{figure}

.. raw:: latex

    \clearpage

.. raw:: html

    <iframe id="ifrm04r" onload="setIframeHeight(this.id)" width="700" frameborder="0" scrolling="no" src="../../../_static/vpp/2n-clx-e810cg-2048b-2t1c-eth-ip4tcphttp-ldpreload-nginx-rps.html"></iframe>

.. raw:: latex

    \begin{figure}[H]
        \centering
            \graphicspath{{../_build/_static/vpp/}}
            \includegraphics[clip, trim=0cm 0cm 5cm 0cm, width=0.70\textwidth]{2n-clx-e810cg-2048b-2t1c-eth-ip4tcphttp-ldpreload-nginx-rps}
            \label{fig:2n-clx-e810cg-2048b-2t1c-eth-ip4tcphttp-ldpreload-nginx-rps}
    \end{figure}