From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A0261A04FD; Tue, 27 Dec 2022 10:36:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A046410FC; Tue, 27 Dec 2022 10:36:00 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id DCEDA40E2D for ; Tue, 27 Dec 2022 10:35:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672133759; x=1703669759; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=fU26Q0ZoEq3rC4vRQvajFSXJOhuYhL8v5CkwBWLi0po=; b=RAul96J6LcDdERrPhUAamR6aFnaKeVLyfJg+goxoM05OsGzst+uUzsfr pFNR07/6eZ9Fmokwrol5QujbT1x9axd4n0MD6ZlU8qkuPisomCFoWUdgm +1NHoqE6mT7y4qkufgJuD+81h0kVG2Oy73UOSRbEyG+trEcN78mQlU/Yx hKF4w5TBveUoo+mzBf2BZj4em/tgPTFMEpIAswnPl0dO9zs5HIVn1RTPR FkoTakbzoMv9Ma/4wviGGb92pPbMJYyPx0p+iqJj2sN6OFwPX35sk4kbK wgMo9fJE50fLTKW5vJSIh4OgVgYDC4Hn33iBKgSdw7kgyfm/Te0/X9rs2 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10572"; a="322651653" X-IronPort-AV: E=Sophos;i="5.96,278,1665471600"; d="scan'208";a="322651653" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Dec 2022 01:35:57 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10572"; a="898306185" X-IronPort-AV: E=Sophos;i="5.96,278,1665471600"; d="scan'208";a="898306185" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Dec 2022 01:35:32 -0800 From: Song Jiale To: dts@dpdk.org Cc: Song Jiale Subject: [dts] [PATCH v2 1/2] tests/multiprocess: add new cases according to testplan Date: Tue, 27 Dec 2022 17:33:24 +0000 Message-Id: <20221227173325.513047-1-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 Signed-off-by: Song Jiale --- v2: -optimization the method of check_port_status. tests/TestSuite_multiprocess.py | 98 ++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py index 4fdc8c27..55e5d555 100644 --- a/tests/TestSuite_multiprocess.py +++ b/tests/TestSuite_multiprocess.py @@ -757,6 +757,19 @@ class TestMultiprocess(TestCase): "some subcases failed, detail as below:{}".format(msg), ) + def check_port_status(self, pmd_output, port_id, status=True): + port_status = pmd_output.get_port_link_status(port_id) + if status: + self.verify( + port_status == "up", + "The expected link state is up, but the actual status is down", + ) + else: + self.verify( + port_status == "down", + "The expected link state is down, but the actual status is up", + ) + def test_multiprocess_simple_mpbasicoperation(self): """ Basic operation. @@ -1691,6 +1704,90 @@ class TestMultiprocess(TestCase): } self.rte_flow(mac_ipv4_symmetric, self.multiprocess_rss_data, **pmd_param) + def test_multiprocess_port_stop(self): + packets = [ + 'Ether(dst="00:11:22:33:44:55", src="52:00:00:00:00:00")/IP()/Raw(load="P"*20)', + ] + # start testpmd multi-process + self.launch_multi_testpmd( + proc_type="auto", + queue_num=8, + process_num=2, + ) + for pmd_output in self.pmd_output_list: + pmd_output.execute_cmd("stop") + # set primary process port stop + self.pmd_output_list[0].execute_cmd("port stop 0") + self.pmd_output_list[1].execute_cmd("start") + fdir_pro = fdirprocess( + self, + self.pmd_output_list[1], + self.tester_ifaces, + rxq=8, + ) + out = self.send_pkt_get_output(fdir_pro, packets, port_id=0, count=1) + # Check that no packet was received + self.check_pkt_num(out, port_id=0, pkt_num=0) + for pmd_output in self.pmd_output_list: + pmd_output.quit() + + # start testpmd multi-process + self.launch_multi_testpmd( + proc_type="auto", + queue_num=8, + process_num=2, + ) + for pmd_output in self.pmd_output_list: + pmd_output.execute_cmd("stop") + # set secondary process port stop + self.pmd_output_list[1].execute_cmd("port stop 0") + self.pmd_output_list[0].execute_cmd("start") + fdir_pro = fdirprocess( + self, + self.pmd_output_list[0], + self.tester_ifaces, + rxq=8, + ) + out = self.send_pkt_get_output(fdir_pro, packets, port_id=0, count=1) + # Check that one packet was received in primary process + self.check_pkt_num(out, port_id=0, pkt_num=len(packets)) + + def test_multiprocess_port_reset(self): + # start testpmd multi-process + self.launch_multi_testpmd( + proc_type="auto", + queue_num=8, + process_num=2, + ) + for pmd_output in self.pmd_output_list: + pmd_output.execute_cmd("stop") + self.check_port_status(pmd_output, port_id=0, status=True) + # set primary process port reset + self.pmd_output_list[0].execute_cmd("port stop 0") + self.pmd_output_list[0].execute_cmd("port reset 0") + # Check that link status of port 0 is 'down' in secondary process and primary process + self.check_port_status(self.pmd_output_list[0], port_id=0, status=False) + self.check_port_status(self.pmd_output_list[1], port_id=0, status=False) + + for pmd_output in self.pmd_output_list: + pmd_output.quit() + + # start testpmd multi-process + self.launch_multi_testpmd( + proc_type="auto", + queue_num=8, + process_num=2, + ) + for pmd_output in self.pmd_output_list: + pmd_output.execute_cmd("stop") + self.check_port_status(pmd_output, port_id=0, status=True) + # set secondary process port reset + self.pmd_output_list[1].execute_cmd("port stop 0") + self.pmd_output_list[1].execute_cmd("port reset 0") + # Check that link status of port 0 is 'up' in secondary process and primary process + self.check_port_status(self.pmd_output_list[0], port_id=0, status=True) + self.check_port_status(self.pmd_output_list[1], port_id=0, status=True) + def test_perf_multiprocess_performance(self): """ Benchmark Multiprocess performance. @@ -1926,4 +2023,3 @@ class TestMultiprocess(TestCase): Run after each test suite. """ self.dut.kill_all() - pass -- 2.25.1