From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id DB66E5B30 for ; Wed, 24 Oct 2018 11:09:11 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2018 02:09:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,419,1534834800"; d="scan'208";a="98106107" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.240.176.135]) by fmsmga002.fm.intel.com with ESMTP; 24 Oct 2018 02:09:10 -0700 From: wenjieli To: dts@dpdk.org Cc: wenjieli Date: Wed, 24 Oct 2018 17:12:11 +0800 Message-Id: <1540372331-10787-1-git-send-email-wenjiex.a.li@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V3] tests/shutdown_api: check crc strip bit instead of Rx offloads to verify CRC is enabled or not 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: Wed, 24 Oct 2018 09:09:12 -0000 If crc strip is enabled, the crc strip bit (bit 16) is 0, else it is 1. Use this bit to check crc is enabled or not, will not just check the Rx offloads value in output. Signed-off-by: wenjieli --- tests/TestSuite_shutdown_api.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/TestSuite_shutdown_api.py b/tests/TestSuite_shutdown_api.py index 52a8fbf..1282cf7 100644 --- a/tests/TestSuite_shutdown_api.py +++ b/tests/TestSuite_shutdown_api.py @@ -263,18 +263,24 @@ class TestShutdownApi(TestCase): """ Reconfigure All Ports With The Same Configurations (CRC) """ + RX_OFFLOAD_KEEP_CRC = 0x10000 + self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop --disable-crc-strip" % utils.create_mask(self.ports), socket=self.ports_socket) out = self.dut.send_expect("show config rxtx", "testpmd> ") + Rx_offloads = re.compile('Rx offloads=(.*?)\s+?').findall(out, re.S) + crc_keep = int(Rx_offloads[0],16) & RX_OFFLOAD_KEEP_CRC and int(Rx_offloads[1],16) & RX_OFFLOAD_KEEP_CRC self.verify( - "Rx offloads=0x10000" in out, "CRC keeping not enabled properly") + crc_keep == RX_OFFLOAD_KEEP_CRC, "CRC keeping not enabled properly") self.dut.send_expect("port stop all", "testpmd> ", 100) self.dut.send_expect("port config all crc-strip on", "testpmd> ") self.dut.send_expect("set fwd mac", "testpmd>") self.dut.send_expect("port start all", "testpmd> ", 100) out = self.dut.send_expect("show config rxtx", "testpmd> ") + Rx_offloads = re.compile('Rx offloads=(.*?)\s+?').findall(out, re.S) + crc_strip = int(Rx_offloads[0],16) | ~RX_OFFLOAD_KEEP_CRC and int(Rx_offloads[1],16) | ~RX_OFFLOAD_KEEP_CRC self.verify( - "Rx offloads=0x1000" in out, "CRC stripping not enabled properly") + crc_strip == ~RX_OFFLOAD_KEEP_CRC, "CRC stripping not enabled properly") self.dut.send_expect("start", "testpmd> ") self.check_forwarding() -- 2.17.2