[dts] [PATCH] tests/unit_tests_eal: add more hash relative unit tests.

Xueqin Lin xueqin.lin at intel.com
Fri Nov 30 02:12:58 CET 2018


From: "xueqin.lin" <xueqin.lin at intel.com>

test_hash_functions
test_hash_multiwriter
test_hash_readwrite
test_hash_readwrite_lf		

Signed-off-by: Xueqin Lin <xueqin.lin at intel.com>

---
 tests/TestSuite_unit_tests_eal.py | 55 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/tests/TestSuite_unit_tests_eal.py b/tests/TestSuite_unit_tests_eal.py
index 68a4cbe..c7de5b7 100644
--- a/tests/TestSuite_unit_tests_eal.py
+++ b/tests/TestSuite_unit_tests_eal.py
@@ -115,6 +115,13 @@ class TestUnitTestsEal(TestCase):
         self.dut.send_expect(self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time)
         out = self.dut.send_expect("hash_autotest", "RTE>>", self.run_cmd_time)
         self.dut.send_expect("quit", "# ")
+
+        # Extendable Bucket Table enhances and guarantees insertion of 100% of
+        # the keys for a given hash table size. Add the check that average
+        # table utilization is 100% when extendable table is enabled.
+
+        self.verify("Average table utilization = 100.00%" in out,
+                    "Test failed for extenable bucket table")
         self.verify("Test OK" in out, "Test failed")
 
     def test_hash_perf(self):
@@ -128,6 +135,54 @@ class TestUnitTestsEal(TestCase):
         self.dut.send_expect("quit", "# ")
         self.verify("Test OK" in out, "Test failed")
 
+    def test_hash_functions(self):
+        """
+        Run hash functions autotest.
+        """
+
+        self.dut.send_expect(self.test_app_cmdline,
+                             "R.*T.*E.*>.*>", self.start_test_time)
+        out = self.dut.send_expect("hash_functions_autotest",
+                                   "RTE>>", self.run_cmd_time)
+        self.dut.send_expect("quit", "# ")
+        self.verify("Test OK" in out, "Test failed")
+
+    def test_hash_multiwriter(self):
+        """
+        Run hash multiwriter autotest.
+        """
+
+        self.dut.send_expect(self.test_app_cmdline,
+                             "R.*T.*E.*>.*>", self.start_test_time)
+        out = self.dut.send_expect("hash_multiwriter_autotest",
+                                   "RTE>>", self.run_cmd_time)
+        self.dut.send_expect("quit", "# ")
+        self.verify("Test OK" in out, "Test failed")
+
+    def test_hash_readwrite(self):
+        """
+        Run hash readwrite autotest.
+        """
+
+        self.dut.send_expect(self.test_app_cmdline,
+                             "R.*T.*E.*>.*>", self.start_test_time)
+        out = self.dut.send_expect("hash_readwrite_autotest",
+                                   "RTE>>", self.run_cmd_time)
+        self.dut.send_expect("quit", "# ")
+        self.verify("Test OK" in out, "Test failed")
+
+    def test_hash_readwrite_lf(self):
+        """
+        Run hash readwrite_lf autotest.
+        """
+
+        self.dut.send_expect("./%s/app/test" % self.target,
+                             "R.*T.*E.*>.*>", self.start_test_time)
+        out = self.dut.send_expect("hash_readwrite_lf_autotest",
+                                   "RTE>>", self.run_cmd_time)
+        self.dut.send_expect("quit", "# ")
+        self.verify("Test OK" in out, "Test failed")
+
     def test_func_reentrancy(self):
         """
         Run function reentrancy autotest.
-- 
2.7.5



More information about the dts mailing list