test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] tests: fix the bug of verifyResult_symmetric
@ 2017-04-06 17:31 Peng Yuan
  0 siblings, 0 replies; only message in thread
From: Peng Yuan @ 2017-04-06 17:31 UTC (permalink / raw)
  To: dts; +Cc: Peng Yuan

Signed-off-by: Peng Yuan <yuan.peng@intel.com>

diff --git a/tests/TestSuite_pmdrss_hash.py b/tests/TestSuite_pmdrss_hash.py
index 78ae34d..7982541 100644
--- a/tests/TestSuite_pmdrss_hash.py
+++ b/tests/TestSuite_pmdrss_hash.py
@@ -383,25 +383,38 @@ class TestPmdrssHash(TestCase):
 
         global reta_lines
         global reta_num
-        result = []
+        result0 = []
+        result1 = []
         self.result_table_create(
             ['packet index', 'RSS hash', 'hash index', 'queue id', 'actual queue id', 'pass '])
 
         i = 0
         for tmp_reta_line in reta_lines:
-            status = "true"
+            status0 = "true"
             # compute the hash result of five tuple into the 7 LSBs value.
             hash_index = int(tmp_reta_line["RSS hash"], 16) % reta_num
+            print reta_entries[hash_index], tmp_reta_line
+            if(reta_entries[hash_index] == int(tmp_reta_line["queue"])):
+                status0 = "true"
+                result0.insert(i, 0)
+            else:
+                status0 = "fail"
+                result0.insert(i, 1)
 
+            status1 = "true"
             if(i % 2 == 1):
                 if(pre_RSS_hash == tmp_reta_line["RSS hash"]):
-                    status = "true"
-                    result.insert((i - 1) / 2, 0)
+                    status1 = "true"
+                    result1.insert((i - 1) / 2, 0)
                 else:
-                    status = "fail"
-                    result.insert((i - 1) / 2, 1)
+                    status1 = "fail"
+                    result1.insert((i - 1) / 2, 1)
             pre_RSS_hash = tmp_reta_line["RSS hash"]
 
+            status = "fail"
+            if (status0 == "true" and status1 == "true"):
+                status = "true"
+
             self.result_table_add(
                 [i, tmp_reta_line["RSS hash"], hash_index, reta_entries[hash_index], tmp_reta_line["queue"], status])
             i = i + 1
@@ -409,7 +422,7 @@ class TestPmdrssHash(TestCase):
         self.result_table_print()
         reta_lines = []
         self.verify(
-            sum(result) == 0, "the symmetric RSS hash function failed!")
+            (sum(result0) == 0 and sum(result1) == 0), "the symmetric RSS hash function failed!")
 
     def set_up_all(self):
         """
-- 
2.5.0

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-06  4:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06 17:31 [dts] [PATCH] tests: fix the bug of verifyResult_symmetric Peng Yuan

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).