test suite reviews and discussions
 help / color / mirror / Atom feed
From: Xinfeng Zhao <xinfengx.zhao@intel.com>
To: dts@dpdk.org
Cc: Xinfeng Zhao <xinfengx.zhao@intel.com>
Subject: [dts] [PATCH V1 3/5] tests: add suite for compressdev zlib pmd test
Date: Mon, 25 Nov 2019 06:32:47 +0800	[thread overview]
Message-ID: <1574634769-325555-3-git-send-email-xinfengx.zhao@intel.com> (raw)
In-Reply-To: <1574634769-325555-1-git-send-email-xinfengx.zhao@intel.com>

Signed-off-by: Xinfeng Zhao <xinfengx.zhao@intel.com>
---
 tests/TestSuite_compressdev_zlib_pmd.py | 84 +++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)
 create mode 100644 tests/TestSuite_compressdev_zlib_pmd.py

diff --git a/tests/TestSuite_compressdev_zlib_pmd.py b/tests/TestSuite_compressdev_zlib_pmd.py
new file mode 100644
index 0000000..31d7194
--- /dev/null
+++ b/tests/TestSuite_compressdev_zlib_pmd.py
@@ -0,0 +1,84 @@
+# BSD LICENSE
+#
+# Copyright(c) 2019 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in
+#     the documentation and/or other materials provided with the
+#     distribution.
+#   * Neither the name of Intel Corporation nor the names of its
+#     contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+import os
+from test_case import TestCase
+import json
+import compress_common as cc
+
+class TestCompressdevZlibPmd(TestCase):
+
+    def set_up_all(self):
+        self.prepare_dpdk()
+        cc.default_eals.update({"w":"0000:00:00.0", "vdev": "compress_zlib"})
+        cc.default_opts.update({"driver-name": "compress_zlib"})
+        self._perf_result = dict()
+
+    def set_up(self):
+        pass
+
+    def prepare_dpdk(self):
+        self.dut.send_expect(
+            "sed -i 's/CONFIG_RTE_COMPRESSDEV_TEST=n$/CONFIG_RTE_COMPRESSDEV_TEST=y/' config/common_base", "# ")
+        self.dut.send_expect(
+            "sed -i 's/CONFIG_RTE_LIBRTE_PMD_ZLIB=n$/CONFIG_RTE_LIBRTE_PMD_ZLIB=y/' config/common_base", "# ")
+        self.dut.build_install_dpdk(self.dut.target)
+
+    def test_zlib_pmd_unit_test(self):
+        cc.run_unit(self)
+
+    def test_zlib_pmd_fixed_func(self):
+        cc.default_opts.update({"huffman-enc": "fixed"})
+        result = cc.run_perf(self)
+        self._perf_result.update(result)
+
+    def test_zlib_pmd_dynamic_func(self):
+        cc.default_opts.update({"huffman-enc": "dynamic"})
+        result = cc.run_perf(self)
+        self._perf_result.update(result)
+
+    def tear_down(self):
+        pass
+
+    def tear_down_all(self):
+        self.dut.kill_all()
+
+        self.dut.send_expect(
+            "sed -i 's/CONFIG_RTE_COMPRESSDEV_TEST=y$/CONFIG_RTE_COMPRESSDEV_TEST=n/' config/common_base", "# ")
+        self.dut.send_expect(
+            "sed -i 's/CONFIG_RTE_LIBRTE_PMD_ZLIB=y$/CONFIG_RTE_LIBRTE_PMD_ZLIB=n/' config/common_base", "# ")
+        self.dut.build_install_dpdk(self.dut.target)
+
+        if not self._perf_result:
+            return
+        with open(self.logger.log_path + "/" + self.suite_name + ".json", "w") as fv:
+            json.dump(self._perf_result, fv, indent=4)
-- 
2.7.4


  parent reply	other threads:[~2019-11-25  7:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-24 22:32 [dts] [PATCH V1 1/5] tests: add common method for compress test suites Xinfeng Zhao
2019-11-24 22:32 ` [dts] [PATCH V1 2/5] tests: add suite for compressdev qat pmd test Xinfeng Zhao
2019-11-25  8:38   ` Wan, Zhe
2019-11-24 22:32 ` Xinfeng Zhao [this message]
2019-11-25  8:39   ` [dts] [PATCH V1 3/5] tests: add suite for compressdev zlib " Wan, Zhe
2019-11-24 22:32 ` [dts] [PATCH V1 4/5] tests: add suite for compressdev isal " Xinfeng Zhao
2019-11-25  7:26   ` Zhao, XinfengX
2019-11-25  8:39     ` Wan, Zhe
2019-11-24 22:32 ` [dts] [PATCH V1 5/5] conf: add config file for compress test Xinfeng Zhao
2019-11-25  8:40   ` Wan, Zhe
2019-11-25  7:28 ` [dts] [PATCH V1 1/5] tests: add common method for compress test suites Zhao, XinfengX
2019-11-27  9:07   ` Tu, Lijuan
2019-11-25  8:38 ` Wan, Zhe
2019-11-27  9:08 ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1574634769-325555-3-git-send-email-xinfengx.zhao@intel.com \
    --to=xinfengx.zhao@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).