From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 392A0A04F1; Thu, 18 Jun 2020 08:38:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2D7641B6B4; Thu, 18 Jun 2020 08:38:26 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 80D0CAAB7 for ; Thu, 18 Jun 2020 08:38:24 +0200 (CEST) IronPort-SDR: H98AaIRliC7cWxTUuRA7T2wdATOkMGr0CywhE1WF8YzqZVIvjTpznm0+izlOw3x2YPx34ybwWO i1LFtsTN11ow== X-IronPort-AV: E=McAfee;i="6000,8403,9655"; a="160532130" X-IronPort-AV: E=Sophos;i="5.73,525,1583222400"; d="scan'208";a="160532130" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2020 23:38:24 -0700 IronPort-SDR: V7fR0Bbe42IVD2en9slLBXl/CZ6D8SJoyg0+dawisN/8D9ZMAlrOUrB68KeaOYf/rmNhzKMgiD EiWlJ52OYPTg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,525,1583222400"; d="scan'208";a="352325179" Received: from unknown (HELO dpdk-zhushuai-tetser.icx.intel.com) ([10.240.183.103]) by orsmga001.jf.intel.com with ESMTP; 17 Jun 2020 23:38:22 -0700 From: Zeng Xiaoxiao To: dts@dpdk.org Cc: Zeng Xiaoxiao Date: Thu, 18 Jun 2020 15:18:15 +0000 Message-Id: <20200618151816.4816-2-xiaoxiaox.zeng@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200618151816.4816-1-xiaoxiaox.zeng@intel.com> References: <20200618151816.4816-1-xiaoxiaox.zeng@intel.com> Subject: [dts] [PATCH V2 1/2]tests/cvl_advanced_rss: optimize cvl_advanced_rss code 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Signed-off-by: Zeng Xiaoxiao --- tests/TestSuite_cvl_advanced_rss.py | 32 ++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/tests/TestSuite_cvl_advanced_rss.py b/tests/TestSuite_cvl_advanced_rss.py index 58c7b02..44c8b23 100644 --- a/tests/TestSuite_cvl_advanced_rss.py +++ b/tests/TestSuite_cvl_advanced_rss.py @@ -736,8 +736,8 @@ tv_mac_ipv6_vxlan_icmp_symmetric_toeplitz= { tv_mac_ipv4_simple_xor= { "name":"tv_mac_ipv4_simple_xor", "rte_flow_pattern":"flow create 0 ingress pattern end actions rss func simple_xor key_len 0 queues end / end", - "scapy_str": ['Ether()/IP("src="1.1.4.1",dst="2.2.2.3")/("X"*480)', - 'Ether()/IP("src="2.2.2.3",dst="1.1.4.1")/("X"*480)'], + "scapy_str": ['Ether()/IP(src="1.1.4.1",dst="2.2.2.3")/("X"*480)', + 'Ether()/IP(src="2.2.2.3",dst="1.1.4.1")/("X"*480)'], "check_func": rfc.check_simplexor_queue, "check_func_param": {"expect_port":0} } @@ -856,7 +856,6 @@ class AdvancedRSSTest(TestCase): def _rte_flow_validate_pattern(self, test_vectors, command, is_vxlan): - global test_results out = self.dut.send_expect(command, "testpmd> ", 120) self.logger.debug(out) #print the log self.dut.send_expect("port config 0 rss-hash-key ipv4 1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd", "testpmd> ", 15) @@ -865,9 +864,10 @@ class AdvancedRSSTest(TestCase): self.dut.send_expect("set fwd rxonly", "testpmd> ", 15) self.dut.send_expect("set verbose 1", "testpmd> ", 15) - test_results.clear() self.count = 1 - self.mac_count=100 + self.mac_count = 100 + result_dic = dict() + result_flag = 0 for tv in test_vectors: out = self.dut.send_expect(tv["rte_flow_pattern"], "testpmd> ", 15) #create a rule print(out) @@ -888,14 +888,26 @@ class AdvancedRSSTest(TestCase): print("packet:") print(tv["scapy_str"]) - out = self.dut.send_expect("stop", "testpmd> ",60) - print(out) - log_msg = tv["check_func"](out) - print(log_msg) - rfc.check_rx_tx_packets_match(out, self.mac_count) + if "symmetric" or "xor" in tv["name"]: + out = self.dut.get_session_output(timeout=3) + self.dut.send_expect("stop", "testpmd> ", 60) + else: + out = self.dut.send_expect("stop", "testpmd> ", 60) + result, ret_log = rfc.check_rx_tx_packets_match(out, self.mac_count) + self.verify(result is True, ret_log) + ret_result, log_msg = tv["check_func"](out) + print("%s result is: %s ,%s " % (tv["name"], ret_result, log_msg)) + + result_dic[tv["name"]] = ret_result + + print(result_dic) + + if False in result_dic.values(): + result_flag = 1 self.dut.send_expect("flow flush %d" % self.dut_ports[0], "testpmd> ") self.dut.send_expect("quit", "#") + self.verify(result_flag == 0, "Some case failed") def test_advance_rss_ipv4(self): command = self.create_testpmd_command() -- 2.17.1