From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B71D0691A for ; Thu, 6 Apr 2017 06:51:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491454295; x=1522990295; h=from:to:cc:subject:date:message-id; bh=eXVmCVJiLl9Spi5rYnfMm+01jV8aC25ITJtKPZLKXWY=; b=A2dmZMwT0DnHRpyLPyftqztEUsbKEimznNP8HI872YyU93PUcHF4rgZ1 m7VqV7Mowl8MJYPJsSpbGba7G29OOw==; Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2017 21:51:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,282,1488873600"; d="scan'208";a="85348561" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.239.129.248]) by fmsmga006.fm.intel.com with ESMTP; 05 Apr 2017 21:51:33 -0700 From: Peng Yuan To: dts@dpdk.org Cc: Peng Yuan Date: Thu, 6 Apr 2017 13:31:06 -0400 Message-Id: <1491499866-78994-1-git-send-email-yuan.peng@intel.com> X-Mailer: git-send-email 2.5.0 Subject: [dts] [PATCH] tests: fix the bug of verifyResult_symmetric X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Apr 2017 04:51:36 -0000 Signed-off-by: Peng Yuan 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